Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2562245pxb; Mon, 19 Apr 2021 08:28:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylWqVygx6hepXH5txGkYH8ynwe7scbL94int5TnwXxoFJPvoSrgJ64EA0DEx6qW3A+piuR X-Received: by 2002:a17:906:bcc2:: with SMTP id lw2mr22188726ejb.470.1618846126329; Mon, 19 Apr 2021 08:28:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618846126; cv=none; d=google.com; s=arc-20160816; b=m4MvpLtTsn5ZFxDSFqbRKXgwOKklaAWr+0SlbnHiOfUSlWhrMb88uZirWUnxhT9wLL r4ANAOh7iIzvtFrWXalxY4W+/16Fz/TEEUuH2vOOtGarp73iH+8BqwqkegFAED5xkOi7 t3dLz3a/426zjSOYE9E/7pb7ssRxipeGYXY+T+v8Zx2CbSrajsy1LALtqY/XHQAVubyV iClg6KRY6RgUi6N3GjVhALahiR4uif+BCIUl0g22C2682G6FR5GNk0CpBb2ttz769aX0 vO+bQDOWtwCawDDVIxKI0lwPuNnLjqAsKnGAkytSHnQzUpCH99O/GidxoYMMfn2OyISl Qrmg== 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=lcxGAAZvLnxJxn87xbapiFe/UsvHSRlof7/IJfMfDA4=; b=pR9zAE0uFGcBHJpsVf1STvLES4Pwcoyzv1Dgf1y4WzDYN4+aakjah+0tb6JVGzMZI6 59glbLYwTOE3AyhbZvfHhQXC5PIaBwuNUQG5WNGWE2gPYrg6m7GYAVaSQ9BQKwI0R1Lu PddKluvOZV5okULTcSaoy9z29OQCi8broIw9kp4xX6ALpHs8dHnYobOtYFtCyLoY/N7P l+TXiEcQa5IirCI/CWxkmXFVSuQO+dQLwubxYVDUO953CQ1suas9tBEcmJWwtKKkZ8wL 8aeCWsy4wRUHdQdAjY5OK2gleckEbB5n3xZ/CZa13xjmZbUEzU9dhHD2CPLZmJ6tDdS2 K9PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=sCTpdZ2s; 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 n5si12058376eji.73.2021.04.19.08.28.22; Mon, 19 Apr 2021 08:28:46 -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=sCTpdZ2s; 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 S241449AbhDSNXe (ORCPT + 99 others); Mon, 19 Apr 2021 09:23:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:56846 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240781AbhDSNST (ORCPT ); Mon, 19 Apr 2021 09:18:19 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CC65D613E0; Mon, 19 Apr 2021 13:14:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838074; bh=MOj3lNOt5Eq3DZ1qqW+goNVNwrEAqRWT8Vk7qnMVCI0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sCTpdZ2sMVbKYNxCxCHXwFaZHhWbc5xWtNGNqw5AWYHKItCeopO22WSIADKS/xze0 wto7hKXYdz3CnzMJHqZO0psNupe05in3flDotKLyvOQFQeSuG1ctiaTnlEfbR5KSO+ eeUbNUVWXDdMZrg39AJSr4FXc6jZt/RBYk5uuLUQ= 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 032/103] net: ieee802154: forbid monitor for del llsec key Date: Mon, 19 Apr 2021 15:05:43 +0200 Message-Id: <20210419130528.907694663@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 b6e2949544a183f590ae6f3ef2d1aaaa2c44e38a ] This patch forbids to del llsec key 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-6-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 6036516ddb9e..47c57347ab7f 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -1609,6 +1609,9 @@ static int nl802154_del_llsec_key(struct sk_buff *skb, struct genl_info *info) struct nlattr *attrs[NL802154_KEY_ATTR_MAX + 1]; struct ieee802154_llsec_key_id id; + if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) + return -EOPNOTSUPP; + if (!info->attrs[NL802154_ATTR_SEC_KEY] || nla_parse_nested_deprecated(attrs, NL802154_KEY_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_KEY], nl802154_key_policy, info->extack)) return -EINVAL; -- 2.30.2