From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11553C43460 for ; Mon, 12 Apr 2021 16:26:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA04561382 for ; Mon, 12 Apr 2021 16:26:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244026AbhDLQ0z (ORCPT ); Mon, 12 Apr 2021 12:26:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:57066 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243813AbhDLQY5 (ORCPT ); Mon, 12 Apr 2021 12:24:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 34AD86137B; Mon, 12 Apr 2021 16:24:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618244676; bh=HhQczqzlz3kb8CmUecPkJkVX82K4ZVjXr4Kv4vS7uiM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lqP/EWf46dNjNvcQgCrXL5QD4JPTzNRPG2IFitrEDiUo3EcoRWSYU0NkMMZf0pugh p+mAP03XXIt2uygC8v/zXnQQCoiIpzIt50ZkEV3xc50q93U6k+kpTRFb6RZ2embpDQ 7WsLqLUlpbtk2FBBgnWsSypL9y98L1u33YjEu3c663rrEmyEf5drrw/bJezLxoPHY4 F0RdS596/s5tLVm/KxUq0nmOvyE9bmx2/G+Tb+/nNiJqKMyPswGn1KSZ8DECPkmJ8B oYFI6S7btUAk42Fs/MX6pGPk8bBzR3RFQIOe7i8tgkEqQOFWx1Ulnfv9E+N4Ws37gz VKcxBzwImxxGQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alexander Aring , Stefan Schmidt , Sasha Levin , linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.10 27/46] net: ieee802154: forbid monitor for del llsec key Date: Mon, 12 Apr 2021 12:23:42 -0400 Message-Id: <20210412162401.314035-27-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210412162401.314035-1-sashal@kernel.org> References: <20210412162401.314035-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wpan@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 c10fc3479d3e..9cdc1457c97c 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -1604,6 +1604,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