2024-05-28 00:49:28

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build warning after merge of the vfs-brauner tree

Hi all,

After merging the vfs-brauner tree, today's linux-next build (arm
multi_v7_defconfig) produced this warning:

fs/xattr.c: In function '__do_sys_setxattrat':
fs/xattr.c:709:61: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
709 | return do_setxattrat(dfd, pathname, at_flags, name, (const void __user *)args.value,
| ^
fs/xattr.c: In function '__do_sys_getxattrat':
fs/xattr.c:855:61: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
855 | return do_getxattrat(dfd, pathname, at_flags, name, (void __user *)args.value, args.size);
| ^

Introduced by commit

89345b0ac5ac ("fs/xattr: add *at family syscalls")

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2024-05-28 03:31:25

by Stephen Rothwell

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the vfs-brauner tree

Hi all,

On Tue, 28 May 2024 10:49:05 +1000 Stephen Rothwell <[email protected]> wrote:
>
> After merging the vfs-brauner tree, today's linux-next build (arm
> multi_v7_defconfig) produced this warning:
>
> fs/xattr.c: In function '__do_sys_setxattrat':
> fs/xattr.c:709:61: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
> 709 | return do_setxattrat(dfd, pathname, at_flags, name, (const void __user *)args.value,
> | ^
> fs/xattr.c: In function '__do_sys_getxattrat':
> fs/xattr.c:855:61: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
> 855 | return do_getxattrat(dfd, pathname, at_flags, name, (void __user *)args.value, args.size);
> | ^
>
> Introduced by commit
>
> 89345b0ac5ac ("fs/xattr: add *at family syscalls")

This became a build failure in the i386 defconfig build, so I applied
the following fix patch.

From: Stephen Rothwell <[email protected]>
Date: Tue, 28 May 2024 13:20:29 +1000
Subject: [PATCH] fix up for "fs/xattr: add *at family syscalls"

Signed-off-by: Stephen Rothwell <[email protected]>
---
fs/xattr.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/xattr.c b/fs/xattr.c
index 8e712795ab80..d0d54ae2f9cb 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -706,7 +706,8 @@ SYSCALL_DEFINE6(setxattrat, int, dfd, const char __user *, pathname, unsigned in
if (error)
return error;

- return do_setxattrat(dfd, pathname, at_flags, name, (const void __user *)args.value,
+ return do_setxattrat(dfd, pathname, at_flags, name,
+ (const void __user *)(unsigned long)args.value,
args.size, args.flags);
}

@@ -852,7 +853,9 @@ SYSCALL_DEFINE6(getxattrat, int, dfd, const char __user *, pathname, unsigned in
if (args.flags != 0)
return -EINVAL;

- return do_getxattrat(dfd, pathname, at_flags, name, (void __user *)args.value, args.size);
+ return do_getxattrat(dfd, pathname, at_flags, name,
+ (void __user *)(unsigned long)args.value,
+ args.size);
}

SYSCALL_DEFINE4(getxattr, const char __user *, pathname,
--
2.43.0

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2024-05-28 12:31:36

by Christian Brauner

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the vfs-brauner tree

> This became a build failure in the i386 defconfig build, so I applied
> the following fix patch.

Fixed in-tree now. Thanks!

2024-05-28 12:40:14

by Arnd Bergmann

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the vfs-brauner tree

On Tue, May 28, 2024, at 05:31, Stephen Rothwell wrote:
> From: Stephen Rothwell <[email protected]>
> Date: Tue, 28 May 2024 13:20:29 +1000
> Subject: [PATCH] fix up for "fs/xattr: add *at family syscalls"
>
> Signed-off-by: Stephen Rothwell <[email protected]>
> ---
> fs/xattr.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/fs/xattr.c b/fs/xattr.c
> index 8e712795ab80..d0d54ae2f9cb 100644
> --- a/fs/xattr.c
> +++ b/fs/xattr.c
> @@ -706,7 +706,8 @@ SYSCALL_DEFINE6(setxattrat, int, dfd, const char
> __user *, pathname, unsigned in
> if (error)
> return error;
>
> - return do_setxattrat(dfd, pathname, at_flags, name, (const void
> __user *)args.value,
> + return do_setxattrat(dfd, pathname, at_flags, name,
> + (const void __user *)(unsigned long)args.value,
> args.size, args.flags);
> }
>

We have a u64_to_user_ptr() helper to make this slightly
more readable.

Arnd