Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1595217pxb; Mon, 12 Apr 2021 01:48:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwe+PZLN0ushaGh+rBtPP2OhBoT846chXammMULrx05VYGGXqjbpsNml6I6tXpUWzv4BiWR X-Received: by 2002:a63:3ca:: with SMTP id 193mr25921177pgd.274.1618217282458; Mon, 12 Apr 2021 01:48:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618217282; cv=none; d=google.com; s=arc-20160816; b=zxd6gFTJooJJlo9C6R4qDqhUPr+ARJ7XGjk/Spp1rE+GJ9o5hbHURMbZ+VYi/9yjYZ aBNo9d4C0yG/KE0T2khWwmyWhK95j3ZcsGnqqxhwOduFzILe9zpIphjBnvJfyi4a8TGG VVKuuZafM05gfmJVqstClEPPZ+y+Sp5jxktT0Xni3iTt5idESvR4P8ELXYtSx5qvzycv TzrteHH0tt9xJrC3p8/gLeg0kmmX4TdoCaRmIdZc88xz+SD5ZTwAt18aG0J+frhTtJPq m1j3164eGNDvEUWsMuLC8ogSfNXBnN9AmB7icPK6xxAXLg6Cj4/q0Ztvz3+Ha3hHQN7S Z/Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3mNH93vAUdkZarMTgTOYBcYTUFXtiwfnisPLXP0jDKk=; b=YRAro0jPDMZuOIVdD8LrSF/8qCPuaMZ1Dz8yD+FErdD5Rzgz3M5BEfTvntFnE20zpr DWjSA/Xzk9O+9kl53b88GNEAjRb+PNDwgz5/PYZ/WbWukQx6wJieP074eeoNe32OdG3C 8nEu6PigmSv5eqfekKlKA7suSBqIITqh1LlXBYwpxd3lSUoG0J++rx4/UdRWL3flxuvj Pah6r3rIV7m7WUItlAuRhgsmt9s5DzZcY+8cQHWnGcMQzptw7s9S0f3LFImK/V/vaH3I 4v9TU3fP5Ct5Q1nZp39VgGmAiVVYaf5KSWl+QDgZ7QFuuotnvOZHA27mJq814zM0w1WW ZS7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IAhzZPTE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m129si13469414pfd.105.2021.04.12.01.47.50; Mon, 12 Apr 2021 01:48:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IAhzZPTE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237738AbhDLIqJ (ORCPT + 99 others); Mon, 12 Apr 2021 04:46:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:36662 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229676AbhDLIpA (ORCPT ); Mon, 12 Apr 2021 04:45:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1C7EA60241; Mon, 12 Apr 2021 08:44:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618217082; bh=X1kcx40bGh+D7ygjon3boNqFWqh7TZUG20V0nr5TVkQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IAhzZPTErEOZu3V2x5qZbwz8CZivbEJjBHSjV8NZJ/Iur3ItMXpKWxqX5dKEVIHjB Us9b86FijNhSRIXNj9M0iA+QVKPji/BZO5atUyJwjLGIHSogDn+gre1Awla7YTQ5RK 4NdEMHJjf2LsR5zmiMdxK6T32HrJH8HgQKvy0ZqY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+368672e0da240db53b5f@syzkaller.appspotmail.com, Alexander Aring , Stefan Schmidt Subject: [PATCH 4.19 62/66] net: ieee802154: fix nl802154 del llsec devkey Date: Mon, 12 Apr 2021 10:41:08 +0200 Message-Id: <20210412084000.129439698@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210412083958.129944265@linuxfoundation.org> References: <20210412083958.129944265@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Aring commit 27c746869e1a135dffc2f2a80715bb7aa00445b4 upstream. This patch fixes a nullpointer dereference if NL802154_ATTR_SEC_DEVKEY is not set by the user. If this is the case nl802154 will return -EINVAL. Reported-by: syzbot+368672e0da240db53b5f@syzkaller.appspotmail.com Signed-off-by: Alexander Aring Link: https://lore.kernel.org/r/20210221174321.14210-4-aahringo@redhat.com Signed-off-by: Stefan Schmidt Signed-off-by: Greg Kroah-Hartman --- net/ieee802154/nl802154.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -1943,7 +1943,8 @@ static int nl802154_del_llsec_devkey(str struct ieee802154_llsec_device_key key; __le64 extended_addr; - if (nla_parse_nested(attrs, NL802154_DEVKEY_ATTR_MAX, + if (!info->attrs[NL802154_ATTR_SEC_DEVKEY] || + nla_parse_nested(attrs, NL802154_DEVKEY_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_DEVKEY], nl802154_devkey_policy, info->extack)) return -EINVAL;