tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

33_chromium_syscalls_6_8_update.patch (11404B)


      1 commit 142d1560cb5d65b66a4c0c6f427fa2f04150245f
      2 Author: Jed Davis <jld@mozilla.com>
      3 Date:   Wed Apr 17 13:52:26 2024 -0700
      4 
      5    Bug 1889045 - Update Linux sandbox syscall defs to v6.8
      6 
      7 diff --git a/sandbox/linux/system_headers/arm64_linux_syscalls.h b/sandbox/linux/system_headers/arm64_linux_syscalls.h
      8 --- a/sandbox/linux/system_headers/arm64_linux_syscalls.h
      9 +++ b/sandbox/linux/system_headers/arm64_linux_syscalls.h
     10 @@ -1,21 +1,32 @@
     11 // Copyright 2014 The Chromium Authors
     12 // Use of this source code is governed by a BSD-style license that can be
     13 // found in the LICENSE file.
     14 
     15 +/* Constructed by running:
     16 + * curl -vsSL https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/include/uapi/asm-generic/unistd.h?h=v6.8
     17 + *   | gcc -D__BITS_PER_LONG=64 -D__ARCH_WANT_STAT64 -D__ARCH_WANT_SET_GET_RLIMIT -D__ARCH_WANT_SYS_CLONE3 -D__ARCH_WANT_RENAMEAT -E -dD -
     18 + *   | grep __NR | grep -vE '__NR_arch_specific_syscall|__NR_syscalls' | sort -n -k 3 | sed -e 's/__NR3264/__NR/g'
     19 + *   | awk '{ if ($2 != $3) { print "#if !defined(" $2 ")\n#define " $2 " " $3 "\n#endif\n"; } }
     20 + * */
     21 +
     22 #ifndef SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
     23 #define SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
     24 
     25 #include <asm-generic/unistd.h>
     26 
     27 #if !defined(__NR_io_setup)
     28 #define __NR_io_setup 0
     29 #endif
     30 
     31 +#if !defined(__NR_newfstatat)
     32 +#define __NR_newfstatat __NR_fstatat
     33 +#endif
     34 +
     35 #if !defined(__NR_io_destroy)
     36 #define __NR_io_destroy 1
     37 #endif
     38 
     39 #if !defined(__NR_io_submit)
     40 #define __NR_io_submit 2
     41 #endif
     42 
     43 @@ -318,18 +329,18 @@
     44 #if !defined(__NR_tee)
     45 #define __NR_tee 77
     46 #endif
     47 
     48 #if !defined(__NR_readlinkat)
     49 #define __NR_readlinkat 78
     50 #endif
     51 
     52 -#if !defined(__NR_newfstatat)
     53 -#define __NR_newfstatat 79
     54 +#if !defined(__NR_fstatat)
     55 +#define __NR_fstatat 79
     56 #endif
     57 
     58 #if !defined(__NR_fstat)
     59 #define __NR_fstat 80
     60 #endif
     61 
     62 #if !defined(__NR_sync)
     63 #define __NR_sync 81
     64 @@ -1210,9 +1221,65 @@
     65 #if !defined(__NR_landlock_add_rule)
     66 #define __NR_landlock_add_rule 445
     67 #endif
     68 
     69 #if !defined(__NR_landlock_restrict_self)
     70 #define __NR_landlock_restrict_self 446
     71 #endif
     72 
     73 +#if !defined(__NR_process_mrelease)
     74 +#define __NR_process_mrelease 448
     75 +#endif
     76 +
     77 +#if !defined(__NR_futex_waitv)
     78 +#define __NR_futex_waitv 449
     79 +#endif
     80 +
     81 +#if !defined(__NR_set_mempolicy_home_node)
     82 +#define __NR_set_mempolicy_home_node 450
     83 +#endif
     84 +
     85 +#if !defined(__NR_cachestat)
     86 +#define __NR_cachestat 451
     87 +#endif
     88 +
     89 +#if !defined(__NR_fchmodat2)
     90 +#define __NR_fchmodat2 452
     91 +#endif
     92 +
     93 +#if !defined(__NR_map_shadow_stack)
     94 +#define __NR_map_shadow_stack 453
     95 +#endif
     96 +
     97 +#if !defined(__NR_futex_wake)
     98 +#define __NR_futex_wake 454
     99 +#endif
    100 +
    101 +#if !defined(__NR_futex_wait)
    102 +#define __NR_futex_wait 455
    103 +#endif
    104 +
    105 +#if !defined(__NR_futex_requeue)
    106 +#define __NR_futex_requeue 456
    107 +#endif
    108 +
    109 +#if !defined(__NR_statmount)
    110 +#define __NR_statmount 457
    111 +#endif
    112 +
    113 +#if !defined(__NR_listmount)
    114 +#define __NR_listmount 458
    115 +#endif
    116 +
    117 +#if !defined(__NR_lsm_get_self_attr)
    118 +#define __NR_lsm_get_self_attr 459
    119 +#endif
    120 +
    121 +#if !defined(__NR_lsm_set_self_attr)
    122 +#define __NR_lsm_set_self_attr 460
    123 +#endif
    124 +
    125 +#if !defined(__NR_lsm_list_modules)
    126 +#define __NR_lsm_list_modules 461
    127 +#endif
    128 +
    129 #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_ARM64_LINUX_SYSCALLS_H_
    130 diff --git a/sandbox/linux/system_headers/arm_linux_syscalls.h b/sandbox/linux/system_headers/arm_linux_syscalls.h
    131 --- a/sandbox/linux/system_headers/arm_linux_syscalls.h
    132 +++ b/sandbox/linux/system_headers/arm_linux_syscalls.h
    133 @@ -1,13 +1,18 @@
    134 // Copyright 2012 The Chromium Authors
    135 // Use of this source code is governed by a BSD-style license that can be
    136 // found in the LICENSE file.
    137 
    138 -// Generated from the Linux kernel's calls.S.
    139 +/* Constructed by running:
    140 + * curl -vsSL https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/arch/arm/tools/syscall.tbl?h=v6.8
    141 + *   | grep -vE '^#|^$'
    142 + *   | awk '{ if ($2 != "oabi") { print "#if !defined(__NR_" $3 ")\n#define __NR_" $3 " (__NR_SYSCALL_BASE+" $1 ")\n#endif\n"; } }'
    143 + * */
    144 +
    145 #ifndef SANDBOX_LINUX_SYSTEM_HEADERS_ARM_LINUX_SYSCALLS_H_
    146 #define SANDBOX_LINUX_SYSTEM_HEADERS_ARM_LINUX_SYSCALLS_H_
    147 
    148 #if !defined(__arm__) || !defined(__ARM_EABI__)
    149 #error "Including header on wrong architecture"
    150 #endif
    151 
    152 #if !defined(__NR_SYSCALL_BASE)
    153 @@ -1200,20 +1205,16 @@
    154 #if !defined(__NR_splice)
    155 #define __NR_splice (__NR_SYSCALL_BASE+340)
    156 #endif
    157 
    158 #if !defined(__NR_arm_sync_file_range)
    159 #define __NR_arm_sync_file_range (__NR_SYSCALL_BASE+341)
    160 #endif
    161 
    162 -#if !defined(__NR_sync_file_range2)
    163 -#define __NR_sync_file_range2 (__NR_SYSCALL_BASE+341)
    164 -#endif
    165 -
    166 #if !defined(__NR_tee)
    167 #define __NR_tee (__NR_SYSCALL_BASE+342)
    168 #endif
    169 
    170 #if !defined(__NR_vmsplice)
    171 #define __NR_vmsplice (__NR_SYSCALL_BASE+343)
    172 #endif
    173 
    174 @@ -1612,16 +1613,72 @@
    175 #if !defined(__NR_landlock_add_rule)
    176 #define __NR_landlock_add_rule (__NR_SYSCALL_BASE + 445)
    177 #endif
    178 
    179 #if !defined(__NR_landlock_restrict_self)
    180 #define __NR_landlock_restrict_self (__NR_SYSCALL_BASE + 446)
    181 #endif
    182 
    183 +#if !defined(__NR_process_mrelease)
    184 +#define __NR_process_mrelease (__NR_SYSCALL_BASE+448)
    185 +#endif
    186 +
    187 +#if !defined(__NR_futex_waitv)
    188 +#define __NR_futex_waitv (__NR_SYSCALL_BASE+449)
    189 +#endif
    190 +
    191 +#if !defined(__NR_set_mempolicy_home_node)
    192 +#define __NR_set_mempolicy_home_node (__NR_SYSCALL_BASE+450)
    193 +#endif
    194 +
    195 +#if !defined(__NR_cachestat)
    196 +#define __NR_cachestat (__NR_SYSCALL_BASE+451)
    197 +#endif
    198 +
    199 +#if !defined(__NR_fchmodat2)
    200 +#define __NR_fchmodat2 (__NR_SYSCALL_BASE+452)
    201 +#endif
    202 +
    203 +#if !defined(__NR_map_shadow_stack)
    204 +#define __NR_map_shadow_stack (__NR_SYSCALL_BASE+453)
    205 +#endif
    206 +
    207 +#if !defined(__NR_futex_wake)
    208 +#define __NR_futex_wake (__NR_SYSCALL_BASE+454)
    209 +#endif
    210 +
    211 +#if !defined(__NR_futex_wait)
    212 +#define __NR_futex_wait (__NR_SYSCALL_BASE+455)
    213 +#endif
    214 +
    215 +#if !defined(__NR_futex_requeue)
    216 +#define __NR_futex_requeue (__NR_SYSCALL_BASE+456)
    217 +#endif
    218 +
    219 +#if !defined(__NR_statmount)
    220 +#define __NR_statmount (__NR_SYSCALL_BASE+457)
    221 +#endif
    222 +
    223 +#if !defined(__NR_listmount)
    224 +#define __NR_listmount (__NR_SYSCALL_BASE+458)
    225 +#endif
    226 +
    227 +#if !defined(__NR_lsm_get_self_attr)
    228 +#define __NR_lsm_get_self_attr (__NR_SYSCALL_BASE+459)
    229 +#endif
    230 +
    231 +#if !defined(__NR_lsm_set_self_attr)
    232 +#define __NR_lsm_set_self_attr (__NR_SYSCALL_BASE+460)
    233 +#endif
    234 +
    235 +#if !defined(__NR_lsm_list_modules)
    236 +#define __NR_lsm_list_modules (__NR_SYSCALL_BASE+461)
    237 +#endif
    238 +
    239 // ARM private syscalls.
    240 #if !defined(__ARM_NR_BASE)
    241 #define __ARM_NR_BASE (__NR_SYSCALL_BASE + 0xF0000)
    242 #endif
    243 
    244 #if !defined(__ARM_NR_breakpoint)
    245 #define __ARM_NR_breakpoint (__ARM_NR_BASE+1)
    246 #endif
    247 diff --git a/sandbox/linux/system_headers/x86_32_linux_syscalls.h b/sandbox/linux/system_headers/x86_32_linux_syscalls.h
    248 --- a/sandbox/linux/system_headers/x86_32_linux_syscalls.h
    249 +++ b/sandbox/linux/system_headers/x86_32_linux_syscalls.h
    250 @@ -1,13 +1,18 @@
    251 // Copyright 2012 The Chromium Authors
    252 // Use of this source code is governed by a BSD-style license that can be
    253 // found in the LICENSE file.
    254 
    255 -// Generated from the Linux kernel's syscall_32.tbl.
    256 +/* Constructed by running:
    257 + * curl -vsSL https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/arch/x86/entry/syscalls/syscall_32.tbl?h=v6.8
    258 + *   | grep -vE '^#|^$'
    259 + *   | awk '{ if ($2 == "i386") { print "#if !defined(__NR_" $3 ")\n#define __NR_" $3 " " $1 "\n#endif\n"; } }'
    260 + * */
    261 +
    262 #ifndef SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
    263 #define SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
    264 
    265 #if !defined(__i386__)
    266 #error "Including header on wrong architecture"
    267 #endif
    268 
    269 #if !defined(__NR_restart_syscall)
    270 @@ -1745,10 +1750,69 @@
    271 #if !defined(__NR_landlock_add_rule)
    272 #define __NR_landlock_add_rule 445
    273 #endif
    274 
    275 #if !defined(__NR_landlock_restrict_self)
    276 #define __NR_landlock_restrict_self 446
    277 #endif
    278 
    279 +#if !defined(__NR_memfd_secret)
    280 +#define __NR_memfd_secret 447
    281 +#endif
    282 +
    283 +#if !defined(__NR_process_mrelease)
    284 +#define __NR_process_mrelease 448
    285 +#endif
    286 +
    287 +#if !defined(__NR_futex_waitv)
    288 +#define __NR_futex_waitv 449
    289 +#endif
    290 +
    291 +#if !defined(__NR_set_mempolicy_home_node)
    292 +#define __NR_set_mempolicy_home_node 450
    293 +#endif
    294 +
    295 +#if !defined(__NR_cachestat)
    296 +#define __NR_cachestat 451
    297 +#endif
    298 +
    299 +#if !defined(__NR_fchmodat2)
    300 +#define __NR_fchmodat2 452
    301 +#endif
    302 +
    303 +#if !defined(__NR_map_shadow_stack)
    304 +#define __NR_map_shadow_stack 453
    305 +#endif
    306 +
    307 +#if !defined(__NR_futex_wake)
    308 +#define __NR_futex_wake 454
    309 +#endif
    310 +
    311 +#if !defined(__NR_futex_wait)
    312 +#define __NR_futex_wait 455
    313 +#endif
    314 +
    315 +#if !defined(__NR_futex_requeue)
    316 +#define __NR_futex_requeue 456
    317 +#endif
    318 +
    319 +#if !defined(__NR_statmount)
    320 +#define __NR_statmount 457
    321 +#endif
    322 +
    323 +#if !defined(__NR_listmount)
    324 +#define __NR_listmount 458
    325 +#endif
    326 +
    327 +#if !defined(__NR_lsm_get_self_attr)
    328 +#define __NR_lsm_get_self_attr 459
    329 +#endif
    330 +
    331 +#if !defined(__NR_lsm_set_self_attr)
    332 +#define __NR_lsm_set_self_attr 460
    333 +#endif
    334 +
    335 +#if !defined(__NR_lsm_list_modules)
    336 +#define __NR_lsm_list_modules 461
    337 +#endif
    338 +
    339 #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_32_LINUX_SYSCALLS_H_
    340 -
    341 diff --git a/sandbox/linux/system_headers/x86_64_linux_syscalls.h b/sandbox/linux/system_headers/x86_64_linux_syscalls.h
    342 --- a/sandbox/linux/system_headers/x86_64_linux_syscalls.h
    343 +++ b/sandbox/linux/system_headers/x86_64_linux_syscalls.h
    344 @@ -1,13 +1,18 @@
    345 // Copyright 2012 The Chromium Authors
    346 // Use of this source code is governed by a BSD-style license that can be
    347 // found in the LICENSE file.
    348 
    349 -// Generated from the Linux kernel's syscall_64.tbl.
    350 +/* Constructed by running:
    351 + * curl -vsSL https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/plain/arch/x86/entry/syscalls/syscall_64.tbl?h=v6.8
    352 + *   | grep -vE '^#|^$'
    353 + *   | awk '{ if ($2 != "x32") { print "#if !defined(__NR_" $3 ")\n#define __NR_" $3 " " $1 "\n#endif\n"; } }'
    354 + * */
    355 +
    356 #ifndef SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
    357 #define SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
    358 
    359 #if !defined(__x86_64__)
    360 #error "Including header on wrong architecture"
    361 #endif
    362 
    363 #if !defined(__NR_read)
    364 @@ -1433,10 +1438,69 @@
    365 #if !defined(__NR_landlock_add_rule)
    366 #define __NR_landlock_add_rule 445
    367 #endif
    368 
    369 #if !defined(__NR_landlock_restrict_self)
    370 #define __NR_landlock_restrict_self 446
    371 #endif
    372 
    373 +#if !defined(__NR_memfd_secret)
    374 +#define __NR_memfd_secret 447
    375 +#endif
    376 +
    377 +#if !defined(__NR_process_mrelease)
    378 +#define __NR_process_mrelease 448
    379 +#endif
    380 +
    381 +#if !defined(__NR_futex_waitv)
    382 +#define __NR_futex_waitv 449
    383 +#endif
    384 +
    385 +#if !defined(__NR_set_mempolicy_home_node)
    386 +#define __NR_set_mempolicy_home_node 450
    387 +#endif
    388 +
    389 +#if !defined(__NR_cachestat)
    390 +#define __NR_cachestat 451
    391 +#endif
    392 +
    393 +#if !defined(__NR_fchmodat2)
    394 +#define __NR_fchmodat2 452
    395 +#endif
    396 +
    397 +#if !defined(__NR_map_shadow_stack)
    398 +#define __NR_map_shadow_stack 453
    399 +#endif
    400 +
    401 +#if !defined(__NR_futex_wake)
    402 +#define __NR_futex_wake 454
    403 +#endif
    404 +
    405 +#if !defined(__NR_futex_wait)
    406 +#define __NR_futex_wait 455
    407 +#endif
    408 +
    409 +#if !defined(__NR_futex_requeue)
    410 +#define __NR_futex_requeue 456
    411 +#endif
    412 +
    413 +#if !defined(__NR_statmount)
    414 +#define __NR_statmount 457
    415 +#endif
    416 +
    417 +#if !defined(__NR_listmount)
    418 +#define __NR_listmount 458
    419 +#endif
    420 +
    421 +#if !defined(__NR_lsm_get_self_attr)
    422 +#define __NR_lsm_get_self_attr 459
    423 +#endif
    424 +
    425 +#if !defined(__NR_lsm_set_self_attr)
    426 +#define __NR_lsm_set_self_attr 460
    427 +#endif
    428 +
    429 +#if !defined(__NR_lsm_list_modules)
    430 +#define __NR_lsm_list_modules 461
    431 +#endif
    432 +
    433 #endif  // SANDBOX_LINUX_SYSTEM_HEADERS_X86_64_LINUX_SYSCALLS_H_
    434 -