Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2562186pxb; Mon, 19 Apr 2021 08:28:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKyB0U0BKnMi4LMtpbiZkTrXJCdLI8xJR3nkO+jtZnaJ+pL8HdpIqsPyScSZ05VfWX/A8h X-Received: by 2002:aa7:d617:: with SMTP id c23mr4085989edr.207.1618846121440; Mon, 19 Apr 2021 08:28:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618846121; cv=none; d=google.com; s=arc-20160816; b=xPdbOYVM8UtStPLBaDipYyZXm9qr9UxwgR+MPpuzs77HOaFvtA6dPtCBDv2rOuKgAl VZ9wmu16q8dqzLMWzdw+CMxnymFuU9UCiNJS4HwqXORLMoqeoHT1haA1O4MAyOFR/JFT rW8hRX0VCxVdsmsyL+MCyGMPslQcrgF3AU/3ASlUyt92iXmppiUlmgridLx80ngFoTd8 LVE1h6pVhemTyIsaEjvkVf+++FAvAxovIZVozwtQvCMlzmyChv7UblNdAV+mq0Ez7atP owStsli3Q+1xG1JqsEf5BjMvj2eMCCkgxVDsJA+mgTLovLP2oTJrxth69UqfRvDrd5pS Jswg== 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=UBERsfAkIt4WUPttub0P06SCDUN3acxCb7XuLiQ0rnE=; b=xaZqztStD7mcrAP4oQtLIgc3UWtptgTW7LJOBhXv6IEpVsNfG4m2n9UlctOEKIYSXr 1d8xxCXAmPUlf+PoZfWTvDrSbRC6EMr/u1UUHxA+qKKEaIaCQ6BjL5aOiRzFE3xfqUD2 vt+OneD5d2CqOc8+c8FAXZfGs5GzNU5BWHZ8oX3qPJ6pt7rZse0b53Kjrj4iVai5nELT tidP1N2dd26PC9Zs7tjKyiSAPwdS6z7WGePnFmwa+Hd7Lxhu1Hg+ME9JRw6k8PwA0NVT 4iZztr1wzlP3FZx2wKBOovD1YBeTHYOyng10RZm+gqjw8BI++1G/7ZROw7tuabWVDf8B oxGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tq0kVZmm; 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 d1si2013499eds.356.2021.04.19.08.28.17; Mon, 19 Apr 2021 08:28: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=tq0kVZmm; 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 S241538AbhDSNXk (ORCPT + 99 others); Mon, 19 Apr 2021 09:23:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:56886 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239302AbhDSNSV (ORCPT ); Mon, 19 Apr 2021 09:18:21 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 27BA8613F8; Mon, 19 Apr 2021 13:14:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838079; bh=zN8TzTFZEtlp8APpXXQ1DedqGSNq9udAusLxKlxoU1s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tq0kVZmmDO1d5UbiihnnX/Qz0WGRidfT0Ef3jjNPnE4pudKzG/5pjI9/Apo4s6OMd ItOTfRvSL3iphdKn2xdD1HR1tuu0j+hEw/2VWOKCRdvBubrBtepBqHEpqFz/HXia9F 5yeqbT80RICfDt17L0Lgh27BJIg3pB2X/xYvFLWU= 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 034/103] net: ieee802154: forbid monitor for add llsec dev Date: Mon, 19 Apr 2021 15:05:45 +0200 Message-Id: <20210419130528.974933399@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 5303f956b05a2886ff42890908156afaec0f95ac ] This patch forbids to add llsec dev 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-8-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 8a9019aa00c3..c8576dc0686d 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -1768,6 +1768,9 @@ static int nl802154_add_llsec_dev(struct sk_buff *skb, struct genl_info *info) struct wpan_dev *wpan_dev = dev->ieee802154_ptr; struct ieee802154_llsec_device dev_desc; + if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) + return -EOPNOTSUPP; + if (ieee802154_llsec_parse_device(info->attrs[NL802154_ATTR_SEC_DEVICE], &dev_desc) < 0) return -EINVAL; -- 2.30.2