From patchwork Mon Apr 5 00:30:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 12182475 X-Patchwork-Delegate: kuba@kernel.org 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=-15.8 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, URIBL_BLOCKED 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 414ABC433B4 for ; Mon, 5 Apr 2021 00:32:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 19C4B61396 for ; Mon, 5 Apr 2021 00:32:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231894AbhDEAcV (ORCPT ); Sun, 4 Apr 2021 20:32:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53668 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231777AbhDEAbW (ORCPT ); Sun, 4 Apr 2021 20:31:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617582676; 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=kMOqq1/PktQRCTljm11AKdNIYxKwGhsiCRjW2bJJRN4=; b=STSUFvRezH4z0UpSsPiEYqkIM4sM1NgM9eeDcFFzHoT+m3B+TiaH8k7PpDNAybJhRrQ7AG evOVLEN+1gSr39pAhfS1IDxT7PQSs9iVqQyNPrIyDzatE0CyrYgyxD5gfX3XbutbATW4ln 6/0kgMj8VP0g/ZgdHUMPjEMXU+L5Q5w= 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-239-l6dR-wIpMlSi_WFlUE0G_A-1; Sun, 04 Apr 2021 20:31:14 -0400 X-MC-Unique: l6dR-wIpMlSi_WFlUE0G_A-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BA5CF881278; Mon, 5 Apr 2021 00:31:13 +0000 (UTC) Received: from carbon.redhat.com (ovpn-113-102.rdu2.redhat.com [10.10.113.102]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4622D2B1AD; Mon, 5 Apr 2021 00:31:13 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH RESEND wpan 15/15] net: ieee802154: stop dump llsec params for monitors Date: Sun, 4 Apr 2021 20:30:54 -0400 Message-Id: <20210405003054.256017-16-aahringo@redhat.com> In-Reply-To: <20210405003054.256017-1-aahringo@redhat.com> References: <20210405003054.256017-1-aahringo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch stops dumping llsec params for monitors which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors. Reported-by: syzbot+cde43a581a8e5f317bc2@syzkaller.appspotmail.com 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 effc4c1a4780..05f6bd89a7dd 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -820,8 +820,13 @@ nl802154_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flags, goto nla_put_failure; #ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL + if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) + goto out; + if (nl802154_get_llsec_params(msg, rdev, wpan_dev) < 0) goto nla_put_failure; + +out: #endif /* CONFIG_IEEE802154_NL802154_EXPERIMENTAL */ genlmsg_end(msg, hdr);