Article View: linux.kernel.netdev
Article #6133Re: [PATCH net v3 3/3] net: fealnx: bound card_idx to prevent out-of-bounds access
From: Andrew Lunn
Date: Wed, 21 Oct 2026 17:26
Date: Wed, 21 Oct 2026 17:26
21 lines
9610 bytes
9610 bytes
> > + if (card_idx >= MAX_CARD_IDX) {
> > + dev_err(&pdev->dev, "card_idx is too big %d, aborting",
> > card_idx);
> > + return -ENODEV;
> > + }
> > card_idx++;
> card_idx can reach 100000 is it ok?
It is one of those stupid LLM issues which never happens, but
$DEVELOPER wants to fix it anyway.
If you unbind and bind the device lots, you can eventually get
card_idx to overflow. Assuming card_idx is a 32 bit int, and it takes
10ms to unbind/bind, you could make it overflow in about 18 months.
100,000 iterations makes it around 16 hours, which is feasible, so i
hope the submitted has tested it. But probably not, it is just
pointless LLM churn wasting all our time.
Andrew
Technical Details
Message-ID:
<d9d7342b-49fd-4256-9829-bf1e3f88f973@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-350169-linux-kernel-netdev=dewy.ruReferences:
<20261019134136.104932-1-r.zhambakiev@prosoftsystems.ru> <20261019134136.104932-4-r.zhambakiev@prosoftsystems.ru> <CH3PR11MB566895CD7DE8923616D891C85BE5662@CH3PR11MB566895.namprd11.prod.outlook.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-350169-linux-kernel-netdev=dewy.ru From: andrew@lunn.ch (Andrew Lunn) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net v3 3/3] net: fealnx: bound card_idx to prevent out-of-bounds access Date: Wed, 21 Oct 2026 19:26:36 +0200 Organization: Usenet Network Message-ID: <d9d7342b-49fd-4256-9829-bf1e3f88f973@lunn.ch> References: <20261019134136.104932-1-r.zhambakiev@prosoftsystems.ru> <20261019134136.104932-4-r.zhambakiev@prosoftsystems.ru> <CH3PR11MB566895CD7DE8923616D891C85BE5662@CH3PR11MB566895.namprd11.prod.outlook.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="19598"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:MjAxLpB+FQuhAH0H3/z0DI9rOSw= sha256:VI6PKucXw3Jylm1rCvkXe+XqcNn6LE+s/ncAP0Unbfw= sha1:yAOIXsfaU/mlXB9Et5IlJmEZHuM= sha256:wz996E2ziQDPhWAGGvHjwcrjr63evRP0KnWNzEOjUaY= 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 B4DCB1110BA; Wed, 21 Oct 2026 20:33:26 +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 KDIdeDurDH3p; Wed, 21 Oct 2026 20:33:23 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-350169-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 81C741110B2; Wed, 21 Oct 2026 20:33:13 +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 69613369F7; Wed, 21 Oct 2026 17:27:11 +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=1792603628; b=c392MzoQJLGxiHBRBdpnqWOkQySnxoFHRzsUvVbmBcMntdLc2OJA9xTQqOepvc9daghz O2o/M8MY2ndkkWeuefZTHY2h4jiWOZhBkCF1VJnWyQHZ9z8od7TelM1ShiGpjrwKpiOdO RtWODM8ZkDsU3nSxdOaecAnppfPERG1KjNfCJuRR9bPCU3KGtXKtd2T174aO86/Spf4wH Ti8ouWh67kC46beuul5Yvs7AdUfZ5rKhbpcSQqXVXAua/Ajzg9wvW9jlSWCcotzPAB4jV T8nB19ElfkgDixREWsoQQmjdqQFt3eUxro0Z0s3v1AKGyX3XF3VaIBMUNH+VQF9+X3w== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792603628; 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=h3eiV5A+QKOWy2w7+4LROeS6gt8on5LmWdPqXtFAEYw=; b=AsR5FULdvJzyVuaz3+XNND99D2zk2FK+ZaxMPak3wM72OVulYxZndAVMd1HhSdZDSbx7 RJp1B6d9c3wiG3x7glOSlYgIMquAAubFeGWsDMtybQOUqbG6ecLxXkDPITw94yGo0Fpo+ l+z+lbGahJvaLERM1KrGUBNbe9Wq8BoX1mWkHdjMSt7FhKWRlP0nENX7SWOmryUiIlzeh 7Md/QE3osjMjtKUZsT76hnWBj8JAE9+/b5pu+9i6zucucFv4RAfYCP1V4pn8uzz0mVuF0 RRzyhlCZ1IbGCN8/qFkXNLeJEpoonMlTSTSSQpyNTKSlYvE5uOew6Brjr+8NaLTlDJg== 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=an2SYGpK; 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 3B416606A326; Wed, 21 Oct 2026 17:27:08 +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=an2SYGpK 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=1792603622; b=i/DCNLkF50NLc6WvJt6VxQFQr6Q8JjYWayIH+ZXKn4C53bg0ANOPo1pjiMQKlzxfxJbv TOZzCNFSxbLMwTW63OkLU8ndo4OLE2PJUFNjEtWV2lzbsbP3c7GAjWOOS1WkHalYFMiLg KYEylD9yK7ChQXX52/XfVHa+a2NPsCME+GzO82qPveSLXFe9aLOktJWdKCcXdlHr+ud+4 s1+SHjKwbuR18Z7f9qx4idlMTpu3B+ZrcmPBuB13tG7TqwJayhgaa7jO7cp8b5JILQd+4 ySYa4qHkr1mCWVc8lZJiG3tuqtKYk3/LWarnk18N32h0Rce0spde9xxD6BqetbxK+3A== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792603622; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; bh=h3eiV5A+QKOWy2w7+4LROeS6gt8on5LmWdPqXtFAEYw=; b=B8XNBCqWD3Uqa6W5xhgAPNKCunZNF57jv1erPR4SyHLdKlpnQJAinSQtUDchvoNmFTnf +GM5/KKK0d4XU5s73kVWazpCFcIzOwvxSAJ63cLGapYNeMseFU5pmVTSOb/oWhOjGtwr4 pdECaW1Y/4lkn/zANMs+0uFT7QZUDs7TfRYCu2DtlgnIm9mqSGCo2OhWLUgLtSVO8/UfY cBUqvMgmuOImsBBpfE8U1n3W7TktniAeQEP84ciXuNAOUcb7GFRy2iJtJmYN/+D5nIWVQ QTSe0P3rSZXSIauPmgiLsy8caagUPar9bAt/EyYSnOJ9p/t2WrwRM9YKMOcI6JWTiJQ== 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=an2SYGpK; 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 062DC606A319; Wed, 21 Oct 2026 17:27:01 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 062DC606A319 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=h3eiV5A+QKOWy2w7+4LROeS6gt8on5LmWdPqXtFAEYw=; b=an2SYGpKUCjS7R9P87RF9hMYLe Q1JI6xOM2I36oPaXd4mVUU7JFWPcgkT2aA/GCZkLJdyHoCJS0gbz18EETAY+/eHdA/5NwqoPTETl2 8Uu6WscrR+qkL53xgwaleLCi/NYycM6miFtAKObxGQNnLJvyZb0INuZyHTUHTDc6hpXI=; X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from <andrew@lunn.ch>) id 1xJa5E-00C8V2-JM; Wed, 21 Oct 2026 19:26:36 +0200 X-Cc: Жамбакиев Радий Рикардинович <r.zhambakiev@prosoftsystems.ru>, Andrew Lunn <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Michael Grzeschik <mgr@kernel.org>, Jijie Shao <shaojijie@huawei.com>, Denis Benato <benato.denis96@gmail.com>, Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>, "netdev@vger.kernel.org" <netdev@vger.kernel.org>, "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>, "lvc-project@linuxtesting.org" <lvc-project@linuxtesting.org>, "stable@vger.kernel.org" <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: <CH3PR11MB566895CD7DE8923616D891C85BE5662@CH3PR11MB566895.namprd11.prod.outlook.com>