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=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 1E9BAC433DB for ; Sun, 28 Feb 2021 15:20:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E859364EAF for ; Sun, 28 Feb 2021 15:20:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231151AbhB1PUM (ORCPT ); Sun, 28 Feb 2021 10:20:12 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:21984 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230460AbhB1PT5 (ORCPT ); Sun, 28 Feb 2021 10:19:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614525511; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AYUFQOH69SnWW6q2HidGRNI/Wyu1Y7+78kfdmbYl2HY=; b=Lylaan9xfsSYNZD3+9TprOcXpPRBLU7UsW2Je8gQu1o56erq5MJbl5semcmBegb4i5r3d7 aSmBawiVoIcYTBCBIP+kD0DZ0UKVeHLG/dzatpJEKsgChRVyjjDlIr2hJxwKBKTz7DU0h8 0UdQ25HFNR6HG2nw2hejJZ5G8KzLGYQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-567-5ok3pgi8Pk6P2yfnP7PZmw-1; Sun, 28 Feb 2021 10:18:29 -0500 X-MC-Unique: 5ok3pgi8Pk6P2yfnP7PZmw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6C8A3107ACC7; Sun, 28 Feb 2021 15:18:28 +0000 (UTC) Received: from carbon.redhat.com (ovpn-112-225.rdu2.redhat.com [10.10.112.225]) by smtp.corp.redhat.com (Postfix) with ESMTP id 067AB5C1D5; Sun, 28 Feb 2021 15:18:27 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH wpan 11/17] net: ieee802154: stop dump llsec devkeys for monitors Date: Sun, 28 Feb 2021 10:18:11 -0500 Message-Id: <20210228151817.95700-12-aahringo@redhat.com> In-Reply-To: <20210228151817.95700-1-aahringo@redhat.com> References: <20210228151817.95700-1-aahringo@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: linux-wpan@vger.kernel.org This patch stops dumping llsec devkeys for monitors which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors. Signed-off-by: Alexander Aring --- net/ieee802154/nl802154.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c index 46faf451f413..43e7b029c444 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -1853,6 +1853,11 @@ nl802154_dump_llsec_devkey(struct sk_buff *skb, struct netlink_callback *cb) if (err) return err; + if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) { + err = skb->len; + goto out_err; + } + if (!wpan_dev->netdev) { err = -EINVAL; goto out_err; -- 2.26.2