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 699DAC47DD9 for ; Wed, 28 Feb 2024 21:53:47 +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=gTOoD19CnI0HL4XW8kgfNVtjv03bnGNqJ8OgBx7A1Ko=; b=DSHfwhTxz5cPEl pcS4Gs6MPf/fOVazPDNhmHf8G9dPKvTnN6zxXQN1T+K6n96+BtdAVT1JyxiTibDRP/52m/eh7ITzM I9p8HDzlDBLgzihMRKwcGeFT3FsGtJl1yKbSKbrBiybpKRm4UGeuNd9OOwadSRudpsr+Qm2Jnk93o NCz5emO7uuvNbJEQicjCdzPJvpzaoUjWM/uCD/ji1BQ8EKzEsg/Rc+iV08wsIIskogz6lKFpL2J9N z1HDasTgQrrKNYs4CqsZuJ3eO8aExq75u7a3bJCmxqj9ccBOybHq+B6vPyJyzl/pIK8+Ov/7Xu0I7 qDst33rLZdkmub+q/+NA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfRrk-0000000B392-3GLl; Wed, 28 Feb 2024 21:53:28 +0000 Received: from mgamail.intel.com ([192.198.163.12]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfRrh-0000000B38f-3ZK7 for linux-arm-kernel@lists.infradead.org; Wed, 28 Feb 2024 21:53:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709157206; x=1740693206; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=DXAncb5M5L0FxykniOApRquIQ7d0QWI8AZKaQoqhSto=; b=JszyAgfsUJlMKy7/Dme8aTASA7c8aCqm/u0zV1MAvQ32GA8gvq9gm1mc UqnIxQXZEZlLf7IORYb/ZT/+Afz+mzC1eGM+6GotOHcRi+ds9c7JBiY3y cMQojTQENZG8mLZDHL3Egtnhqu9aNS9iwUt+fBbzUlxW1EuhuJ2NCQUfK z1lmA76Dc2TOSKenCvwNfNfcLCezOxPsvt1DW8FmaaQYvm4I+TS0ZpQV5 tu/B9ua0fPF/QKaYbflGqNX/D4cWjZoVh0eaEzzNQC76B3EDfNInWCb8V b7ZiM62jR04iX9SucdXdbPcpidKJmD7deCitVZhnGSXq+AHWEvf9WGNEs g==; X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="7373406" X-IronPort-AV: E=Sophos;i="6.06,191,1705392000"; d="scan'208";a="7373406" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmvoesa106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2024 13:53:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10998"; a="913962225" X-IronPort-AV: E=Sophos;i="6.06,191,1705392000"; d="scan'208";a="913962225" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2024 13:53:21 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rfRrZ-00000008Vpz-48uU; Wed, 28 Feb 2024 23:53:17 +0200 Date: Wed, 28 Feb 2024 23:53:17 +0200 From: Andy Shevchenko To: Kees Cook Cc: 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 , Jakub Kicinski , 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <202402281341.AC67EB6E35@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-20240228_135325_945590_BE10FD12 X-CRM114-Status: GOOD ( 13.49 ) 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 01:46:10PM -0800, Kees Cook wrote: > On Wed, Feb 28, 2024 at 10:41:37PM +0200, Andy Shevchenko wrote: ... > > static inline void *netdev_priv(const struct net_device *dev) > > { > > - return (char *)dev + ALIGN(sizeof(struct net_device), NETDEV_ALIGN); > > + return struct_data_pointer(dev, NETDEV_ALIGN); > > } > > I really don't like hiding these trailing allocations from the compiler. > Why can't something like this be done (totally untested): Below is interesting idea, now at least I started understanding your previous comments. -- 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