From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4F3271E0B62; Mon, 28 Oct 2024 23:37:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730158637; cv=none; b=OFhFSa5sUaLTbJKii3ms2puFnDNu6KHWk1iUrD82LnbaglHNW3V0us+nGCo/YjImIbUuXq3pA41hfTGdILlkthR4kDeYeTatZ0btnjAMVv9kDZJsOV7OZ3M5jP3R8TjtKIz5wsdvPgbComaba+Wjt/WQlBpbo7F6OC5G58IsFyM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730158637; c=relaxed/simple; bh=S47lYuLvJr2byEk7lZ68+wZXEnpqqU3QlilyzPP2pTQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UtbY041V7S5HIB2xh448GbZph7AOpAh/HA3rwP/oeH8U90g3GVRaP5f34jICxgzKRJ6ZfoGmjsnvzq2E1w8SQFox+W7B275lSabGyjsrccNrXTTF1G5rOnPpAHw/30rYsQ0VPIPQ3F9Yw57e+a+D2J4sBFGQPhtg6uB4hiHOIp8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oLZqu6YZ; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oLZqu6YZ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1313C4CEC3; Mon, 28 Oct 2024 23:37:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730158637; bh=S47lYuLvJr2byEk7lZ68+wZXEnpqqU3QlilyzPP2pTQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oLZqu6YZKO6pIOVA84u2CXTBq/CHtCq7is5wPbCe6aEDMmS5kdRP6uXbjz0u9+Fwo P3ofV5oNNwlSvahrN2hCm+M7mWgv0NwNu112S5CWcRp2osulnb33UVoFVO/mvIqa+9 Sc9/vfMJCLfS29o7yCvvPlU+eaSNQvGmOgkjJVPHIOdIJhQWX/nI4LLp8NXpH9Cq2z 4vliL78nJRLeRV3A9MgXLpPhF8VojI3vbelczSz2RXq/rtSedS2WLNvf+Ko1T3n1BX MA9bHIBBARLbzpOnLFNcCUjmzuMpbbhoNKmUJahb2f6qVJ6fpQK6hr1lVqD+kNcpcK ZDeD1Hfb9Z4yQ== Date: Mon, 28 Oct 2024 16:37:14 -0700 From: Kees Cook To: "Gustavo A. R. Silva" Cc: Andrew Lunn , Johannes Berg , David Ahern , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH v2 4/4][next] uapi: net: Avoid -Wflex-array-member-not-at-end warnings Message-ID: <202410281637.68A4BCF7@keescook> References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Oct 24, 2024 at 03:14:31PM -0600, Gustavo A. R. Silva wrote: > -Wflex-array-member-not-at-end was introduced in GCC-14, and we are > getting ready to enable it, globally. > > Address the following warnings by changing the type of the middle struct > members in a couple of composite structs, which are currently causing > trouble, from `struct sockaddr` to `struct __kernel_sockaddr_legacy` in > UAPI, and `struct sockaddr_legacy` for the rest of the kernel code. > > include/uapi/linux/route.h:33:25: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] > include/uapi/linux/route.h:34:25: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] > include/uapi/linux/route.h:35:25: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end > include/net/compat.h:34:25: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] > include/net/compat.h:35:25: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end] > > Also, update some related code, accordingly. > > Signed-off-by: Gustavo A. R. Silva Looks right, including the helper prototype update. Reviewed-by: Kees Cook -- Kees Cook