All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] syscalls: fix offset type of ksys_ftruncate
@ 2020-06-10 11:48 Jiri Slaby
  2020-06-10 12:32 ` Brian Gerst
  2020-06-15  9:21 ` [tip: x86/urgent] syscalls: Fix offset type of ksys_ftruncate() tip-bot2 for Jiri Slaby
  0 siblings, 2 replies; 3+ messages in thread
From: Jiri Slaby @ 2020-06-10 11:48 UTC (permalink / raw)
  To: tglx; +Cc: x86, linux-kernel, Jiri Slaby, Brian Gerst, Dominik Brodowski

After the commit below, truncate on i586 uses ksys_ftruncate. But
ksys_ftruncate truncates the offset to unsigned long. So switch the type
of offset to loff_t which is what the lower do_sys_ftruncate expects.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Fixes: 121b32a58a3a (x86/entry/32: Use IA32-specific wrappers for syscalls taking 64-bit arguments)
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
---
 include/linux/syscalls.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 63ffa6dc9da3..e97ca179d0dc 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -1370,7 +1370,7 @@ static inline long ksys_lchown(const char __user *filename, uid_t user,
 
 extern long do_sys_ftruncate(unsigned int fd, loff_t length, int small);
 
-static inline long ksys_ftruncate(unsigned int fd, unsigned long length)
+static inline long ksys_ftruncate(unsigned int fd, loff_t length)
 {
 	return do_sys_ftruncate(fd, length, 1);
 }
-- 
2.27.0


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

* Re: [PATCH] syscalls: fix offset type of ksys_ftruncate
  2020-06-10 11:48 [PATCH] syscalls: fix offset type of ksys_ftruncate Jiri Slaby
@ 2020-06-10 12:32 ` Brian Gerst
  2020-06-15  9:21 ` [tip: x86/urgent] syscalls: Fix offset type of ksys_ftruncate() tip-bot2 for Jiri Slaby
  1 sibling, 0 replies; 3+ messages in thread
From: Brian Gerst @ 2020-06-10 12:32 UTC (permalink / raw)
  To: Jiri Slaby
  Cc: Thomas Gleixner, the arch/x86 maintainers,
	Linux Kernel Mailing List, Dominik Brodowski

On Wed, Jun 10, 2020 at 7:48 AM Jiri Slaby <jslaby@suse.cz> wrote:
>
> After the commit below, truncate on i586 uses ksys_ftruncate. But
> ksys_ftruncate truncates the offset to unsigned long. So switch the type
> of offset to loff_t which is what the lower do_sys_ftruncate expects.
>
> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> Fixes: 121b32a58a3a (x86/entry/32: Use IA32-specific wrappers for syscalls taking 64-bit arguments)
> Cc: Brian Gerst <brgerst@gmail.com>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Dominik Brodowski <linux@dominikbrodowski.net>
> ---
>  include/linux/syscalls.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
> index 63ffa6dc9da3..e97ca179d0dc 100644
> --- a/include/linux/syscalls.h
> +++ b/include/linux/syscalls.h
> @@ -1370,7 +1370,7 @@ static inline long ksys_lchown(const char __user *filename, uid_t user,
>
>  extern long do_sys_ftruncate(unsigned int fd, loff_t length, int small);
>
> -static inline long ksys_ftruncate(unsigned int fd, unsigned long length)
> +static inline long ksys_ftruncate(unsigned int fd, loff_t length)
>  {
>         return do_sys_ftruncate(fd, length, 1);
>  }

Reviewed-by: Brian Gerst <brgerst@gmail.com>

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

* [tip: x86/urgent] syscalls: Fix offset type of ksys_ftruncate()
  2020-06-10 11:48 [PATCH] syscalls: fix offset type of ksys_ftruncate Jiri Slaby
  2020-06-10 12:32 ` Brian Gerst
@ 2020-06-15  9:21 ` tip-bot2 for Jiri Slaby
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Jiri Slaby @ 2020-06-15  9:21 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Jiri Slaby, Thomas Gleixner, Brian Gerst, stable, x86, LKML

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     8e742aa79780b13cd300a42198c1a4cea9c89905
Gitweb:        https://git.kernel.org/tip/8e742aa79780b13cd300a42198c1a4cea9c89905
Author:        Jiri Slaby <jslaby@suse.cz>
AuthorDate:    Wed, 10 Jun 2020 13:48:51 +02:00
Committer:     Thomas Gleixner <tglx@linutronix.de>
CommitterDate: Mon, 15 Jun 2020 11:16:27 +02:00

syscalls: Fix offset type of ksys_ftruncate()

After the commit below, truncate() on x86 32bit uses ksys_ftruncate(). But
ksys_ftruncate() truncates the offset to unsigned long.

Switch the type of offset to loff_t which is what do_sys_ftruncate()
expects.

Fixes: 121b32a58a3a (x86/entry/32: Use IA32-specific wrappers for syscalls taking 64-bit arguments)
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Brian Gerst <brgerst@gmail.com>
Cc: stable@vger.kernel.org
Link: https://lkml.kernel.org/r/20200610114851.28549-1-jslaby@suse.cz
---
 include/linux/syscalls.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 7c354c2..b951a87 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -1360,7 +1360,7 @@ static inline long ksys_lchown(const char __user *filename, uid_t user,
 
 extern long do_sys_ftruncate(unsigned int fd, loff_t length, int small);
 
-static inline long ksys_ftruncate(unsigned int fd, unsigned long length)
+static inline long ksys_ftruncate(unsigned int fd, loff_t length)
 {
 	return do_sys_ftruncate(fd, length, 1);
 }

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

end of thread, other threads:[~2020-06-15  9:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-10 11:48 [PATCH] syscalls: fix offset type of ksys_ftruncate Jiri Slaby
2020-06-10 12:32 ` Brian Gerst
2020-06-15  9:21 ` [tip: x86/urgent] syscalls: Fix offset type of ksys_ftruncate() tip-bot2 for Jiri Slaby

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.