Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2561833pxb; Mon, 19 Apr 2021 08:28:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwxiHCyN3L7OQ3o7rGaurU/EgZ1ASlA114ohWAQpBKx8StvBshdpBVvoyNbFQrHpjiQ69O9 X-Received: by 2002:a17:906:cc46:: with SMTP id mm6mr23155433ejb.138.1618846090671; Mon, 19 Apr 2021 08:28:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618846090; cv=none; d=google.com; s=arc-20160816; b=X0ss06HCVwGfcICwTi5COnvDILR4W9xa9ufzlmTm3ggmeGCnLaxhyzjidBEbkZvG44 oL+lIfLErYINB9d9zlNoQtszsZ1b/NiiwKMmmIjFCAgX9BKaDO64g/dhSuSvSKjoR/0k mUU1s+jhnaeJMROGsDif+9IoNXBwBFKw/Xo9cc0VU7dK8icSJVxwA5jt7rPdjAmZrz+b w505+41lLD1JbISvSd9EtfEBvuDE8x5AfTht0FNCv5nwzIN070N18sWYqzbBsNT0+F1Y qLgOHnlRibyd4LdM3/66N4TM+VmT+UZL74e3R9dasRGLv3ZeBvx7ouTOaY8PqFot2qDP oP3A== 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=fopzsc+Unz4CZYAY3HSlX3REEftHaEG1qI/ptEQzofBJK4NoO2CSihjSCcoE7WvVKN nBGaLV4hLsnMClmLmO5W/zxigl5lRBr+i4iGr7L5OB/C5gNk5s4Q+YbrEDy0SOER/cq6 Opdx+jLbbRhaub4pvCpB0poKYL1ei6GSACSnAC76i4DEKq+5Ed9Zs4VD0SaJh+h6BxFk +L0/F6u6XIwUl9pQJKWkhN2A3fL3+vDxXKVuR9/rrGyu6rVuU54lyaBkdlQKBvBIX/8q /Bl3RVQ2PseK5yvlA6Fv4EONdcPccCDZDFzedqWU48YFkhd19oIiqkGfPM9RiYroKbxb ynyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=K6tJQakO; 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 p31si14014703edb.415.2021.04.19.08.27.47; Mon, 19 Apr 2021 08:28:10 -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=K6tJQakO; 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 S239998AbhDSNXN (ORCPT + 99 others); Mon, 19 Apr 2021 09:23:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:56792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240651AbhDSNSR (ORCPT ); Mon, 19 Apr 2021 09:18:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id ECE43613DE; Mon, 19 Apr 2021 13:14:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838071; bh=SLmw5DkvOeGCsvqE0N1/OoGYpkBkvaWML8/+TmvQMpA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K6tJQakObOLwBeem8cr4B99yRMju5GKt3n4rlonShfUBcbN2Zvltd6qcOQoisyupt yWVnsEXuAfdRWcL/i6ntGHQIJFmf1UDi8DmIM0RAfnO58hTQ9np5BgTd/kQIziF2Jl P9QO/URPJofKXxIRBzt1Atz1BGi42DH6qnQPHEHQ= 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 031/103] net: ieee802154: forbid monitor for add llsec key Date: Mon, 19 Apr 2021 15:05:42 +0200 Message-Id: <20210419130528.872546094@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 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