Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2505374pxb; Mon, 19 Apr 2021 07:18:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVxmxi+00zCyupONdu+Ap9//dUPOkb28GprSbv98EE05DqtnaF7A7C2/GEGLlFb4QtDDjn X-Received: by 2002:a17:906:584b:: with SMTP id h11mr10875736ejs.463.1618841921781; Mon, 19 Apr 2021 07:18:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618841921; cv=none; d=google.com; s=arc-20160816; b=kuR/FtifYiO3lHYAOh0p6cVIbdGkVzQQKiu0035h9rSnO0VcjxQBmv8RRknXJJi/dB j4Bb18pWFa7/STxgDIi+hoTq2cshxQGUVZLgL18T8/htBzmiYnssxnEBzggvzN1HCW82 tPZtV/NIyNNhfQEQebed1kCSbLEIc/zBhiYAmFzwnwaDCkBSml2Io6d32HcKcA0XMUST AXmV29AqK/Dhm3ONilfIpa4u2EkM0Mx9BYQcuSA5AHbstGcJoJT9qKCB+5qa+76aGGTt LDi3QqUgZBvMkcOQejgqTzljsVGKh5gO8HZdXkj2esjw5ndojf+vCqdsvozM/o7LRhyW Y4cQ== 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=w4V7HU27tmfvi+ZwbuZdzdhvWSIT7ZCsjAF/gruV70g=; b=LeYR88xOAECnOAJwtztTbyZ0b9H772/iWLLg0xWFLSbhIoPHlpI0kl97RgGxV0cnyy WaF6Tc5vaY6xJ5ni9pH6S7EZRKIbKXJtG6RPtoLhg43CdZoXZqM4J5WNLZ/fKLfMIj32 VGz/RZW39y45yUvetp2IRQaxFR2VhvaE8SIF38g3XCGcdH+OpVDGQsmO6RXMzMF6LPlp 4+ao0bi3EVWqTdLgpZMfe0BPD5eZewbArJ6tONI038KPybR2lsREUy/wT4jf+AqZo8uK +WJ5HtooJwHvkg4iSQHbBt1Ajfkk211AUc+HkhWG4X2GkFU8E25+oIBMs7Sq2MgqAR+s Q0Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=dqCXCk73; 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 x11si12040228eju.252.2021.04.19.07.18.17; Mon, 19 Apr 2021 07:18:41 -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=dqCXCk73; 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 S239738AbhDSNKN (ORCPT + 99 others); Mon, 19 Apr 2021 09:10:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:44536 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239635AbhDSNJb (ORCPT ); Mon, 19 Apr 2021 09:09:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 81276613C1; Mon, 19 Apr 2021 13:09:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618837741; bh=SLmw5DkvOeGCsvqE0N1/OoGYpkBkvaWML8/+TmvQMpA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dqCXCk7315N6hVK4rEBvm+h1ieWwWJvgVuTP/eSTxC2dlVACFPXa/w+KD7FSmnjZa wWeN7wbHyYXqE8xHHwKX6KbPhLeV0qn74mY9yaW7Wijfyon3ojAlzkEBj8Y1InTEUe YA7Azuy2mUvw83gAYtVMiQhjcxVTLVWtH84pViuQ= 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.11 038/122] net: ieee802154: forbid monitor for add llsec key Date: Mon, 19 Apr 2021 15:05:18 +0200 Message-Id: <20210419130531.462284523@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130530.166331793@linuxfoundation.org> References: <20210419130530.166331793@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 08470c5453339369bd3d590c4cbb0b5961cdcbb6 ] This patch forbids to add 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-5-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 a7cb28a78c6f..6036516ddb9e 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -1557,6 +1557,9 @@ static int nl802154_add_llsec_key(struct sk_buff *skb, struct genl_info *info) struct ieee802154_llsec_key_id id = { }; u32 commands[NL802154_CMD_FRAME_NR_IDS / 32] = { }; + 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