From: Alan Cox Date: Mon, 30 Jul 2012 21:42:49 +0000 (-0700) Subject: taskstats: check nla_reserve() return X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=25353b3377d5a75d4b830477bb90a3691155de72;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git taskstats: check nla_reserve() return Addresses https://bugzilla.kernel.org/show_bug.cgi?id=44621 Reported-by: Signed-off-by: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/kernel/taskstats.c b/kernel/taskstats.c index e66046456f4f..d0a32796550f 100644 --- a/kernel/taskstats.c +++ b/kernel/taskstats.c @@ -436,6 +436,11 @@ static int cgroupstats_user_cmd(struct sk_buff *skb, struct genl_info *info) na = nla_reserve(rep_skb, CGROUPSTATS_TYPE_CGROUP_STATS, sizeof(struct cgroupstats)); + if (na == NULL) { + rc = -EMSGSIZE; + goto err; + } + stats = nla_data(na); memset(stats, 0, sizeof(*stats));