Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2562670pxb; Mon, 19 Apr 2021 08:29:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwB1DilB3csMsAtM8si10a6VKv5mmHeuVKns50X8OK0GdmfpGHbwGpDTHjte5uimrXBGdLq X-Received: by 2002:a05:6402:5211:: with SMTP id s17mr26512025edd.327.1618846162588; Mon, 19 Apr 2021 08:29:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618846162; cv=none; d=google.com; s=arc-20160816; b=XvmrB55XanoMl0/LFHGhefX5ENE5JiRAucdj+qIyD0rJix0hG/qmcZceq0y0DAMlDN 7vdJFXYvCLitG7JNIZ6FQWA0KzZc6YJ42sgPAuhys6oD47tyIomoPmcO7umNW1KIljA8 yGebiS4IdI+cKw326RBFdSJtJNPXTIK1WH8b3ZZhU+ofTf2RZ7ePDNKnvzCgtiKBcCvF rHhNjbIGYxR65X1pbXVXrNCFsTq04T2M/MZYeCXL63DNEyaMxwIkyeKq87J6aGvr5G7R zBME0kDM7a0f8+fNl3/yH3bfXhwT/A2M+hlzlV6vKHjUhkbw3pTuTWgxC9g0XBREo3rD DSrg== 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=ImwxPmOVb6uyKbLQAWWj+TsNmE4hZDvu2TOze5QaJMc=; b=iq1dixLCwZNpWczVu3FpaRrDqWmOqF28POfC3pezqo6EB2mV+ffjQltk8m2ZTkgVKX fq4q70EDNM/8ZUMml35pbRXXnQcJJ2/k0DylD96SiBQRmVHINYkR4YY76o2iiqzjD/38 sfIJV21IfdbqQ55fI+LxD8SaJsE+49XZa/8HQaU7w8wqozbgyHBr/3EzWBs3fbHMl6QV c+JtCDKcVa5Spe8RmXJM+Lq/MCyKEKihLPsRTbrSkHznV3dVdAw4q/OyeADETqN6AKZW 64A+lExyrfob0xoEuCDTMfFvc7CpEbOtrsN7JHp2VIJ0gdq316XMW6oQf7wN9zL5MZik p5ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=hbafDpxX; 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 p26si1923772edx.181.2021.04.19.08.28.59; Mon, 19 Apr 2021 08:29:22 -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=hbafDpxX; 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 S240379AbhDSNXt (ORCPT + 99 others); Mon, 19 Apr 2021 09:23:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:56986 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240245AbhDSNS0 (ORCPT ); Mon, 19 Apr 2021 09:18:26 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BA5D3613DC; Mon, 19 Apr 2021 13:14:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838088; bh=AYe1vRA/3xrhayUROFHqRWwkSUOeUyaXEZkRF7t7Y4o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hbafDpxXGua9ibLDf9VmtcYC2/8MdgD7m9nDRnzcro/5CMrRarnZ4gq5p4MCXqZuT xZJ+unWVRk6JHcqCVPuJvYA/xbFfN/DdyH0+k5iCeB83KBCwVtt+aRbPqeCjHY4+/f 8rHx+l4oGbRAOLGOM1UPn/OUGqxLbIBMrlZrpJLQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alexander Aring , Stefan Schmidt , Sasha Levin Subject: [PATCH 5.10 037/103] net: ieee802154: forbid monitor for add llsec devkey Date: Mon, 19 Apr 2021 15:05:48 +0200 Message-Id: <20210419130529.076511143@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130527.791982064@linuxfoundation.org> References: <20210419130527.791982064@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 [ Upstream commit a347b3b394868fef15b16f143719df56184be81d ] This patch forbids to add llsec devkey for monitor interfaces which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors. Signed-off-by: Alexander Aring Link: https://lore.kernel.org/r/20210405003054.256017-11-aahringo@redhat.com Signed-off-by: Stefan Schmidt Signed-off-by: Sasha Levin --- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c index 40022e137094..023c1e75daf9 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -1920,6 +1920,9 @@ static int nl802154_add_llsec_devkey(struct sk_buff *skb, struct genl_info *info struct ieee802154_llsec_device_key key; __le64 extended_addr; + if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) + return -EOPNOTSUPP; + if (!info->attrs[NL802154_ATTR_SEC_DEVKEY] || nla_parse_nested_deprecated(attrs, NL802154_DEVKEY_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_DEVKEY], nl802154_devkey_policy, info->extack) < 0) return -EINVAL; -- 2.30.2