From patchwork Mon Apr 5 00:30:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 415573 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 73DCDC433ED for ; Mon, 5 Apr 2021 00:31:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 45BAB6136A for ; Mon, 5 Apr 2021 00:31:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231735AbhDEAbS (ORCPT ); Sun, 4 Apr 2021 20:31:18 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:52111 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231727AbhDEAbM (ORCPT ); Sun, 4 Apr 2021 20:31:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617582666; 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=Dfw4ZRxqgfVUaJTec3AjfO7oo1Gb5lLdSHR4klxNszM=; b=dAt2P3mw++qHyRB2oEDS9vryeq2C4iTMGsXL3wx8acTmJZXnly9o4luLzuUeSNseiKUuXY dYr9zmiJe+WLPR7TVwKUi6UUvgbIarTcDt5ksUFkIOg5VexrH1XwJg5wpTheawln8goJeo hwPYveFbWMtq1Ij4STOAlf+6nvvgkw8= 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-513-9gQ-7ZK2Pzi8G5KnOpnE3A-1; Sun, 04 Apr 2021 20:31:04 -0400 X-MC-Unique: 9gQ-7ZK2Pzi8G5KnOpnE3A-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 BEAD981744F; Mon, 5 Apr 2021 00:31:03 +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 4ABB92B189; Mon, 5 Apr 2021 00:31:03 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH RESEND wpan 01/15] net: ieee802154: nl-mac: fix check on panid Date: Sun, 4 Apr 2021 20:30:40 -0400 Message-Id: <20210405003054.256017-2-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 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 Mon Apr 5 00:30:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 416383 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 13AABC433B4 for ; Mon, 5 Apr 2021 00:31:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E469D61393 for ; Mon, 5 Apr 2021 00:31:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231754AbhDEAb1 (ORCPT ); Sun, 4 Apr 2021 20:31:27 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:31074 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231738AbhDEAbO (ORCPT ); Sun, 4 Apr 2021 20:31:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617582668; 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=VKmlmihN1pyfwAnaIDpYlq2V3E4fJ6sPiOz7N82rbjg=; b=A0l9r4yzK1IOg+7AECR6sDuyZ1CkrZ1AII4haNoWHinrTbYZmCXjev2ZxmHsqj7i+FWaVq p7JCwE6BI5i8bVKZfFDdFYFPVpeJu+cTC53vsW5Jrsyrp7I6vJz7oKJ4TbFHOzOobMQN2y RwPodrDYBdKJx7V6IMuDZihXe4HZUew= 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-146-s44d6bpyOTmEc5ecTs_tGQ-1; Sun, 04 Apr 2021 20:31:05 -0400 X-MC-Unique: s44d6bpyOTmEc5ecTs_tGQ-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 68F3C1853020; Mon, 5 Apr 2021 00:31:04 +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 E7C1C37DD; Mon, 5 Apr 2021 00:31:03 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH RESEND wpan 02/15] net: ieee802154: forbid monitor for set llsec params Date: Sun, 4 Apr 2021 20:30:41 -0400 Message-Id: <20210405003054.256017-3-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 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 1600edb98107..ce8956f31ef9 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 Mon Apr 5 00:30:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 416382 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 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 36C5DC433ED for ; Mon, 5 Apr 2021 00:31:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1848361393 for ; Mon, 5 Apr 2021 00:31:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231771AbhDEAbe (ORCPT ); Sun, 4 Apr 2021 20:31:34 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:49802 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231741AbhDEAbO (ORCPT ); Sun, 4 Apr 2021 20:31:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617582669; 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=SMB8jZVQAr9/HLgYxfoV6B+Y6iLCp4LjTvctPXaLaCE=; b=WlMVkoOYY5tl8dmr0DQXp0PehSOCxpkLXNyzJa0MIeKlXiDwdFV8szBmgnuKfQnDE55XKO 4ljs54oFN8eUUnkeFC35/CHLv+RoAfZZyS2GClea/5uoCE5NA4Ii1SwXRza8x9FQ0lkfxd wKAxIe9u/7yKDgBjLUGC7a1hm+H22w8= 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-379-b1m8LBV1PRCiTSjAn7ao_w-1; Sun, 04 Apr 2021 20:31:07 -0400 X-MC-Unique: b1m8LBV1PRCiTSjAn7ao_w-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 D34ED6B9C1; Mon, 5 Apr 2021 00:31:05 +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 5DE9A37DD; Mon, 5 Apr 2021 00:31:04 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH RESEND wpan 03/15] net: ieee802154: stop dump llsec keys for monitors Date: Sun, 4 Apr 2021 20:30:42 -0400 Message-Id: <20210405003054.256017-4-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 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 ce8956f31ef9..7815f253c8a3 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 Mon Apr 5 00:30:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 415572 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 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 281C4C433B4 for ; Mon, 5 Apr 2021 00:31:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0ADD661393 for ; Mon, 5 Apr 2021 00:31:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231773AbhDEAbc (ORCPT ); Sun, 4 Apr 2021 20:31:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:21994 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231745AbhDEAbO (ORCPT ); Sun, 4 Apr 2021 20:31:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617582669; 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=ud4bYnni5wEQFwEiFHnFrYnj2ZvW1WRv6DDO6B2Pe/0=; b=ADItpMP41nmVcSeSrIAAr/goZYC/DDkiLGTmi7SufY5MphoVhGUoWMkhTGuGlZ54J7IeZg +thkksptkWNudltRpEb7QcPch+CnIZR/bMrgSpS+MaQ8/kDMtyR+BDEQxtaZId9f4pX7zK R/jMx1xeRNIJX7XgLMWSRWqNyn8QsXQ= 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-551--Jd6-36CMzq8mlr7RQeeRA-1; Sun, 04 Apr 2021 20:31:07 -0400 X-MC-Unique: -Jd6-36CMzq8mlr7RQeeRA-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 A340B6B9C2; Mon, 5 Apr 2021 00:31:06 +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 0847D37DD; Mon, 5 Apr 2021 00:31:05 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH RESEND wpan 04/15] net: ieee802154: forbid monitor for add llsec key Date: Sun, 4 Apr 2021 20:30:43 -0400 Message-Id: <20210405003054.256017-5-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 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 7815f253c8a3..42a246b6f9cb 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 Mon Apr 5 00:30:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 415571 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 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 0B98DC433B4 for ; Mon, 5 Apr 2021 00:31:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DC48461393 for ; Mon, 5 Apr 2021 00:31:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231820AbhDEAbl (ORCPT ); Sun, 4 Apr 2021 20:31:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:29170 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231750AbhDEAbP (ORCPT ); Sun, 4 Apr 2021 20:31:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617582670; 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=tnSLsRPy7fHZnncoOcRalDHqIOYtKxrUOy+3tLNMXug=; b=FRdxX16kTvfIbw2KAT/4t0Y+/kIxTVRtIhPHcY6KqfQZdxEZ65BCH7f/z31KOb5B62O2dA 3D60lqbGjc4mQTbpK0au7vNnnyNlLp2nbQC9WJVaEx1g4ZS3seaJmpApabPtSmQnodSMFP W8g93x5p9TuBORJTwr47T6BtZd53mtE= 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-439-LBSdQQ-ePcGaa0u-SbHi5w-1; Sun, 04 Apr 2021 20:31:08 -0400 X-MC-Unique: LBSdQQ-ePcGaa0u-SbHi5w-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 4C674881278; Mon, 5 Apr 2021 00:31:07 +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 CBD7E37DD; Mon, 5 Apr 2021 00:31:06 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH RESEND wpan 05/15] net: ieee802154: forbid monitor for del llsec key Date: Sun, 4 Apr 2021 20:30:44 -0400 Message-Id: <20210405003054.256017-6-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 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 42a246b6f9cb..bfc0eca774e3 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 Mon Apr 5 00:30:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 415570 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 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 95E20C433ED for ; Mon, 5 Apr 2021 00:31:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6FC6B61393 for ; Mon, 5 Apr 2021 00:31:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231789AbhDEAbq (ORCPT ); Sun, 4 Apr 2021 20:31:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:42268 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231760AbhDEAbS (ORCPT ); Sun, 4 Apr 2021 20:31:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617582672; 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=VfCnJkta+8F2c4fJv7y9YIk7W0E2kwmAy5zrFL0vAsw=; b=jST3i3cbZJAU5Y2NX2NEwrvtRzpxbZMcld5Ei9GLJct2GyDSZCAGO+/p9IO8Zhabtm5vNK TjpaHrgs/RvBJEL6Xp6t9Jz5Zfa4ATb/HaLxyBjdvkyuvncvtpslRq9Krvw6pCqYQwYeuR FGe4JtCDeyB0S0gXavptyG2U4Nn+w7M= 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-226-l7QiYpoFOjSIz3rOvvxoMg-1; Sun, 04 Apr 2021 20:31:08 -0400 X-MC-Unique: l7QiYpoFOjSIz3rOvvxoMg-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 E9D541007468; Mon, 5 Apr 2021 00:31:07 +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 7568A37DD; Mon, 5 Apr 2021 00:31:07 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH RESEND wpan 06/15] net: ieee802154: stop dump llsec devs for monitors Date: Sun, 4 Apr 2021 20:30:45 -0400 Message-Id: <20210405003054.256017-7-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 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 bfc0eca774e3..ef0becc9faa7 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 Mon Apr 5 00:30:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 416381 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 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 74A9EC433ED for ; Mon, 5 Apr 2021 00:31:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5331461396 for ; Mon, 5 Apr 2021 00:31:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231827AbhDEAbn (ORCPT ); Sun, 4 Apr 2021 20:31:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:59852 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231753AbhDEAbQ (ORCPT ); Sun, 4 Apr 2021 20:31:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617582671; 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=SO4Df76od9J3qY6ArWcM4V6PEGyI/35oBQG0O9zNE8c=; b=TfN+EeGkpQaAObRV6LoBWOMLYF45NJSJRffs8VmcjNjFN04ad1NSlnKiUFyJOVi9Iq1y8i k/dMixQa3MUTkihNXqK3dTiHg/rciEKmDU31CzWgJuL5p0Ckq0NXF//t1wuOYcaHuhsb8q h6pOEK2H31qZy0JDsBV5Uu3cD7rfHiU= 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-76-S4sLU7gTOF6TD-zqSU6GIA-1; Sun, 04 Apr 2021 20:31:09 -0400 X-MC-Unique: S4sLU7gTOF6TD-zqSU6GIA-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 9420281744F; Mon, 5 Apr 2021 00:31:08 +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 1E7D737DD; Mon, 5 Apr 2021 00:31:08 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH RESEND wpan 07/15] net: ieee802154: forbid monitor for add llsec dev Date: Sun, 4 Apr 2021 20:30:46 -0400 Message-Id: <20210405003054.256017-8-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 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 ef0becc9faa7..0d7dc9478b56 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 Mon Apr 5 00:30:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 415569 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 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 4B660C433ED for ; Mon, 5 Apr 2021 00:31:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2933E6136A for ; Mon, 5 Apr 2021 00:31:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231858AbhDEAbx (ORCPT ); Sun, 4 Apr 2021 20:31:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:36420 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231757AbhDEAbS (ORCPT ); Sun, 4 Apr 2021 20:31:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617582671; 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=qegaL49eQ0ulAGqlQqr7hH6RdMrVNCo8k8O6Uq9V76E=; b=P5qmX1FOqCHYBE77C7nw9DbkK8f+WDUISDM08jVvw+ecb5Iea67ggZfv6kojauiglgDNNt Os+2v8gprQaJC/x2y385YCGTzGrwB9YeWcVCJExHoweSZ1X2C1v1JebypBGHh69S+p+uoh WAz11iqp437J5tAWwFoikAb/96m433M= 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-518--W0lacKHNAG3w7X0vgBtfw-1; Sun, 04 Apr 2021 20:31:10 -0400 X-MC-Unique: -W0lacKHNAG3w7X0vgBtfw-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 3C7CC6B9C1; Mon, 5 Apr 2021 00:31:09 +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 BCB8A37DD; Mon, 5 Apr 2021 00:31:08 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH RESEND wpan 08/15] net: ieee802154: forbid monitor for del llsec dev Date: Sun, 4 Apr 2021 20:30:47 -0400 Message-Id: <20210405003054.256017-9-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 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 0d7dc9478b56..17c782d4cdae 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 Mon Apr 5 00:30:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 416380 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 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 3638DC433B4 for ; Mon, 5 Apr 2021 00:31:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1550361393 for ; Mon, 5 Apr 2021 00:31:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231842AbhDEAbs (ORCPT ); Sun, 4 Apr 2021 20:31:48 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:27203 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231758AbhDEAbS (ORCPT ); Sun, 4 Apr 2021 20:31:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617582672; 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=6N5hKnaT8IXFDBUYzrd332qy+xjid64X0u370o73asY=; b=WinhF4l8spIkdKD5RSyJLMjF1e52aD/9C9d1TALf35Nk6rHV6fnqrKqp0vOB+Pco5Yo41I mijLOFj/BsfCL2M1JzOD8VEttVuJnPN0pkAqWN+/5Vk0QzoOFfCriFaq0OSPgLThBrkN5S qGD7e9fCeaHQsjmsJwOYh5O3GJ2+Y/c= 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-152-0mSleKy2MdqWxexJ0G3nRQ-1; Sun, 04 Apr 2021 20:31:10 -0400 X-MC-Unique: 0mSleKy2MdqWxexJ0G3nRQ-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 D9EDB801814; Mon, 5 Apr 2021 00:31:09 +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 662802B0DC; Mon, 5 Apr 2021 00:31:09 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH RESEND wpan 09/15] net: ieee802154: stop dump llsec devkeys for monitors Date: Sun, 4 Apr 2021 20:30:48 -0400 Message-Id: <20210405003054.256017-10-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 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 17c782d4cdae..6f9cb6c0cafc 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 Mon Apr 5 00:30:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 415567 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 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 A5947C433B4 for ; Mon, 5 Apr 2021 00:32:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7F29B6136A for ; Mon, 5 Apr 2021 00:32:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231876AbhDEAcL (ORCPT ); Sun, 4 Apr 2021 20:32:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:30059 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231770AbhDEAbV (ORCPT ); Sun, 4 Apr 2021 20:31:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617582675; 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=bWUdLJo2cMQDk+q38cVffltQu3HvJ8GvQwA1ZuTeNbs=; b=fPCPLqArF2GCe7ZdrLEJ6NTd4mi+39FOzvmbVfIbp1NzrT3qdvTEtzZXvS8B4ou81gwkS6 mPmxd5+Pd3UydR5mf++ddm9fBpvRECc/DLarNgJT0ZN2+ujPF9/DXF2rwpDPF7vAlQMJ1k OPYtueLu2ZYkhhulZ3rum5p/ydxlkl8= 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-65-EkdbIPmgPYanDtH-MiKc2Q-1; Sun, 04 Apr 2021 20:31:11 -0400 X-MC-Unique: EkdbIPmgPYanDtH-MiKc2Q-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 8222B81744F; Mon, 5 Apr 2021 00:31:10 +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 0E5D537DD; Mon, 5 Apr 2021 00:31:09 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH RESEND wpan 10/15] net: ieee802154: forbid monitor for add llsec devkey Date: Sun, 4 Apr 2021 20:30:49 -0400 Message-Id: <20210405003054.256017-11-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 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 6f9cb6c0cafc..c3f9bff7a557 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 Mon Apr 5 00:30:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 416379 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 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 7AE60C433ED for ; Mon, 5 Apr 2021 00:31:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5BD3161396 for ; Mon, 5 Apr 2021 00:31:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231737AbhDEAb5 (ORCPT ); Sun, 4 Apr 2021 20:31:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:58523 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231765AbhDEAbT (ORCPT ); Sun, 4 Apr 2021 20:31:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617582673; 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=TFv7cz9MPusINhDBE3YU+ou8WqCyc1JOsjs+Pyb7JmY=; b=Vx4AU83Hz2/TlJ01J2h9c2CNtwY0+pmcd7ych1CH+DJfChRFTk+7UgvgyluqHYOxN6Ye3/ DYrwTFrGjcrfc/eNPVZ3Eu+++/RxIjrM2SxrD5Qfiju/gD+xGxUKVURhBZyoq4b4NtWdKJ Kv/ZkhnqWuv2X5nj2NAzRvgi+4DGi8Q= 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-566-6qe8tAtaOsuSN8vAq-kB9w-1; Sun, 04 Apr 2021 20:31:12 -0400 X-MC-Unique: 6qe8tAtaOsuSN8vAq-kB9w-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 2B678107ACCA; Mon, 5 Apr 2021 00:31:11 +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 AB2C037DD; Mon, 5 Apr 2021 00:31:10 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH RESEND wpan 11/15] net: ieee802154: forbid monitor for del llsec devkey Date: Sun, 4 Apr 2021 20:30:50 -0400 Message-Id: <20210405003054.256017-12-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 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 c3f9bff7a557..88735f03b73e 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 Mon Apr 5 00:30:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 415568 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 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 6922BC433ED for ; Mon, 5 Apr 2021 00:31:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 48C3F61396 for ; Mon, 5 Apr 2021 00:31:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231809AbhDEAcC (ORCPT ); Sun, 4 Apr 2021 20:32:02 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:56931 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231727AbhDEAbU (ORCPT ); Sun, 4 Apr 2021 20:31:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617582674; 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=npK8BY/FGAVwaaC/lhkdfNVd3nL+DQGeL0KtFJC0rq8=; b=XLuV256c+kLv5grn1zgBHxchAsKcYdcG5IBLYGs+g+rvtkOgC/uSX9GFxCvHwtkh/yDulw ey5OKL4srT4hT5YJITNoz2tgyPCkk3X4fLcc1V2MhEv3jP/hJPTBLdWqCQFW235gOW/dzz 4jtDZU8APOv3NNXEo97gOXb71hDnnsM= 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-195-Q6kfSqflPiW_5WYs9xaNww-1; Sun, 04 Apr 2021 20:31:12 -0400 X-MC-Unique: Q6kfSqflPiW_5WYs9xaNww-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 C880E107ACCD; Mon, 5 Apr 2021 00:31:11 +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 549DC37DD; Mon, 5 Apr 2021 00:31:11 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH RESEND wpan 12/15] net: ieee802154: stop dump llsec seclevels for monitors Date: Sun, 4 Apr 2021 20:30:51 -0400 Message-Id: <20210405003054.256017-13-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 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 88735f03b73e..9158b095ccf9 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 Mon Apr 5 00:30:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 416378 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 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 4A85CC433ED for ; Mon, 5 Apr 2021 00:32:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2A1ED6136A for ; Mon, 5 Apr 2021 00:32:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231716AbhDEAcH (ORCPT ); Sun, 4 Apr 2021 20:32:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:24698 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231772AbhDEAbV (ORCPT ); Sun, 4 Apr 2021 20:31:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617582675; 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=jgpUIGLISFeh7eSs+6nGRaPvORhnNP9d/VkxZsbMKD4=; b=bZzVjtcoA/c4mH2KiaQK7ADyz66hW8ZlQ/W2bwcdAyBVEUFXAy9iEG+6HY7fwczJauqhKo KOsICVWso3OJ/NhV0LFreC5m8z+78hjvs1UuBioyUMsfgI4TR3rwkaCQjNd/pQxcAUZ35X CAM8TyVgZFjN3MNplpyRKyfMqXUmR+Y= 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-169-gSK3XDk4Omu9t4v9iDeDdA-1; Sun, 04 Apr 2021 20:31:13 -0400 X-MC-Unique: gSK3XDk4Omu9t4v9iDeDdA-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 724F210866A0; Mon, 5 Apr 2021 00:31:12 +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 F143037DD; Mon, 5 Apr 2021 00:31:11 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH RESEND wpan 13/15] net: ieee802154: forbid monitor for add llsec seclevel Date: Sun, 4 Apr 2021 20:30:52 -0400 Message-Id: <20210405003054.256017-14-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 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 9158b095ccf9..28427ce52a9b 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 Mon Apr 5 00:30:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Aring X-Patchwork-Id: 416377 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 E694CC433B4 for ; Mon, 5 Apr 2021 00:32:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ABF2161396 for ; Mon, 5 Apr 2021 00:32:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231888AbhDEAcO (ORCPT ); Sun, 4 Apr 2021 20:32:14 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:55788 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231775AbhDEAbV (ORCPT ); Sun, 4 Apr 2021 20:31:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1617582675; 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=eT2Kw0o0cAWXswb/IL3LKCNaV7EY6BT3R09FaXJ8el8=; b=H1V1cabjcmA3rxvbTnH6EM4XjEaP+mYYjUrFq5gYUsNeCKbBg+SQXzoKjGZ66YDCggGlrn 7cUzu5VVXqy7LDYVJsbQwWI25Es+tyNbb92VlmFplwP4QkxA2XuPgjA7Tw9ht0V86WJdSh OAak+fAtIfvJgfoRC7/+CM8OmzTNYYg= 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-254-_xPGuXZ_Me6M5-BNG6lpSg-1; Sun, 04 Apr 2021 20:31:14 -0400 X-MC-Unique: _xPGuXZ_Me6M5-BNG6lpSg-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 1D9306B9C0; 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 9BEA637DD; Mon, 5 Apr 2021 00:31:12 +0000 (UTC) From: Alexander Aring To: stefan@datenfreihafen.org Cc: linux-wpan@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH RESEND wpan 14/15] net: ieee802154: forbid monitor for del llsec seclevel Date: Sun, 4 Apr 2021 20:30:53 -0400 Message-Id: <20210405003054.256017-15-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 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 28427ce52a9b..effc4c1a4780 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 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: 415566 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 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);