From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (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 951302ECEAB for ; Mon, 8 Sep 2025 08:27:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757320069; cv=none; b=dzNTJLyFul1vw515qQz4xh/ogsRQDv87tmOrnncNr1B+ivCCmK1JYJ7gb9OxKwNuKcqKibrbg4ZTqt5by2mkuAkEy84C4xQ/P9nswCnjYh28S338rZa7agMlQPGELLp9i/irWBFBYz5r/KKNYmWPbrEmWch054Refzz41XkVJC8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757320069; c=relaxed/simple; bh=6ffU6EUZfBF4SIZFIFeAxQS2ganb6B9lq3MegA8FFVA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=U1eH8nFyfmbjgs/ud8LcSB5VpN0DAn1MrAOESS/mUjpM9clxtYWIuq+MVVIRqAhPqnsPAkgnJ0sGHPHQDjoP8tpmlt6BM5JOkJr6YSU51Op6QjCmWfdf1ZXGzvvS3xZeFj4co2eDVphG0cOgjE1XfMmRRHyJMFwbAMe73faI8oU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=HxsjMQP4; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="HxsjMQP4" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id BB1F1C8F1DE; Mon, 8 Sep 2025 08:27:23 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 420EA6061A; Mon, 8 Sep 2025 08:27:39 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 08E98102F2897; Mon, 8 Sep 2025 10:27:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1757320058; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=6ffU6EUZfBF4SIZFIFeAxQS2ganb6B9lq3MegA8FFVA=; b=HxsjMQP4pBFNlXI6uWrzS3BfvFG5G8vTB/KaCJ+5ctK1Et7ao+82lPOJiEdFAbfOIxEyRI Abd659F9FLZseRMQy2gwkmu7cNHZqID1ffTxfi9F4xwn5wreBi7NkzHOtGa9oPIGVdaDl/ ghHXMVcF7MO0Xg1alFLnu1KFuJoaQzCMcFbTwn7zzyGYcoBlut+D4xPKxaZgwoCUYd4kpD 6IH0ajJJrmopKpeYSd3NfZByzOvXh9BiMiiqjFZ94gW5U11yuqYGY2vAH8NZ1CMdL6OH2c hosINYbcOrEfrOGBOyOBK8XR5N2RGssI0p2KjROB7QhEt1Q5mlNWYRpl5NP0wg== Date: Mon, 8 Sep 2025 10:27:25 +0200 From: Kory Maincent To: "Russell King (Oracle)" Cc: Alexandra Winter , "David S. Miller" , Eric Dumazet , Jakub Kicinski , netdev@vger.kernel.org, Paolo Abeni , Shannon Nelson , Simon Horman Subject: Re: [PATCH net] net: ethtool: fix wrong type used in struct kernel_ethtool_ts_info Message-ID: <20250908102725.10b368e2@kmaincent-XPS-13-7390> In-Reply-To: References: Organization: bootlin X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 On Sun, 07 Sep 2025 21:43:20 +0100 "Russell King (Oracle)" 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. >=20 > 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. >=20 > Fix both of these to use u32, as per the corresponding __u32 UAPI type. Reviewed-by: Kory Maincent Thank you! --=20 K=C3=B6ry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com