From patchwork Sun Feb 28 15:18:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 12108235 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=-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, 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 F0249C4332B for ; Sun, 28 Feb 2021 15:20:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9C3864EAF for ; Sun, 28 Feb 2021 15:20:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230496AbhB1PT6 (ORCPT ); Sun, 28 Feb 2021 10:19:58 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:46713 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230212AbhB1PTx (ORCPT ); Sun, 28 Feb 2021 10:19:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614525506; 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=oBgnfLo+d/dBvpawLqs1HKruHJv8Tx0bnqG3j9bT2vE=; b=E8GByHAJiXjA2I5N9RJ6iKw5vq/+e1Xl2QLwtjE8qzXyYHuVLaFxVvSjmXa2Rnajbo4YPa mNBJmvAejW/ncabuVvJ9ckci6XFmgdmU+K5zzNDCEcjsD8XFVul9yA2QEqU4WW5vQzIcOE Km6VLr5D7OeRauXpn80L8Zgm8o73FTw= 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-315-IUULfvWeOu67abUDtmYARA-1; Sun, 28 Feb 2021 10:18:23 -0500 X-MC-Unique: IUULfvWeOu67abUDtmYARA-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 C719E1936B61; Sun, 28 Feb 2021 15:18:22 +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 628AB5C1D5; Sun, 28 Feb 2021 15:18:21 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH wpan 01/17] net: ieee802154: make shift exponent unsigned Date: Sun, 28 Feb 2021 10:18:01 -0500 Message-Id: <20210228151817.95700-2-aahringo@redhat.com> In-Reply-To: <20210228151817.95700-1-aahringo@redhat.com> References: <20210228151817.95700-1-aahringo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch changes the iftype type variable to unsigned that it can never be reach a negative value. Reported-by: syzbot+7bf7b22759195c9a21e9@syzkaller.appspotmail.com Signed-off-by: Alexander Aring --- net/ieee802154/nl802154.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c index e9e4652cd592..3ee09f6d13b7 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -898,8 +898,8 @@ static int nl802154_get_interface(struct sk_buff *skb, struct genl_info *info) static int nl802154_new_interface(struct sk_buff *skb, struct genl_info *info) { struct cfg802154_registered_device *rdev = info->user_ptr[0]; - enum nl802154_iftype type = NL802154_IFTYPE_UNSPEC; __le64 extended_addr = cpu_to_le64(0x0000000000000000ULL); + u32 type = NL802154_IFTYPE_UNSPEC; /* TODO avoid failing a new interface * creation due to pending removal? From patchwork Sun Feb 28 15:18:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 12108243 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=-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, 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 5CE1AC433E6 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 2947164EAF for ; Sun, 28 Feb 2021 15:20:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231154AbhB1PUP (ORCPT ); Sun, 28 Feb 2021 10:20:15 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:22883 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230413AbhB1PTy (ORCPT ); Sun, 28 Feb 2021 10:19:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614525508; 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=FzPy8rjCfE+aeIPnfY5KvJTuaibGNzhMbRWIvII9Bk0=; b=Ey8OIwSYkNfuDzBr6MBf8C7YZmEJ10U43JGo/ePHxKXQDiwAbucPRO+/yrv3vNU47e+Y1k 72Pz7XDuz+SNhTkeaLpfQS6pYRwoC1vvG25N7bLgKf5LXMJ+Jm80HNeU2PFAg5ZmxRbfKH gXjLHCINvF06bNJt5kineLgqnSGqbOo= 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-499-mcjIwLwGNs6oWT9VocDrWQ-1; Sun, 28 Feb 2021 10:18:24 -0500 X-MC-Unique: mcjIwLwGNs6oWT9VocDrWQ-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 5C8251005501; Sun, 28 Feb 2021 15:18:23 +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 EAF095C1D5; Sun, 28 Feb 2021 15:18:22 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH wpan 02/17] net: ieee802154: fix memory leak when deliver monitor skbs Date: Sun, 28 Feb 2021 10:18:02 -0500 Message-Id: <20210228151817.95700-3-aahringo@redhat.com> In-Reply-To: <20210228151817.95700-1-aahringo@redhat.com> References: <20210228151817.95700-1-aahringo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch adds a missing consume_skb() when deliver a skb to upper monitor interfaces of a wpan phy. Reported-by: syzbot+44b651863a17760a893b@syzkaller.appspotmail.com Signed-off-by: Alexander Aring --- net/mac802154/rx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/mac802154/rx.c b/net/mac802154/rx.c index b8ce84618a55..18abc1f49323 100644 --- a/net/mac802154/rx.c +++ b/net/mac802154/rx.c @@ -244,6 +244,8 @@ ieee802154_monitors_rx(struct ieee802154_local *local, struct sk_buff *skb) sdata->dev->stats.rx_bytes += skb->len; } } + + consume_skb(skb); } void ieee802154_rx(struct ieee802154_local *local, struct sk_buff *skb) From patchwork Sun Feb 28 15:18:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 12108237 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=-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, 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 8F33AC432C3 for ; Sun, 28 Feb 2021 15:20:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6E7F564EB3 for ; Sun, 28 Feb 2021 15:20:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231126AbhB1PUA (ORCPT ); Sun, 28 Feb 2021 10:20:00 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:37296 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230222AbhB1PTx (ORCPT ); Sun, 28 Feb 2021 10:19:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614525507; 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=GtcLdlm1Iv1/5mJ7s1Xbu8kLpZIcHwisL8Wo5TnuA84=; b=afkzklVkaKpUiJOcEv4Zkjr4+AJwnR+CjKdyv9eeRRd7lL+tyTP98roYnYvnWwgnku0tBc tq//98GhUmbjMtRrR/j4RerJXuaq7xqgYytpSWl9LQdUO2SAZ1IXh5Tf3zyHRb+9KBRURy M7o0bkHU1kUZ1NxaWQxcVgUFdEeSVls= 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-16-q_X4dfRjMOW5l1zi2N4jNw-1; Sun, 28 Feb 2021 10:18:25 -0500 X-MC-Unique: q_X4dfRjMOW5l1zi2N4jNw-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 E799310066EE; Sun, 28 Feb 2021 15:18:23 +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 8064E5C1D5; Sun, 28 Feb 2021 15:18:23 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH wpan 03/17] net: ieee802154: nl-mac: fix check on panid Date: Sun, 28 Feb 2021 10:18:03 -0500 Message-Id: <20210228151817.95700-4-aahringo@redhat.com> In-Reply-To: <20210228151817.95700-1-aahringo@redhat.com> References: <20210228151817.95700-1-aahringo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch fixes a null pointer derefence for panid handle by move the check for the netlink variable directly before accessing them. Reported-by: syzbot+d4c07de0144f6f63be3a@syzkaller.appspotmail.com Signed-off-by: Alexander Aring --- net/ieee802154/nl-mac.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/net/ieee802154/nl-mac.c b/net/ieee802154/nl-mac.c index 9c640d670ffe..0c1b0770c59e 100644 --- a/net/ieee802154/nl-mac.c +++ b/net/ieee802154/nl-mac.c @@ -551,9 +551,7 @@ ieee802154_llsec_parse_key_id(struct genl_info *info, desc->mode = nla_get_u8(info->attrs[IEEE802154_ATTR_LLSEC_KEY_MODE]); if (desc->mode == IEEE802154_SCF_KEY_IMPLICIT) { - if (!info->attrs[IEEE802154_ATTR_PAN_ID] && - !(info->attrs[IEEE802154_ATTR_SHORT_ADDR] || - info->attrs[IEEE802154_ATTR_HW_ADDR])) + if (!info->attrs[IEEE802154_ATTR_PAN_ID]) return -EINVAL; desc->device_addr.pan_id = nla_get_shortaddr(info->attrs[IEEE802154_ATTR_PAN_ID]); @@ -562,6 +560,9 @@ ieee802154_llsec_parse_key_id(struct genl_info *info, desc->device_addr.mode = IEEE802154_ADDR_SHORT; desc->device_addr.short_addr = nla_get_shortaddr(info->attrs[IEEE802154_ATTR_SHORT_ADDR]); } else { + if (!info->attrs[IEEE802154_ATTR_HW_ADDR]) + return -EINVAL; + desc->device_addr.mode = IEEE802154_ADDR_LONG; desc->device_addr.extended_addr = nla_get_hwaddr(info->attrs[IEEE802154_ATTR_HW_ADDR]); } From patchwork Sun Feb 28 15:18:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 12108249 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=-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, 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 BEA0AC433DB for ; Sun, 28 Feb 2021 15:20:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8A45364EAF for ; Sun, 28 Feb 2021 15:20:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231177AbhB1PUl (ORCPT ); Sun, 28 Feb 2021 10:20:41 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:59630 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230439AbhB1PTz (ORCPT ); Sun, 28 Feb 2021 10:19:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614525510; 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=TycFQJJZAk4wM9Q8t5do6tcFRN5RoTXKW1hvc8NynC0=; b=LrMWJJtjQ6x/gHyUa0YtokpVpb7BPaamlAA9O1i3py8ESvYcIDUKNSRxz9WT9POY9BANsl 5TdLguxDHd0cmuLnU68xpYqwXBrYcxX2Fnoo+9p55ColJA3Y4/64LsQTjS18dNmdcplmsG OT0ScxNBNRGapK/bI8JdepQ+axRiYkA= 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-83--i6qSeXEOhO51JrUXiug0A-1; Sun, 28 Feb 2021 10:18:25 -0500 X-MC-Unique: -i6qSeXEOhO51JrUXiug0A-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 7BCDE6D4F0; Sun, 28 Feb 2021 15:18:24 +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 15C845C1D5; Sun, 28 Feb 2021 15:18:24 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH wpan 04/17] net: ieee802154: forbid monitor for set llsec params Date: Sun, 28 Feb 2021 10:18:04 -0500 Message-Id: <20210228151817.95700-5-aahringo@redhat.com> In-Reply-To: <20210228151817.95700-1-aahringo@redhat.com> References: <20210228151817.95700-1-aahringo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch forbids to set llsec params for monitor interfaces which we don't support yet. Reported-by: syzbot+8b6719da8a04beeafcc3@syzkaller.appspotmail.com Signed-off-by: Alexander Aring --- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c index 3ee09f6d13b7..67f0dc622bc2 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -1384,6 +1384,9 @@ static int nl802154_set_llsec_params(struct sk_buff *skb, u32 changed = 0; int ret; + if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) + return -EOPNOTSUPP; + if (info->attrs[NL802154_ATTR_SEC_ENABLED]) { u8 enabled; From patchwork Sun Feb 28 15:18:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 12108239 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=-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=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 ABF48C43333 for ; Sun, 28 Feb 2021 15:20:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 887E764D5D for ; Sun, 28 Feb 2021 15:20:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231138AbhB1PUB (ORCPT ); Sun, 28 Feb 2021 10:20:01 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:20232 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230403AbhB1PTy (ORCPT ); Sun, 28 Feb 2021 10:19:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614525508; 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=4Q5ng1dnkOvX+hziKJ95/sFrLuRwsL45MJOjmkTNEGg=; b=JTMSdtsssNzRV/0TJ0OXvN6Q6iM7PEBMjKq5S/IKziMM3AjKDTJtJ3vFiKufNI/8/f657i wcHSuTa1R4Bo7+YjPTzXU+NaxASkqSioLkVgb/ZeuFPBPNQERemgc55yAjWIg9CnffB7EQ neZzwmrlQ7DIQygD24nL18Ff2KkO7EI= 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-602-Zm8f1K8-NfGx7AGcSHV8yA-1; Sun, 28 Feb 2021 10:18:26 -0500 X-MC-Unique: Zm8f1K8-NfGx7AGcSHV8yA-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 10FA36D4E6; Sun, 28 Feb 2021 15:18:25 +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 9F2DF5C1D5; Sun, 28 Feb 2021 15:18:24 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH wpan 05/17] net: ieee802154: stop dump llsec keys for monitors Date: Sun, 28 Feb 2021 10:18:05 -0500 Message-Id: <20210228151817.95700-6-aahringo@redhat.com> In-Reply-To: <20210228151817.95700-1-aahringo@redhat.com> References: <20210228151817.95700-1-aahringo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch stops dumping llsec keys 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 67f0dc622bc2..f8f1792c3620 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -1493,6 +1493,11 @@ nl802154_dump_llsec_key(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; From patchwork Sun Feb 28 15:18:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 12108241 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=-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=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 D9885C4321A for ; Sun, 28 Feb 2021 15:20:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A4B6664EAF for ; Sun, 28 Feb 2021 15:20:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231147AbhB1PUD (ORCPT ); Sun, 28 Feb 2021 10:20:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:23784 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230412AbhB1PTy (ORCPT ); Sun, 28 Feb 2021 10:19:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614525508; 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=yS6bReS91F0YH5h/3hRSaN42p8HIYa8WJaFonTD2cbA=; b=LvpVM8O8O49mFLHaBdnTPd/U9YCO7VeaWlhXMNuulnpY6oE3EZXXvqQNevUM2ul0d+kP+X dVUlSbdwJ3LFrGpHy+RoLF54z3anTG0WwmygYh0/bXD1liLa6I4LyNLTT0RlbHeupUrlgf B2s9qYP26bn6JvT+c+pGEM74UajXyC0= 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-519-oTV0ipMBPSutcTQJot_ZRQ-1; Sun, 28 Feb 2021 10:18:26 -0500 X-MC-Unique: oTV0ipMBPSutcTQJot_ZRQ-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 99E4180197D; Sun, 28 Feb 2021 15:18:25 +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 338F75C1D5; Sun, 28 Feb 2021 15:18:25 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH wpan 06/17] net: ieee802154: forbid monitor for add llsec key Date: Sun, 28 Feb 2021 10:18:06 -0500 Message-Id: <20210228151817.95700-7-aahringo@redhat.com> In-Reply-To: <20210228151817.95700-1-aahringo@redhat.com> References: <20210228151817.95700-1-aahringo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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 --- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c index f8f1792c3620..3bc71505ad63 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -1552,6 +1552,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; From patchwork Sun Feb 28 15:18:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 12108245 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=-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=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 D693BC4332E 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 B2C8B64D5D for ; Sun, 28 Feb 2021 15:20:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231161AbhB1PUW (ORCPT ); Sun, 28 Feb 2021 10:20:22 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:30164 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230420AbhB1PTz (ORCPT ); Sun, 28 Feb 2021 10:19:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614525509; 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=PfwR3W563KI/WfAeC5FqrdKxeIJOriALEtiClZPNrGY=; b=jUEaiKGlXyKsLeL4HvVCce8d4uvFZn33Sp+YL7LleRDgI5jQMA54cHQLXL5yn52S5iN1tx /eGybR7Yj7FhE/NRnwJyCoTy+028EPI8XETQU9eA85ace4OMM8OtlzWAq5+RLLwDaedRBK r5AyKZzat4hAgn2XDu88BUkJFjug5ms= 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-554-oaGzrdeqOP-nIlQM8LKHow-1; Sun, 28 Feb 2021 10:18:27 -0500 X-MC-Unique: oaGzrdeqOP-nIlQM8LKHow-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 44EE6801980; Sun, 28 Feb 2021 15:18:26 +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 BC81E5C1D5; Sun, 28 Feb 2021 15:18:25 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH wpan 07/17] net: ieee802154: forbid monitor for del llsec key Date: Sun, 28 Feb 2021 10:18:07 -0500 Message-Id: <20210228151817.95700-8-aahringo@redhat.com> In-Reply-To: <20210228151817.95700-1-aahringo@redhat.com> References: <20210228151817.95700-1-aahringo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch forbids to del 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 --- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c index 3bc71505ad63..fdea9c20cd8e 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -1604,6 +1604,9 @@ static int nl802154_del_llsec_key(struct sk_buff *skb, struct genl_info *info) struct nlattr *attrs[NL802154_KEY_ATTR_MAX + 1]; struct ieee802154_llsec_key_id id; + 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; From patchwork Sun Feb 28 15:18:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 12108247 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=-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=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 448BAC433E0 for ; Sun, 28 Feb 2021 15:20:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1726864EAF for ; Sun, 28 Feb 2021 15:20:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230499AbhB1PUe (ORCPT ); Sun, 28 Feb 2021 10:20:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:41684 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230438AbhB1PTz (ORCPT ); Sun, 28 Feb 2021 10:19:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614525509; 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=pTdkHNEj/iPhhGQlg43N+RrbkDwtfB7kCayudPusiY8=; b=TCTa/jblrrTXPSDMdfe6zV/OwTQs2IlHIPoDhF9dkpXJQWXPvu7ZVSUsGnLv9v+C1nUAWi j+ul/L5qYRn6/ajv+AeoVRpnfOdvYeGBIDyAlN9pSBC8rlbKI7642kq4mIPK31T+U4Yjdu LmJ85Ck0iuyboKGaf1MJkhE1iYlN8eQ= 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-174-pc2nkC8OOwKVG-Vqytv0oA-1; Sun, 28 Feb 2021 10:18:27 -0500 X-MC-Unique: pc2nkC8OOwKVG-Vqytv0oA-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 B7AD0107ACF5; Sun, 28 Feb 2021 15:18:26 +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 515F45C1D5; Sun, 28 Feb 2021 15:18:26 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH wpan 08/17] net: ieee802154: stop dump llsec devs for monitors Date: Sun, 28 Feb 2021 10:18:08 -0500 Message-Id: <20210228151817.95700-9-aahringo@redhat.com> In-Reply-To: <20210228151817.95700-1-aahringo@redhat.com> References: <20210228151817.95700-1-aahringo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch stops dumping llsec devs 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 fdea9c20cd8e..7f728d85e9b6 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -1672,6 +1672,11 @@ nl802154_dump_llsec_dev(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; From patchwork Sun Feb 28 15:18:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 12108295 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=-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=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 0A444C433E0 for ; Sun, 28 Feb 2021 15:21:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CFA6864EB1 for ; Sun, 28 Feb 2021 15:21:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231229AbhB1PVj (ORCPT ); Sun, 28 Feb 2021 10:21:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:43627 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230495AbhB1PT6 (ORCPT ); Sun, 28 Feb 2021 10:19:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614525512; 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=qbHjWMdzSnO9u6fOOnNr8/pV6qnRvnT5ATDhbRpeEPc=; b=gi6+BYvwLLVGnhzuNjIUKPmmi4n8Go7QEupKrGaxyR2/KeZuvoi0GQVtF2fbbF31NHUDjH eqxRZuk9nok86Yy2PLraA5izoiXvyVo073doUilXyjpx/gAukAw+CJjDSGJ6BDv2s6oro7 C7ewoPRU6AzHoWzfbylddOSqhKj9f+o= 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-560-tf3H-480MYy1PIjG7Ku5uw-1; Sun, 28 Feb 2021 10:18:28 -0500 X-MC-Unique: tf3H-480MYy1PIjG7Ku5uw-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 4DBD61936B60; Sun, 28 Feb 2021 15:18:27 +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 DBC7C5C1D5; Sun, 28 Feb 2021 15:18:26 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH wpan 09/17] net: ieee802154: forbid monitor for add llsec dev Date: Sun, 28 Feb 2021 10:18:09 -0500 Message-Id: <20210228151817.95700-10-aahringo@redhat.com> In-Reply-To: <20210228151817.95700-1-aahringo@redhat.com> References: <20210228151817.95700-1-aahringo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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 --- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c index 7f728d85e9b6..c32e55f961c2 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -1763,6 +1763,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; From patchwork Sun Feb 28 15:18:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 12108251 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=-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=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 6C666C433E0 for ; Sun, 28 Feb 2021 15:20:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 469E964D5D for ; Sun, 28 Feb 2021 15:20:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231190AbhB1PUv (ORCPT ); Sun, 28 Feb 2021 10:20:51 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:50154 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230473AbhB1PT5 (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=/N9mjJW3W0eC4wzSlguu9RYpB4AfVEyqkbrMcjAVPcs=; b=GaXMvyiAjy5s0loAjpwVDccLq2xL9BgSp/uv9oAw+cHABUi+H+UyOL/ojf/YVv/1Up1Am5 9UfiKQe29tv+AFgFBSeG5pyEOw/00rqu4y2AQ/M6IU3zS2+r5VZyy35Qibde8M7w57eCZ0 3bTiCzQSFwKma1pYR16Z51vcRgdrXlA= 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-369-RUtnEo6NMPWdhuH0A9qMZQ-1; Sun, 28 Feb 2021 10:18:28 -0500 X-MC-Unique: RUtnEo6NMPWdhuH0A9qMZQ-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 D739B1936B61; Sun, 28 Feb 2021 15:18:27 +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 714885C1D5; 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 10/17] net: ieee802154: forbid monitor for del llsec dev Date: Sun, 28 Feb 2021 10:18:10 -0500 Message-Id: <20210228151817.95700-11-aahringo@redhat.com> In-Reply-To: <20210228151817.95700-1-aahringo@redhat.com> References: <20210228151817.95700-1-aahringo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch forbids to del 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 --- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c index c32e55f961c2..46faf451f413 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -1781,6 +1781,9 @@ static int nl802154_del_llsec_dev(struct sk_buff *skb, struct genl_info *info) struct nlattr *attrs[NL802154_DEV_ATTR_MAX + 1]; __le64 extended_addr; + if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) + return -EOPNOTSUPP; + if (!info->attrs[NL802154_ATTR_SEC_DEVICE] || nla_parse_nested_deprecated(attrs, NL802154_DEV_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_DEVICE], nl802154_dev_policy, info->extack)) return -EINVAL; From patchwork Sun Feb 28 15:18:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 12108253 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=-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=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 92444C433E0 for ; Sun, 28 Feb 2021 15:21:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5B7EE64EAF for ; Sun, 28 Feb 2021 15:21:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231206AbhB1PVH (ORCPT ); Sun, 28 Feb 2021 10:21:07 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:60858 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230462AbhB1PT5 (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 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@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; From patchwork Sun Feb 28 15:18:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 12108255 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=-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=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 65BD3C433E0 for ; Sun, 28 Feb 2021 15:21:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 26BFE64EB1 for ; Sun, 28 Feb 2021 15:21:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231201AbhB1PV1 (ORCPT ); Sun, 28 Feb 2021 10:21:27 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:29664 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230408AbhB1PT6 (ORCPT ); Sun, 28 Feb 2021 10:19:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614525512; 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=NLX1acInnz3QI0gdqLirblp939RheEQGCpz65KKuohE=; b=FYdWpgzuR+Qcx3tsORdqAfvoc02Z8xQgZ8XWoQtKzp9kuTgyVatd8FBLZ9XFXesZ0lWhju 5NDFwR/EnGfT4awwjgL54Yd2ZLDovIUg4v0QAWaW71ngXje3tkVwhEo/sZ2b0ZDmEKSiTG TjNvLHKIhX5IOzf/B7h5SFwVP8rLRmw= 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-569-5LXbqB1OOSip-4B2swpYBw-1; Sun, 28 Feb 2021 10:18:30 -0500 X-MC-Unique: 5LXbqB1OOSip-4B2swpYBw-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 020E7107ACE3; Sun, 28 Feb 2021 15:18:29 +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 9020C5C1D5; Sun, 28 Feb 2021 15:18:28 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH wpan 12/17] net: ieee802154: forbid monitor for add llsec devkey Date: Sun, 28 Feb 2021 10:18:12 -0500 Message-Id: <20210228151817.95700-13-aahringo@redhat.com> In-Reply-To: <20210228151817.95700-1-aahringo@redhat.com> References: <20210228151817.95700-1-aahringo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch forbids to add llsec devkey 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 --- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c index 43e7b029c444..ecdaff719b08 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -1915,6 +1915,9 @@ static int nl802154_add_llsec_devkey(struct sk_buff *skb, struct genl_info *info struct ieee802154_llsec_device_key key; __le64 extended_addr; + if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) + return -EOPNOTSUPP; + if (!info->attrs[NL802154_ATTR_SEC_DEVKEY] || nla_parse_nested_deprecated(attrs, NL802154_DEVKEY_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_DEVKEY], nl802154_devkey_policy, info->extack) < 0) return -EINVAL; From patchwork Sun Feb 28 15:18:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 12108297 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=-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=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 87F02C433E0 for ; Sun, 28 Feb 2021 15:22:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 55A7C64EB1 for ; Sun, 28 Feb 2021 15:22:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230408AbhB1PV6 (ORCPT ); Sun, 28 Feb 2021 10:21:58 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:59788 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230212AbhB1PT7 (ORCPT ); Sun, 28 Feb 2021 10:19:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614525513; 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=m8grdQd20rEAZ4hZ8+9BjQTOGWKKgDiwRwpn51/ihEo=; b=G7nWeZbvEjM2Iwv023GVF7NUSSOzc4kNXI3ynpnENDCEYqz963SQred908oS1qftwhExRW PW5HulYqwjGavbblpCCZpkqv2w/Wb5gSjcoq5+C+5rQsdF4B/VRFVxlHQzxs4W5aUDcejS 9fiGZ6P6swm0Gx0KInsOx/CtAtPR67w= 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-356-ikh2uNh7ONiOWYhVlsKPhg-1; Sun, 28 Feb 2021 10:18:30 -0500 X-MC-Unique: ikh2uNh7ONiOWYhVlsKPhg-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 B01F96D4E0; Sun, 28 Feb 2021 15:18:29 +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 252D95C1D5; Sun, 28 Feb 2021 15:18:29 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH wpan 13/17] net: ieee802154: forbid monitor for del llsec devkey Date: Sun, 28 Feb 2021 10:18:13 -0500 Message-Id: <20210228151817.95700-14-aahringo@redhat.com> In-Reply-To: <20210228151817.95700-1-aahringo@redhat.com> References: <20210228151817.95700-1-aahringo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch forbids to del llsec devkey 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 --- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c index ecdaff719b08..d0352148e34c 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -1949,6 +1949,9 @@ static int nl802154_del_llsec_devkey(struct sk_buff *skb, struct genl_info *info struct ieee802154_llsec_device_key key; __le64 extended_addr; + if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) + return -EOPNOTSUPP; + if (!info->attrs[NL802154_ATTR_SEC_DEVKEY] || nla_parse_nested_deprecated(attrs, NL802154_DEVKEY_ATTR_MAX, info->attrs[NL802154_ATTR_SEC_DEVKEY], nl802154_devkey_policy, info->extack)) return -EINVAL; From patchwork Sun Feb 28 15:18:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 12108299 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=-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=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 6C5A1C433DB for ; Sun, 28 Feb 2021 15:22:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4730264EAF for ; Sun, 28 Feb 2021 15:22:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230163AbhB1PWD (ORCPT ); Sun, 28 Feb 2021 10:22:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:26176 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230409AbhB1PT7 (ORCPT ); Sun, 28 Feb 2021 10:19:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614525513; 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=roKbvdchfdha4OXRhxovDmvW8qahWbulZ67jfkOsE40=; b=XkNtCl8kvaC8BSMTk611oj72tcpo8wEXbhryGDfMi0aAQaIRSWZ5ha0XQXBn7X/hFsUbsE 4NQbqtsiKf5ky0eIX7QhBYRemaXGqOz5JmoRHPIieV7fb6DFiYmSqAP2pVSqzgdZbRqYZn M4C/1zLLURuQLfoA45kZG97e4t2qnBc= 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-590-FvIX_5lvN9uQ49P17tkJtQ-1; Sun, 28 Feb 2021 10:18:31 -0500 X-MC-Unique: FvIX_5lvN9uQ49P17tkJtQ-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 443EF10066EE; Sun, 28 Feb 2021 15:18:30 +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 D38A35C1D5; Sun, 28 Feb 2021 15:18:29 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH wpan 14/17] net: ieee802154: stop dump llsec seclevels for monitors Date: Sun, 28 Feb 2021 10:18:14 -0500 Message-Id: <20210228151817.95700-15-aahringo@redhat.com> In-Reply-To: <20210228151817.95700-1-aahringo@redhat.com> References: <20210228151817.95700-1-aahringo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch stops dumping llsec seclevels 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 d0352148e34c..95a13a5b75d0 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -2026,6 +2026,11 @@ nl802154_dump_llsec_seclevel(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; From patchwork Sun Feb 28 15:18:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 12108305 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=-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=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 E40D8C433E0 for ; Sun, 28 Feb 2021 15:22:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AA0AC64EB1 for ; Sun, 28 Feb 2021 15:22:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231253AbhB1PWi (ORCPT ); Sun, 28 Feb 2021 10:22:38 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25663 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231137AbhB1PUC (ORCPT ); Sun, 28 Feb 2021 10:20:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614525516; 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=ZDC89FlNB6A8AriR09kja0Dj2b4LN5vzrIG19Vq9n80=; b=ixLHX84BaW7blM7ISg/xTN2EfalTI9ZCiNjMoVPZLaHeLA4kMIO1gZJHATk1kQhxiStgM1 HzBzbiOcApjmA4vh8gcyQAjCHeFpvBr0i7d+yiDCrbmz7JOan3bmfDniStpzOm71pKrQrP 0K+MZOZ7u28hUETHDvcQoSEX4A2o5rU= 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-591-RfMR9lbCOfunpmJrsy3YZg-1; Sun, 28 Feb 2021 10:18:31 -0500 X-MC-Unique: RfMR9lbCOfunpmJrsy3YZg-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 CE7AF10066EF; Sun, 28 Feb 2021 15:18:30 +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 682565C1D5; Sun, 28 Feb 2021 15:18:30 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH wpan 15/17] net: ieee802154: forbid monitor for add llsec seclevel Date: Sun, 28 Feb 2021 10:18:15 -0500 Message-Id: <20210228151817.95700-16-aahringo@redhat.com> In-Reply-To: <20210228151817.95700-1-aahringo@redhat.com> References: <20210228151817.95700-1-aahringo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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 --- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c index 95a13a5b75d0..e5181de4a77a 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -2115,6 +2115,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; From patchwork Sun Feb 28 15:18:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 12108303 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=-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, 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 BC38BC433DB for ; Sun, 28 Feb 2021 15:22:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 80D6464D5D for ; Sun, 28 Feb 2021 15:22:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231244AbhB1PWe (ORCPT ); Sun, 28 Feb 2021 10:22:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:60752 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231142AbhB1PUC (ORCPT ); Sun, 28 Feb 2021 10:20:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614525516; 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=PeSpDSkiOIRLibPx5IY1ERbxboVDlbwir0mbFIxNQ4c=; b=SGg4rYYhGHoscfg+UNAoy4XPT9Ndd6lAf8WHE6AFrbyScqKETrf46Ies3uix7fpsnzHQ9Z /n2R9YR/J+mtjUq2tERGoNbc6nPEyWprBO1uNfoepjyfV46VRm105AC5gob1RPQUJAbmQ6 CgMuwf5hhaRfCJa7NImQ+h0OIh97RwQ= 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-597-YTShLGthP2OJqeAxgZcPQQ-1; Sun, 28 Feb 2021 10:18:32 -0500 X-MC-Unique: YTShLGthP2OJqeAxgZcPQQ-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 639D110066F0; Sun, 28 Feb 2021 15:18:31 +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 F2AC85C1D5; Sun, 28 Feb 2021 15:18:30 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH wpan 16/17] net: ieee802154: forbid monitor for del llsec seclevel Date: Sun, 28 Feb 2021 10:18:16 -0500 Message-Id: <20210228151817.95700-17-aahringo@redhat.com> In-Reply-To: <20210228151817.95700-1-aahringo@redhat.com> References: <20210228151817.95700-1-aahringo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org This patch forbids to del llsec seclevel for monitor interfaces which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors. Reported-by: syzbot+fbf4fc11a819824e027b@syzkaller.appspotmail.com Signed-off-by: Alexander Aring --- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c index e5181de4a77a..576e418cf5aa 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -2133,6 +2133,9 @@ static int nl802154_del_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 (!info->attrs[NL802154_ATTR_SEC_LEVEL] || llsec_parse_seclevel(info->attrs[NL802154_ATTR_SEC_LEVEL], &sl) < 0) From patchwork Sun Feb 28 15:18:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 12108301 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=-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, 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 67533C433E0 for ; Sun, 28 Feb 2021 15:22:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2CA4D64EB1 for ; Sun, 28 Feb 2021 15:22:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230474AbhB1PW0 (ORCPT ); Sun, 28 Feb 2021 10:22:26 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:38137 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230433AbhB1PUB (ORCPT ); Sun, 28 Feb 2021 10:20:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1614525515; 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=2Bjh3DgtlYNb9J1LAYIfqCcgtyxWNouNwOMSlbNTffo=; b=OvC95dhDjQMhXSpf5Omwss4eu0TJssY53urd9+XpMh814WgvtPYJDb3Ul2i++lDlJu6A0g 1K77NhEqo+L7lJ1S47JipNkd0CJ52szdduS+tu87NvsyCO+jiT1BFalHGzX9kJpczBVDb7 0rLooruXz47vNOoYKQNF7Sq7KJvJtBY= 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-264-xrVApX3ZPwmrq5exfDTYpA-1; Sun, 28 Feb 2021 10:18:33 -0500 X-MC-Unique: xrVApX3ZPwmrq5exfDTYpA-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 ED1948030C2; Sun, 28 Feb 2021 15:18:31 +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 87E7B5C1D5; Sun, 28 Feb 2021 15:18:31 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH wpan 17/17] net: ieee802154: stop dump llsec params for monitors Date: Sun, 28 Feb 2021 10:18:17 -0500 Message-Id: <20210228151817.95700-18-aahringo@redhat.com> In-Reply-To: <20210228151817.95700-1-aahringo@redhat.com> References: <20210228151817.95700-1-aahringo@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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 576e418cf5aa..ca8e17a81a4f 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);