]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
nptl: Fix SYSCALL_CANCEL for return values larger than INT_MAX (BZ 33245) release/2.42/master
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 1 Aug 2025 18:00:25 +0000 (15:00 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 1 Aug 2025 20:44:39 +0000 (17:44 -0300)
The SYSCALL_CANCEL calls __syscall_cancel, which in turn
calls __internal_syscall_cancel with an 'int' return instead of the
expected 'long int'.  This causes issues with syscalls that return
values larger than INT_MAX, such as copy_file_range [1].

Checked on x86_64-linux-gnu.

[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=79139

Reviewed-by: Andreas K. Huettel <dilfridge@gentoo.org>
(cherry picked from commit 7107bebf19286f42dcb0a97581137a5893c16206)

NEWS
nptl/cancellation.c

diff --git a/NEWS b/NEWS
index cbe11ac95bceaf4b6521c2217543e2acdf535fd0..1d04bdfef85f5e5eda11d7c4a4b25910535b7cf1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,7 @@ The following bugs were resolved with this release:
 
   [31943] _dl_find_object can fail if ld.so contains gaps between load segments
   [32994] stdlib: resolve a double lock init issue after fork
+  [33245] nptl: nptl: error in internal cancellation syscall handling
 \f
 Version 2.42
 
index 156e63dcf0dc9d9c858deb15c5aca4f00c7c190a..bed0383a23f0ac1d587ff4296c0bdd3db5d568a8 100644 (file)
@@ -72,8 +72,8 @@ __syscall_cancel (__syscall_arg_t a1, __syscall_arg_t a2,
                  __syscall_arg_t a5, __syscall_arg_t a6,
                  __SYSCALL_CANCEL7_ARG_DEF __syscall_arg_t nr)
 {
-  int r = __internal_syscall_cancel (a1, a2, a3, a4, a5, a6,
-                                    __SYSCALL_CANCEL7_ARG nr);
+  long int r = __internal_syscall_cancel (a1, a2, a3, a4, a5, a6,
+                                         __SYSCALL_CANCEL7_ARG nr);
   return __glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (r))
         ? SYSCALL_ERROR_LABEL (INTERNAL_SYSCALL_ERRNO (r))
         : r;