Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2052430pxb; Mon, 12 Apr 2021 13:04:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyqBUftQXtWpdD8Cuv0CTz2YAfdtefzotjceGNuZGtHr8k9XJ0a5slhAXuLwG4rX91cxSe1 X-Received: by 2002:a63:6a41:: with SMTP id f62mr27834126pgc.428.1618257853367; Mon, 12 Apr 2021 13:04:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618257853; cv=none; d=google.com; s=arc-20160816; b=bh93FKYIBUJjmuiLQd1V/t6QGvxwaTZOIpaJEXYq+ofZOnY59jTyCBv1UQTSjX2wf0 SFCEKfqhn5nPrb5YFILst+BnaF3B5HExH9Qgo/A1DiYjU01Em0jo9/AY6m26ytdcuZ7N 5RO8/1NWzGwiTDAgx5wXtqgCgyHe5tyn4pj/oLOuZNhYTz/oym/IkyrU9vF799zmcXm/ oMC/EjLy85SWHvj4lNbfPAVSsMqH6EKihjU9tF3nBFCMhN9K/p8ClFYaH5ogXq4DnDNB NBWkUTJ1kBMgoh9tTLbH9ZQuNjBkMBCfPINBZC/6gQytmKpUpeMS59HiZ7VlJkZRrb8U QjHg== 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=30O++orDjDyKjossWikMXyMCuzV2Rb/+wVTnXt0vR+Q=; b=jZVbxqiOpc1tZxgLkMeuelu0wQu6CPwtveF04ktGuX9qmsRRcDYXYxTa6rfKrCb7nB Lm5EE+YfgVGgH0r0b7BqADPyDWaWgB8ZnIgjK55NkDieGKJQIDUyn7cxiJdc7mXMOwnN jY0MvB1KrALReN5EoMRzTf5W/WchOXbVsZurwwzV1mHfrzTlSUyOvlIshJKrvCPi9UH9 3IkRl7UJNGkPQkn2nJHo2c5/hPsAkZUwSV2V7fdmwEtD7WoeOxcaT0fJqzIvsvVHrrrT MghFBky5ZpA98HuX/jBd19XiA7HFurSpoV2EVErIzyNas2x8NL6leqKPR+LBwsjAS6RI pzvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wtKhw8Ga; 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 q85si3529665pfc.91.2021.04.12.13.03.59; Mon, 12 Apr 2021 13:04:13 -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=wtKhw8Ga; 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 S237835AbhDLIqE (ORCPT + 99 others); Mon, 12 Apr 2021 04:46:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:37080 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237720AbhDLIo4 (ORCPT ); Mon, 12 Apr 2021 04:44:56 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C0EA261221; Mon, 12 Apr 2021 08:44:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618217077; bh=n1ltmhE0qiMgnUpH9RXCFq3nk5leOHJY/5C1eByrzHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wtKhw8GaWT+kFAeRiLaKFUWA2fGrLppQcjkTrEZKcEJGfbUMDy/RGYMapIDcPj1+K ujsbO0fdBOZXPo69FsSXT9uO2GE4rNguRmgp8hVlIqnOSRUWfZu9qYDfcVYUo2/ZhT WfyBAL11wCyE1dHc4wZRZufhcuHC79W8qEcdsiPA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+d946223c2e751d136c94@syzkaller.appspotmail.com, Alexander Aring , Stefan Schmidt Subject: [PATCH 4.19 60/66] net: ieee802154: fix nl802154 del llsec dev Date: Mon, 12 Apr 2021 10:41:06 +0200 Message-Id: <20210412084000.063872896@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 3d1eac2f45585690d942cf47fd7fbd04093ebd1b upstream. This patch fixes a nullpointer dereference if NL802154_ATTR_SEC_DEVICE is not set by the user. If this is the case nl802154 will return -EINVAL. Reported-by: syzbot+d946223c2e751d136c94@syzkaller.appspotmail.com Signed-off-by: Alexander Aring Link: https://lore.kernel.org/r/20210221174321.14210-2-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 @@ -1781,7 +1781,8 @@ static int nl802154_del_llsec_dev(struct struct nlattr *attrs[NL802154_DEV_ATTR_MAX + 1]; __le64 extended_addr; - if (nla_parse_nested(attrs, NL802154_DEV_ATTR_MAX, + if (!info->attrs[NL802154_ATTR_SEC_DEVICE] || + nla_parse_nested(attrs, NL802154_DEV_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_DEVICE], nl802154_dev_policy, info->extack)) return -EINVAL;