mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] alloc_tag: avoid implicit padding in uapi
@ 2026-09-15 20:23 Arnd Bergmann
  2026-09-15 21:37 ` Suren Baghdasaryan
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Arnd Bergmann @ 2026-09-15 20:23 UTC (permalink / raw)
  To: Suren Baghdasaryan, Andrew Morton, Hao Ge, Abhishek Bapat
  Cc: Arnd Bergmann, linux-mm, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

The impliied padding causes a harmless warning when testing the uapi
headers with -Wpadded that could in theory indicate incompatibilies or
data leaks:

./usr/include/linux/alloc_tag.h:41:1: error: padding struct size to alignment boundary with 7 bytes [-Werror=padded]

The code here is fine, but it's better to make the padding explicit
and avoid the warning here.

Fixes: 1d581ab2348c ("alloc_tag: add ioctl to /proc/allocinfo")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 include/uapi/linux/alloc_tag.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/include/uapi/linux/alloc_tag.h b/include/uapi/linux/alloc_tag.h
index e3ad94444864..7d4618bea043 100644
--- a/include/uapi/linux/alloc_tag.h
+++ b/include/uapi/linux/alloc_tag.h
@@ -38,6 +38,7 @@ struct allocinfo_counter {
 	__u64 bytes;
 	__u64 calls;
 	__u8 accurate;
+	__u8 pad[7];
 } __attribute__((aligned(8)));
 
 struct allocinfo_tag_data {
-- 
2.53.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] alloc_tag: avoid implicit padding in uapi
  2026-09-15 20:23 [PATCH] alloc_tag: avoid implicit padding in uapi Arnd Bergmann
@ 2026-09-15 21:37 ` Suren Baghdasaryan
  2026-09-16  1:08 ` SJ Park
  2026-09-16  6:23 ` Hao Ge
  2 siblings, 0 replies; 4+ messages in thread
From: Suren Baghdasaryan @ 2026-09-15 21:37 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Andrew Morton, Hao Ge, Abhishek Bapat, Arnd Bergmann, linux-mm,
	linux-kernel

On Tue, Sep 15, 2026 at 1:24 PM Arnd Bergmann <arnd@kernel.org> wrote:
>
> From: Arnd Bergmann <arnd@arndb.de>
>
> The impliied padding causes a harmless warning when testing the uapi
> headers with -Wpadded that could in theory indicate incompatibilies or
> data leaks:
>
> ./usr/include/linux/alloc_tag.h:41:1: error: padding struct size to alignment boundary with 7 bytes [-Werror=padded]
>
> The code here is fine, but it's better to make the padding explicit
> and avoid the warning here.
>
> Fixes: 1d581ab2348c ("alloc_tag: add ioctl to /proc/allocinfo")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: Suren Baghdasaryan <surenb@google.com>

Thanks!

> ---
>  include/uapi/linux/alloc_tag.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/include/uapi/linux/alloc_tag.h b/include/uapi/linux/alloc_tag.h
> index e3ad94444864..7d4618bea043 100644
> --- a/include/uapi/linux/alloc_tag.h
> +++ b/include/uapi/linux/alloc_tag.h
> @@ -38,6 +38,7 @@ struct allocinfo_counter {
>         __u64 bytes;
>         __u64 calls;
>         __u8 accurate;
> +       __u8 pad[7];
>  } __attribute__((aligned(8)));
>
>  struct allocinfo_tag_data {
> --
> 2.53.0
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] alloc_tag: avoid implicit padding in uapi
  2026-09-15 20:23 [PATCH] alloc_tag: avoid implicit padding in uapi Arnd Bergmann
  2026-09-15 21:37 ` Suren Baghdasaryan
@ 2026-09-16  1:08 ` SJ Park
  2026-09-16  6:23 ` Hao Ge
  2 siblings, 0 replies; 4+ messages in thread
From: SJ Park @ 2026-09-16  1:08 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: SJ Park, Suren Baghdasaryan, Andrew Morton, Hao Ge,
	Abhishek Bapat, Arnd Bergmann, linux-mm, linux-kernel

On Tue, 15 Sep 2026 22:23:47 +0200 Arnd Bergmann <arnd@kernel.org> wrote:

> From: Arnd Bergmann <arnd@arndb.de>
> 
> The impliied padding causes a harmless warning when testing the uapi

s/impliied/implied/

> headers with -Wpadded that could in theory indicate incompatibilies or

s/incompatibilies/incompatibilities/

> data leaks:
> 
> ./usr/include/linux/alloc_tag.h:41:1: error: padding struct size to alignment boundary with 7 bytes [-Werror=padded]
> 
> The code here is fine, but it's better to make the padding explicit
> and avoid the warning here.

Typos are trivial and the change makes sense to me.

> 
> Fixes: 1d581ab2348c ("alloc_tag: add ioctl to /proc/allocinfo")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Acked-by: SJ Park <sj@kernel.org>


Thanks,
SJ

[...]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] alloc_tag: avoid implicit padding in uapi
  2026-09-15 20:23 [PATCH] alloc_tag: avoid implicit padding in uapi Arnd Bergmann
  2026-09-15 21:37 ` Suren Baghdasaryan
  2026-09-16  1:08 ` SJ Park
@ 2026-09-16  6:23 ` Hao Ge
  2 siblings, 0 replies; 4+ messages in thread
From: Hao Ge @ 2026-09-16  6:23 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Arnd Bergmann, linux-mm, linux-kernel, Abhishek Bapat,
	Suren Baghdasaryan, Andrew Morton



On 2026/9/16 04:23, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> 
> The impliied padding causes a harmless warning when testing the uapi
> headers with -Wpadded that could in theory indicate incompatibilies or
> data leaks:
> 
> ./usr/include/linux/alloc_tag.h:41:1: error: padding struct size to alignment boundary with 7 bytes [-Werror=padded]
> 
> The code here is fine, but it's better to make the padding explicit
> and avoid the warning here.
> 
> Fixes: 1d581ab2348c ("alloc_tag: add ioctl to /proc/allocinfo")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Thanks for the fix, with the nit from SJ.
Acked-by: Hao Ge <hao.ge@linux.dev>

Thanks
Best Regards
Hao

> ---
>  include/uapi/linux/alloc_tag.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/uapi/linux/alloc_tag.h b/include/uapi/linux/alloc_tag.h
> index e3ad94444864..7d4618bea043 100644
> --- a/include/uapi/linux/alloc_tag.h
> +++ b/include/uapi/linux/alloc_tag.h
> @@ -38,6 +38,7 @@ struct allocinfo_counter {
>  	__u64 bytes;
>  	__u64 calls;
>  	__u8 accurate;
> +	__u8 pad[7];
>  } __attribute__((aligned(8)));
>  
>  struct allocinfo_tag_data {

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-09-16  6:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-15 20:23 [PATCH] alloc_tag: avoid implicit padding in uapi Arnd Bergmann
2026-09-15 21:37 ` Suren Baghdasaryan
2026-09-16  1:08 ` SJ Park
2026-09-16  6:23 ` Hao Ge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®