[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250908102725.10b368e2@kmaincent-XPS-13-7390>
Date: Mon, 8 Sep 2025 10:27:25 +0200
From: Kory Maincent <kory.maincent@...tlin.com>
To: "Russell King (Oracle)" <rmk+kernel@...linux.org.uk>
Cc: Alexandra Winter <wintera@...ux.ibm.com>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
<kuba@...nel.org>, netdev@...r.kernel.org, Paolo Abeni <pabeni@...hat.com>,
Shannon Nelson <sln@...main.com>, Simon Horman <horms@...nel.org>
Subject: Re: [PATCH net] net: ethtool: fix wrong type used in struct
kernel_ethtool_ts_info
On Sun, 07 Sep 2025 21:43:20 +0100
"Russell King (Oracle)" <rmk+kernel@...linux.org.uk> wrote:
> In C, enumerated types do not have a defined size, apart from being
> compatible with one of the standard types. This allows an ABI /
> compiler to choose the type of an enum depending on the values it
> needs to store, and storing larger values in it can lead to undefined
> behaviour.
>
> The tx_type and rx_filters members of struct kernel_ethtool_ts_info
> are defined as enumerated types, but are bit arrays, where each bit
> is defined by the enumerated type. This means they typically store
> values in excess of the maximum value of the enumerated type, in
> fact (1 << max_value) and thus must not be declared using the
> enumated type.
>
> Fix both of these to use u32, as per the corresponding __u32 UAPI type.
Reviewed-by: Kory Maincent <kory.maincent@...tlin.com>
Thank you!
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
Powered by blists - more mailing lists