Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp3422055pxy; Mon, 26 Apr 2021 01:03:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYfdc1EN4aUYL74a+0DqJJcQBkE7L0a5jVaKBRES+a1vcUf/Ov5vPHN/gIeQu7HZIcyhIu X-Received: by 2002:aa7:d5c7:: with SMTP id d7mr19847633eds.114.1619424238176; Mon, 26 Apr 2021 01:03:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619424238; cv=none; d=google.com; s=arc-20160816; b=ifkZnvZSShH3oniVBtftJvHMuBrMGhCTpKe1pRgN66y5J7LcNowBgvmQ6bM2RKXz/y /v5SuABr8nJmjywRVyWj8DTquc54LkcIR0FvA7SaITYCI6xhGSPhOaNabg3IoEzh2Z9A cCZX6WmIwyHoG6ZB6CCmhqI5vzG0dkkXJq7kaEW+ENi+ABZSiCutll6CsUUHhhI6jbKe gg0YKLyDA7hPO2EgE2bF2+C563amnG8gYMUOzQrZ8pRtTjuRxEp3EfEnQfqTGe2coPze RMhm7LjtTDPI4Lk8V1wS5G7Y+HRuiSpTKjZisyKZ3ospccVndKUSDntqfJENuzR1lhpw 2/pg== 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=u7Y+8JknGGVbsx1pPPekakmkTifDbmgzXjtyG1ggOGY=; b=eEK+I72YCzF/TI5khEWWoAcM1lFeLllvQGM2oG9MWK+3IjE3eIv2DGUogUR1P5TozH UA+nfZLmxSy1EKSNhokaaJMAjt4EY2a/YNzJu9WKqvpk+s9CaC4t0AapkeS3K80tb5s/ 4PrTjc3KZL3rBGHbrdP5ClFb16AoDZFLPbZKWpEhHdXMzafX+D+5APpNWFxdO9Wx3b/L whpXVWGmZL8RoTz4/JTa/Ns2LkglHAV9z5opUB1FSUqkEUWMaDoPm8ZmTVjUH8Zfrihp pI9fIkhTKT3y1MKTr/LpliBPBrsqi1jY1Ybz0I+FXglOwXzjEn4PTdVMjPRXs7YnXx7f nK9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=jGCI3UBZ; 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 k5si2740946ejd.336.2021.04.26.01.03.33; Mon, 26 Apr 2021 01:03:58 -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=jGCI3UBZ; 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 S232241AbhDZHbp (ORCPT + 99 others); Mon, 26 Apr 2021 03:31:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:41932 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232229AbhDZHbn (ORCPT ); Mon, 26 Apr 2021 03:31:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3253061041; Mon, 26 Apr 2021 07:31:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1619422261; bh=H77XajsLMRrhBAPqkJLSrTD6QTKk2CwQNIpgM7uDQCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jGCI3UBZzp7lNnldjSt/KqkCfDOqDKoY4dL+2di+kfg/amdKcIbxn9NXDpgg4XdUO YgOI2ec7ro+bIlShGqz9T3MIZraZNjTeIK+nVg3fCChJJh7L3AkpTrbCfGWzsDJFlu cx6fL3x8hz/gBpfDdtZR19+m2x2uUfhMEnfCxdz4= 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 4.4 15/32] net: ieee802154: forbid monitor for add llsec seclevel Date: Mon, 26 Apr 2021 09:29:13 +0200 Message-Id: <20210426072817.112832229@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210426072816.574319312@linuxfoundation.org> References: <20210426072816.574319312@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 f07a3027d66c..b2ff2f7329c3 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -2103,6 +2103,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