Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2671080pxb; Mon, 19 Apr 2021 10:53:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxoMAFYcme1suNSGyH8FUifZKbiHwEIIFlfybQitYaAbzXKPGsChR1tzs7ALuYY7SQx5XQ0 X-Received: by 2002:a17:902:db0e:b029:eb:8b29:a809 with SMTP id m14-20020a170902db0eb02900eb8b29a809mr20814591plx.11.1618854783916; Mon, 19 Apr 2021 10:53:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618854783; cv=none; d=google.com; s=arc-20160816; b=XAR2GIzCgHKwXJheQDsLXpgKtu5mUbNeNwmmnYXD+KnkfNwl+pjeQmjZnKzBT8qIS4 Cc0w/ztFsrZ0A9dMBpBH7Z1HysQZbYu0EOdIV4ambOEQVkHVFaoA/toT+uSZeUEbToaw i5+K5rJ6WiUmzMT65ZBu+3I2N2wX08dGMsWboX11d4W7GiziZkJx2Huj/D8bCQn+p9UJ 709lIO4/OPx1ZMWYNQ38y5NZpuUA2ElIPqefwUGord5lWW/Ef5O6RhqaNVuKGh9emKE0 VWnmhKpa7Yjr17UyfDReBTcKEaPwYJUKgSsQb2Tvo4iqSR4W1I+eR+vFXvij24JFq92g uvug== 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=ZOrgcBflrbzt/2Cdv2ThRe6uJIo8IlWQoLnLA9G0w6Y=; b=eK6/wUy1Dz4wLZKEl11JwOpfWrr5q7LbOtP5E/NrucIB52zf/Re7OalfwI+PXzGk/J ZQYP2Kf2A0xhEWiqB26Fdxp6u4FIlgqcdYvZYP8jjYKnSuut+6ukdZhQ0oPK1+i5tThd 1gpZXG/DZz/be5wMtKyo7P1nSoG7tvkeTl9crOFDwVeG4I+x+dr3Q1RF+to3DlTfhba1 j5WQ48Zu19dJNhlxgV0YEn7wnQjK0Aq+t0lA7dn/VNKwf7Np/Tw7+FTVtiIukC332BbA hqrsM/cULGKK1b3IJe6cXezcAFxozFun4f2akT3deAbCHp+Zmv2avGyRHchPerboXC38 S0Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wr0+98ds; 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 m198si10366610pga.245.2021.04.19.10.52.51; Mon, 19 Apr 2021 10:53:03 -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=wr0+98ds; 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 S240796AbhDSN0I (ORCPT + 99 others); Mon, 19 Apr 2021 09:26:08 -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 S241153AbhDSNUC (ORCPT ); Mon, 19 Apr 2021 09:20:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AD0C8613DF; Mon, 19 Apr 2021 13:15:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838141; bh=n/psE5//e7MVSbrLnfMHWjNT60Q7bSFQ4VTxo3FOOvA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wr0+98dsgS2RnbL/OkwHUZpBgxuO14yGI7FOSFakZflQGy+h3cnwN+aSuhYDVCdeo B2RCA2XNu05OrNQfLgKTzUWAevq9tpkeGHnA7AT9nQePOQBSS/MagXZEeV17hz2WxV a48830C/njnYmvVFIqDgR084IPWHJoNytUJLVgYc= 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 040/103] net: ieee802154: forbid monitor for add llsec seclevel Date: Mon, 19 Apr 2021 15:05:51 +0200 Message-Id: <20210419130529.181433733@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 9ec87e322428d4734ac647d1a8e507434086993d ] This patch forbids to add llsec seclevel 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-14-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 10fc37e45e2b..f0b47d43c9f6 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -2120,6 +2120,9 @@ static int nl802154_add_llsec_seclevel(struct sk_buff *skb, struct wpan_dev *wpan_dev = dev->ieee802154_ptr; struct ieee802154_llsec_seclevel sl; + if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) + return -EOPNOTSUPP; + if (llsec_parse_seclevel(info->attrs[NL802154_ATTR_SEC_LEVEL], &sl) < 0) return -EINVAL; -- 2.30.2