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 49881C48BF6 for ; Thu, 29 Feb 2024 10:54:51 +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:In-Reply-To:MIME-Version:References: 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=lTdozT3en/MTlxcMvB88tbiv1ZbanZ5z2U+DIRUPorU=; b=k92yeReJtb0yT/ Njlsm/Trbm3SRg1OcT7y11rSiuytaMi6HO2e843yWdr+LAFrl5FnJ7pUkKIHJ52HB2Xnkzbz3so9S PVQRgiAz6D7ME6wKUM425eNg/HmxYkFAjdIJTNg0Y0AX9j6bvDzlSko0PIl2nhvhb7B1jAogPxUvH +wgLdjXUAbXwJP8PlKiwnu2H6R65u+orbom7c0HN7/lNw2JkN+Ab3M2C5oItkF9S+ppf4IoWck/BI 83IT1EeBuADQxwfHP26HugM6Cr0gFyK0q3kyhP13URNTSdeTk3CX9hE9VFpLi7yZJkCD6SaNGN1oO 7hw+zF1XR8M3CMOLH0WA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfe3m-0000000DFWr-14qk; Thu, 29 Feb 2024 10:54:42 +0000 Received: from mgamail.intel.com ([198.175.65.10]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfe3k-0000000DFWG-1OSX for linux-arm-kernel@lists.infradead.org; Thu, 29 Feb 2024 10:54:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709204080; x=1740740080; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=SxVA8/lAGPXj7aJ44Uc6WXqxSXmTeZTF1kbZzTL+u+8=; b=kPG7I7BFBxmURb+RXgf+1uxraFhgW9Ysn/w4210LwXphsnsAA0GwFC3F 2Ih3Q3GWRL11NeGDaS2Pz1a4W++S7oR5hl+JCHlTK3ZmkzizcExLW8n7P HHrk9+XYZMZFjA5/3mR1c/ZoTjwjjuxna5izSZO1Qo6buOH+RJbS3cuHo HPq/WFVSvDCBblvHXxiFANASDJFbxLpCHAd0zhhmHWiEW1wxqT587sPT1 UBx7XmqT3pJ+05PnYnoEDA00zWkt3j30VumUTApPjqG0IwEu9SegQsTws XHqHmSw0MhbjotVIhMMMssSEvwXhD5P+icnObOTmEjo6Fn8oMkqciwe2K A==; X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="21122614" X-IronPort-AV: E=Sophos;i="6.06,194,1705392000"; d="scan'208";a="21122614" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Feb 2024 02:54:40 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="913978961" X-IronPort-AV: E=Sophos;i="6.06,194,1705392000"; d="scan'208";a="913978961" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Feb 2024 02:54:35 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rfe3b-00000008e8j-2Ooc; Thu, 29 Feb 2024 12:54:31 +0200 Date: Thu, 29 Feb 2024 12:54:31 +0200 From: Andy Shevchenko To: Kees Cook Cc: Jakub Kicinski , 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: References: <20240228204919.3680786-1-andriy.shevchenko@linux.intel.com> <20240228204919.3680786-8-andriy.shevchenko@linux.intel.com> <202402281341.AC67EB6E35@keescook> <20240228144148.5c227487@kernel.org> <202402281554.C1CEEF744@keescook> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <202402281554.C1CEEF744@keescook> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240229_025440_447963_4506816A X-CRM114-Status: GOOD ( 13.77 ) 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, Feb 28, 2024 at 04:01:49PM -0800, Kees Cook wrote: > On Wed, Feb 28, 2024 at 02:41:48PM -0800, Jakub Kicinski wrote: > > On Wed, 28 Feb 2024 13:46:10 -0800 Kees Cook wrote: ... > But I still like the idea -- Gustavo has been solving these cases with > having two structs, e.g.: > > struct net_device { > ...unchanged... > }; > > struct net_device_alloc { > struct net_device dev; > u32 priv_size; > u8 priv_data[] __counted_by(priv_size) __aligned(NETDEV_ALIGN); > }; > > And internals can use struct net_device_alloc... I just realized that I made same approach in f6d7f050e258 ("spi: Don't use flexible array in struct spi_message definition") 75e308ffc4f0 ("spi: Use struct_size() helper") -- With Best Regards, Andy Shevchenko _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel