From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B4D2DC5478C for ; Wed, 28 Feb 2024 22:42:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GjmoVnwJcTkNGAxrvZSUlcS5kGm/xVhD3mriV61y1cs=; b=L4FgExh7kW+3tC oEANYLZFLnj7zYhCiUZFTfLekxbgEdtaEByITuE60K7ibbFxTS+67OTnQU5xywNKM0GDVWir9idRT 9FgjI2IbQzrxS7OgSdkbJ4ZO8DKWN7RrYSI9AgiPrfSZsXben+u1YS+GjX7OoluRhsbRVYhK5Umf5 dPKgTPhOZlv1eid2VA/D6Gv2MpjS8vcwA07Krr0GRuAmIs0kQpXFimIoRJFT0EWCVhOGTGm6+UzbZ Lb3F9hIZ6xTOd44x10EiJmOT5d0w0ir6caVtl93Ev0N+wUXAg3Rb5vASj6IiyrTzwoXW596VA8yWQ lURSD7TD7dcXCVhjuzbQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfScj-0000000B9po-0ka4; Wed, 28 Feb 2024 22:42:04 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfSca-0000000B9oN-1ztI for linux-arm-kernel@lists.infradead.org; Wed, 28 Feb 2024 22:41:53 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id D565ACE1F9F; Wed, 28 Feb 2024 22:41:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C851C433C7; Wed, 28 Feb 2024 22:41:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709160110; bh=tjZVW+wfEpV5hm2GKoaS8QIBTAqnujkBvNvmFWcTTLc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=riY0y4Fx+9tYTZwqjeMsvr4+CHnvM+egJckNzF8PFaNWQ4EcaJYupvlD7D/scvNCv OhTNiq2/vxp/DVYtwKstTH3GAs1WmKe8yIY1CUOu7+oAK4EjG6PWlW5nZZj/ylk/xd 9Osn0CC2JXqYGhqhpjD+IOdYMgVLSQLQIgWQ8GvziuaEoSKgQ5/+gk9d5rqnvYJyKh WOn77ZDAlVWd8VC4fDQ6lEprgplYLB9xmm50yk2Fw7mM8ribnczNkB4HznWNedrKbx 0Zi5KnVyCs3gsId7Prbd3CVRBlNzEzTBkG0FuvZyKyNF8B/BkVTOKkG38ds7GZgeJM RMKDJwj4vNoHg== Date: Wed, 28 Feb 2024 14:41:48 -0800 From: Jakub Kicinski To: Kees Cook Cc: Andy Shevchenko , Vinod Koul , Linus Walleij , Jonathan Cameron , Mark Brown , linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-spi@vger.kernel.org, netdev@vger.kernel.org, linux-hardening@vger.kernel.org, Jonathan Cameron , Lars-Peter Clausen , "David S. Miller" , Eric Dumazet , Paolo Abeni , "Gustavo A. R. Silva" Subject: Re: [PATCH v4 7/8] net-device: Use new helpers from overflow.h in netdevice APIs Message-ID: <20240228144148.5c227487@kernel.org> In-Reply-To: <202402281341.AC67EB6E35@keescook> References: <20240228204919.3680786-1-andriy.shevchenko@linux.intel.com> <20240228204919.3680786-8-andriy.shevchenko@linux.intel.com> <202402281341.AC67EB6E35@keescook> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240228_144152_818311_B10AFE87 X-CRM114-Status: GOOD ( 11.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, 28 Feb 2024 13:46:10 -0800 Kees Cook wrote: > I really don't like hiding these trailing allocations from the compiler. > Why can't something like this be done (totally untested): > > > diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h > index 118c40258d07..dae6df4fb177 100644 > --- a/include/linux/netdevice.h > +++ b/include/linux/netdevice.h > @@ -2475,6 +2475,8 @@ struct net_device { > /** @page_pools: page pools created for this netdevice */ > struct hlist_head page_pools; > #endif > + u32 priv_size; > + u8 priv_data[] __counted_by(priv_size) __aligned(NETDEV_ALIGN); I like, FWIW, please submit! :) _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel