Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2562944pxb; Mon, 19 Apr 2021 08:29:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+EOVR77HkoEXApAyZfpFR3+ZUOC/00gfj8SdYVqaldcO2CCS+8PkubZKPi9NnTPHgnONI X-Received: by 2002:a17:906:4eda:: with SMTP id i26mr22645502ejv.301.1618846183830; Mon, 19 Apr 2021 08:29:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618846183; cv=none; d=google.com; s=arc-20160816; b=wlCWn/KNcsQAVG2LrUcLjkwf3uLWuzUoUqwG58QudwZFBYtADh/v8N1LURlhNWrNK3 mzb0wNMXM70y45bEFAttvXFPfRwrkLNagh3GKEBnXZhQYfEoz+eHBd3inYBzDsTQscU3 4BBx2zg874rmtLZtUQ5ssLs9b2D+42EE7HMeLJ9sM+oFaODqGVE/Dj2pq6tBCNIP1GQZ GVu6xpIzyy0CzZ63z6vvlvviKryrr0tZB/D5B4/CBf9Qq/7w9YXvx/uHZEIkukmYoMKY Hzv9EPr98g6gtp2rHZZvIPKO2JZ1eftuckaHE8yd4AyQKArhe/N41n9S/m/gYlUni5r4 Xtog== 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=/1nJMMcXpnrettZTUOG8USQ2fAxU9hy6lCHLtKEM/30=; b=x8e7GE15p4Ixr1yGsnwU1yIVLbwDeeGf3zZU9Tn7cvTTVnWglSqgILEUdRECPhbY4d eWw+vty37CcJBV/qNma5OFxRlHh8uAjS0F75of5JYaxJWsHMpfw88bbv3DPGiWq0Wlya uiB7Hv5WSb07HrTmAIL+Ml5d1fsYR/Df8Cf3SK7uda+6KsslvWoRtunAQ714PY3e+kxN a+rNA+YRbXqa0a2iloC6WD80JENJ1i8yEWmcjXxMc4WRgwO6FBUN1Us7BSckcToXPdex FAG3w7IRqGQkU0W7mvKGjAX+135gbupX9F5CXENbYlcl7QY/bexb7A2UvrpLReC00T2S UCwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="uKU8VwP/"; 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 w13si11794281ejo.365.2021.04.19.08.29.20; Mon, 19 Apr 2021 08:29:43 -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="uKU8VwP/"; 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 S241656AbhDSNXn (ORCPT + 99 others); Mon, 19 Apr 2021 09:23:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:56922 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240683AbhDSNSY (ORCPT ); Mon, 19 Apr 2021 09:18:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 076C6613B0; Mon, 19 Apr 2021 13:14:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838082; bh=EIV3FBV2Jzv8e8TtpesN1BcDN9BM271O3djJTKmq0LA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uKU8VwP/TmjZrWlINZczpASl0Th+ym8WTyBMd9Q8G5/DFl8LjmUXAFIoQuzjdYv6W mF6ZOJyKD31INib0DdpxsQUj+pjdl/HXjrGT0YrVkEpjaAE7wNBb8PzPoNj6FwV+rw cEXbuy9kh+scZZa+54mwOmC87TFqqxu3VxVw1kRU= 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 035/103] net: ieee802154: forbid monitor for del llsec dev Date: Mon, 19 Apr 2021 15:05:46 +0200 Message-Id: <20210419130529.005188125@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 ad8f9de1f3566686af35b1c6b43240726541da61 ] This patch forbids to del llsec dev 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-9-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 c8576dc0686d..da4bd6bc4567 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -1786,6 +1786,9 @@ static int nl802154_del_llsec_dev(struct sk_buff *skb, struct genl_info *info) struct nlattr *attrs[NL802154_DEV_ATTR_MAX + 1]; __le64 extended_addr; + if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) + return -EOPNOTSUPP; + if (!info->attrs[NL802154_ATTR_SEC_DEVICE] || nla_parse_nested_deprecated(attrs, NL802154_DEV_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_DEVICE], nl802154_dev_policy, info->extack)) return -EINVAL; -- 2.30.2