diff options
| author | Christian Brauner <brauner@kernel.org> | 2026-03-23 14:41:19 +0300 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-03-23 14:41:58 +0300 |
| commit | e247fd37e597b3536d26cfa5fcc558832586f57c (patch) | |
| tree | 425259dd28393a196c0520d6f8750ba61c074182 /include | |
| parent | 3d6bb84f6bb3f4c05fc47fd02ce75ce3032a4ce1 (diff) | |
| parent | e8767a3134ca69a307b37f7f58ca088dbee6eb82 (diff) | |
| download | linux-e247fd37e597b3536d26cfa5fcc558832586f57c.tar.xz | |
Merge patch series "fix architecture-specific compat_ftruncate64 implementations"
Christoph Hellwig <hch@lst.de> says:
This series fixes a really old bug found by code inspection, where the
architecture-specific 32-bit compat ftruncate64 implementations enforce
the non-LFS file size limit unless opened with O_LARGEFILE.
* patches from https://patch.msgid.link/20260323070205.2939118-1-hch@lst.de:
fs: remove do_sys_truncate
fs: pass on FTRUNCATE_* flags to do_truncate
fs: fix archiecture-specific compat_ftruncate64
Link: https://patch.msgid.link/20260323070205.2939118-1-hch@lst.de
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/syscalls.h | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 02bd6ddb6278..f5639d5ac331 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -1283,19 +1283,9 @@ static inline long ksys_lchown(const char __user *filename, uid_t user, AT_SYMLINK_NOFOLLOW); } -int do_sys_ftruncate(unsigned int fd, loff_t length, int small); - -static inline long ksys_ftruncate(unsigned int fd, loff_t length) -{ - return do_sys_ftruncate(fd, length, 1); -} - -int do_sys_truncate(const char __user *pathname, loff_t length); - -static inline long ksys_truncate(const char __user *pathname, loff_t length) -{ - return do_sys_truncate(pathname, length); -} +#define FTRUNCATE_LFS (1u << 0) /* allow truncating > 32-bit */ +int ksys_ftruncate(unsigned int fd, loff_t length, unsigned int flags); +int ksys_truncate(const char __user *pathname, loff_t length); static inline unsigned int ksys_personality(unsigned int personality) { |
