From: Kory Maincent <kory.maincent@bootlin.com>
To: "Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
Cc: Alexandra Winter <wintera@linux.ibm.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, Paolo Abeni <pabeni@redhat.com>,
Shannon Nelson <sln@onemain.com>, Simon Horman <horms@kernel.org>
Subject: Re: [PATCH net] net: ethtool: fix wrong type used in struct kernel_ethtool_ts_info
Date: Mon, 8 Sep 2025 10:27:25 +0200 [thread overview]
Message-ID: <20250908102725.10b368e2@kmaincent-XPS-13-7390> (raw)
In-Reply-To: <E1uvMEK-00000003Amd-2pWR@rmk-PC.armlinux.org.uk>
On Sun, 07 Sep 2025 21:43:20 +0100
"Russell King (Oracle)" <rmk+kernel@armlinux.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@bootlin.com>
Thank you!
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
next prev parent reply other threads:[~2025-09-08 8:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-07 20:43 [PATCH net] net: ethtool: fix wrong type used in struct kernel_ethtool_ts_info Russell King (Oracle)
2025-09-08 8:27 ` Kory Maincent [this message]
2025-09-09 23:33 ` Jakub Kicinski
2025-09-10 12:46 ` Russell King (Oracle)
2025-09-11 0:44 ` Jakub Kicinski
2025-09-11 1:00 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250908102725.10b368e2@kmaincent-XPS-13-7390 \
--to=kory.maincent@bootlin.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rmk+kernel@armlinux.org.uk \
--cc=sln@onemain.com \
--cc=wintera@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox