Article View: linux.kernel.netdev
Article #9339Re: [PATCH] ieee802154: nl-mac: validate device pointers before dereference
From: Andrew Lunn
Date: Sun, 01 Nov 2026 19:43
Date: Sun, 01 Nov 2026 19:43
17 lines
9059 bytes
9059 bytes
On Sun, Nov 01, 2026 at 02:52:19PM +0530, Kalpesh Solanki wrote: > A virtual network device (such as a TUN interface) can have its link > type set to ARPHRD_IEEE802154 via ioctl(tun_fd, TUNSETLINK, > ARPHRD_IEEE802154). However, such devices do not have an IEEE 802.15.4 > private context allocated (dev->ieee802154_ptr is NULL) and do not > register MAC operations (dev->ml_priv / ieee802154_mlme_ops(dev) is NULL). > Fix this by ensuring dev->ieee802154_ptr and ieee802154_mlme_ops(dev) > are non-NULL before proceeding in ieee802154_nl_get_dev(), > ieee802154_dump_iface(), and ieee802154_llsec_dump_table(). Did you consider the other fix? Is there a use case for setting a TUN interface to ARPHRD_IEEE802154? If not, maybe return EOPNOTSUPP, or EINVAL? Andrew
Technical Details
Message-ID:
<776e6791-2677-4bd1-ac00-4eef07d5a4a6@lunn.ch>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-354319-linux-kernel-netdev=dewy.ruReferences:
<20261101092219.1278751-1-skalpesh942@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-354319-linux-kernel-netdev=dewy.ru From: andrew@lunn.ch (Andrew Lunn) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH] ieee802154: nl-mac: validate device pointers before dereference Date: Sun, 1 Nov 2026 20:43:29 +0100 Organization: Usenet Network Message-ID: <776e6791-2677-4bd1-ac00-4eef07d5a4a6@lunn.ch> References: <20261101092219.1278751-1-skalpesh942@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="2754018"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:i5azr4i8JiF5eKKABQRgzuA0eKI= sha256:g6NLeo519uq288CavBVL2DcsMACj4g031nNsgqicRBA= sha1:6iyKuvNh4w+f/MycP9VOpFF68Kk= sha256:oYbagfA9GdKqT0ID/a0i/ZQHEAxgPuvAKjTb694rkPM= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id B2F44112384; Sun, 1 Nov 2026 22:44:19 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.049 X-Spam-Status: No, score=-3.049 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=lunn.ch X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PNnk2s3dUfoW; Sun, 1 Nov 2026 22:44:15 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-354319-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 5FE2D11237F; Sun, 1 Nov 2026 22:44:05 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 64E14274C7; Sun, 1 Nov 2026 19:43:57 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793562236; b=DxDmtGtN/5WOEXLNLBj9acFEe+NLeb5XAMkj3YGKVFPQl7KSwDVvfatGS27q1iUN+z3d eaz3aVm7BZUXvdO9p+enj/O814ztz0N2haRV7hje3rxWO4FC/Z71CyPt85N0z2jQuFNMn kXUGz6GrmoyVVCCUULtdr7oPgvoV/IfeUXxhNcEC/p6lSjLcwgDzEj+RcB03BtJ5ROs6d bTDYjcCcND4W4ZsXBv/vdz2Nczf8P4K6w+3TxMoLt395NdeEo8dKIdxWsxqESGJfwZZFK bgdG4mGsoWCo0dlW5cy1EjH4d4VNIm8t8dEG1C4eS3JUW9NGcjj2sHv0JhosSBh/DUA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793562236; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date: From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=eXZg4OtNyAdnGb6jvfUIQu7basWR+frN3rF2zFF8XoY=; b=eUlAT7rX036mWzQUNx7ZtzKAVsx+I2SfZzUe4HJL2H3QJGaU2VdIYtEf4AjxJiIi2hGJ ix4kNhd827sauJmBRUlHgFZMT8DzZP1OpAjjLPKKhXynAHi33qKuWWL52b4sle8NbWJxv ye79BC8Df3R7Wb4qGHHYAhvs5kNRYRNB3o+vas4J6f/vbVDstsm+/Xn1gzjLCtKu3BdFb T0dHyWTFjprF+0RNNfCMayUx5fC2X1Bu09aelNxE/c7B0INRKSsuLR1TCCPQ+/F7Ki9/l n2AGZ/XmqiCw67aevRkpkMXnifssl1OSlx1qgU96LaIhRnPZLZXOLD3Fol1WDpTaLqQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=ejegZVbf; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8DCDC606A331; Sun, 1 Nov 2026 19:43:56 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=ejegZVbf X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793562230; b=jKQiyZrWvuHQm7pf0s2T6Cnum+hP3YBTG4sSh6SGM4dqmD+t5hBGelFZ/GEyEmA8/w7v /Fop9djlPpoatlfrLIALfilKQ6x5GRX44QWcbpTWEQYF2YLSKWejaIHNtf1MeMJ55x9tP trpNstpOuhHiiAbl/DqYTcFoATd/O0JwOEdAPDJiP7jmmrUlVCQ39bFsydzWKzKBBKhjD 5mNe+lxBL8XEE7uyvyCWrpikNJkPEPK0GzWGw22spakE13MLMxypfc4QcvjMSCyEWuDP2 WazFF4Z1+976cjxwmuI2k6ZbUtOgSC1UgiAokWviN8txYueefrjfuUJA+Yx2BlVHUgA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793562230; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; bh=eXZg4OtNyAdnGb6jvfUIQu7basWR+frN3rF2zFF8XoY=; b=mVRMegZOx8jkMF3Q91Oy8tayqTGm60CoU1dGW3siayq3fw/CGOl9v/BNC19bVLJCImVN Jkvnm/hdboz+Z6ecEpll0S/pMrBPrQTWQWv0OIhCdJyL6ZXWq1bbDEabAIdESuOzBJGj8 6WmMRgVahvj703sABiPscdMSB+FghANJAGKPZz0JdGbbOVjhHp8+3nOGyGdgwsO/IUDdt o9yFaEwRkZW2185cufPpo27IzpTnnjoSh/foJOrNpoENlw+lFOSfVyfgSegSCHMSN6l4T oF8p54hbRvhl37WXsGT7gTRcyVCZVZLsv238JNdkt1AlvJjB8C2rxuiP5GezlVqhkxQ== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=ejegZVbf; arc=none smtp.remote-ip=156.67.10.101 X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7121606A324; Sun, 1 Nov 2026 19:43:49 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E7121606A324 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=eXZg4OtNyAdnGb6jvfUIQu7basWR+frN3rF2zFF8XoY=; b=ejegZVbfSrQIsj4DbPjatkpbyn jTO4woQ4gsJNmhDIU2diju2WT9y+Tams8Q4LmbqRCyEKGJxGct/Al74TCEnaAHO/gJzhnQhzmUzD/ eYj3resewV3Rg+51vWmZallTovjtVtZXrKl2T2UmkxKOlfvW54Pok7lE8qn/Wm7g4wcc=; X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from <andrew@lunn.ch>) id 1xNbSj-00DfQM-2f; Sun, 01 Nov 2026 20:43:29 +0100 X-Cc: alex.aring@gmail.com, stefan@datenfreihafen.org, miquel.raynal@bootlin.com, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, linux-wpan@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+9ea34da5ca6100593c90@syzkaller.appspotmail.com, stable@vger.kernel.org X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <20261101092219.1278751-1-skalpesh942@gmail.com>