Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'x86-core-2023-02-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 core updates from Ingo Molnar:

- Clean up the signal frame layout tests

- Suppress KMSAN false positive reports in arch_within_stack_frames()

* tag 'x86-core-2023-02-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86: Suppress KMSAN reports in arch_within_stack_frames()
x86/signal/compat: Move sigaction_compat_abi() to signal_64.c
x86/signal: Move siginfo field tests

+259 -192
+5
arch/x86/include/asm/thread_info.h
··· 163 163 * GOOD_FRAME if within a frame 164 164 * BAD_STACK if placed across a frame boundary (or outside stack) 165 165 * NOT_STACK unable to determine (no frame pointers, etc) 166 + * 167 + * This function reads pointers from the stack and dereferences them. The 168 + * pointers may not have their KMSAN shadow set up properly, which may result 169 + * in false positive reports. Disable instrumentation to avoid those. 166 170 */ 171 + __no_kmsan_checks 167 172 static inline int arch_within_stack_frames(const void * const stack, 168 173 const void * const stackend, 169 174 const void *obj, unsigned long len)
-1
arch/x86/kernel/Makefile
··· 45 45 obj-y += ebda.o 46 46 obj-y += platform-quirks.o 47 47 obj-y += process_$(BITS).o signal.o signal_$(BITS).o 48 - obj-$(CONFIG_COMPAT) += signal_compat.o 49 48 obj-y += traps.o idt.o irq.o irq_$(BITS).o dumpstack_$(BITS).o 50 49 obj-y += time.o ioport.o dumpstack.o nmi.o 51 50 obj-$(CONFIG_MODIFY_LDT_SYSCALL) += ldt.o
+127
arch/x86/kernel/signal_32.c
··· 54 54 } 55 55 56 56 #define sigset32_t compat_sigset_t 57 + #define siginfo32_t compat_siginfo_t 57 58 #define restore_altstack32 compat_restore_altstack 58 59 #define unsafe_save_altstack32 unsafe_compat_save_altstack 59 60 60 61 #else 61 62 62 63 #define sigset32_t sigset_t 64 + #define siginfo32_t siginfo_t 63 65 #define __NR_ia32_sigreturn __NR_sigreturn 64 66 #define __NR_ia32_rt_sigreturn __NR_rt_sigreturn 65 67 #define restore_altstack32 restore_altstack ··· 379 377 user_access_end(); 380 378 return -EFAULT; 381 379 } 380 + 381 + /* 382 + * The siginfo_t structure and handing code is very easy 383 + * to break in several ways. It must always be updated when new 384 + * updates are made to the main siginfo_t, and 385 + * copy_siginfo_to_user32() must be updated when the 386 + * (arch-independent) copy_siginfo_to_user() is updated. 387 + * 388 + * It is also easy to put a new member in the siginfo_t 389 + * which has implicit alignment which can move internal structure 390 + * alignment around breaking the ABI. This can happen if you, 391 + * for instance, put a plain 64-bit value in there. 392 + */ 393 + 394 + /* 395 + * If adding a new si_code, there is probably new data in 396 + * the siginfo. Make sure folks bumping the si_code 397 + * limits also have to look at this code. Make sure any 398 + * new fields are handled in copy_siginfo_to_user32()! 399 + */ 400 + static_assert(NSIGILL == 11); 401 + static_assert(NSIGFPE == 15); 402 + static_assert(NSIGSEGV == 9); 403 + static_assert(NSIGBUS == 5); 404 + static_assert(NSIGTRAP == 6); 405 + static_assert(NSIGCHLD == 6); 406 + static_assert(NSIGSYS == 2); 407 + 408 + /* This is part of the ABI and can never change in size: */ 409 + static_assert(sizeof(siginfo32_t) == 128); 410 + 411 + /* This is a part of the ABI and can never change in alignment */ 412 + static_assert(__alignof__(siginfo32_t) == 4); 413 + 414 + /* 415 + * The offsets of all the (unioned) si_fields are fixed 416 + * in the ABI, of course. Make sure none of them ever 417 + * move and are always at the beginning: 418 + */ 419 + static_assert(offsetof(siginfo32_t, _sifields) == 3 * sizeof(int)); 420 + 421 + static_assert(offsetof(siginfo32_t, si_signo) == 0); 422 + static_assert(offsetof(siginfo32_t, si_errno) == 4); 423 + static_assert(offsetof(siginfo32_t, si_code) == 8); 424 + 425 + /* 426 + * Ensure that the size of each si_field never changes. 427 + * If it does, it is a sign that the 428 + * copy_siginfo_to_user32() code below needs to updated 429 + * along with the size in the CHECK_SI_SIZE(). 430 + * 431 + * We repeat this check for both the generic and compat 432 + * siginfos. 433 + * 434 + * Note: it is OK for these to grow as long as the whole 435 + * structure stays within the padding size (checked 436 + * above). 437 + */ 438 + 439 + #define CHECK_SI_OFFSET(name) \ 440 + static_assert(offsetof(siginfo32_t, _sifields) == \ 441 + offsetof(siginfo32_t, _sifields.name)) 442 + 443 + #define CHECK_SI_SIZE(name, size) \ 444 + static_assert(sizeof_field(siginfo32_t, _sifields.name) == size) 445 + 446 + CHECK_SI_OFFSET(_kill); 447 + CHECK_SI_SIZE (_kill, 2*sizeof(int)); 448 + static_assert(offsetof(siginfo32_t, si_pid) == 0xC); 449 + static_assert(offsetof(siginfo32_t, si_uid) == 0x10); 450 + 451 + CHECK_SI_OFFSET(_timer); 452 + #ifdef CONFIG_COMPAT 453 + /* compat_siginfo_t doesn't have si_sys_private */ 454 + CHECK_SI_SIZE (_timer, 3*sizeof(int)); 455 + #else 456 + CHECK_SI_SIZE (_timer, 4*sizeof(int)); 457 + #endif 458 + static_assert(offsetof(siginfo32_t, si_tid) == 0x0C); 459 + static_assert(offsetof(siginfo32_t, si_overrun) == 0x10); 460 + static_assert(offsetof(siginfo32_t, si_value) == 0x14); 461 + 462 + CHECK_SI_OFFSET(_rt); 463 + CHECK_SI_SIZE (_rt, 3*sizeof(int)); 464 + static_assert(offsetof(siginfo32_t, si_pid) == 0x0C); 465 + static_assert(offsetof(siginfo32_t, si_uid) == 0x10); 466 + static_assert(offsetof(siginfo32_t, si_value) == 0x14); 467 + 468 + CHECK_SI_OFFSET(_sigchld); 469 + CHECK_SI_SIZE (_sigchld, 5*sizeof(int)); 470 + static_assert(offsetof(siginfo32_t, si_pid) == 0x0C); 471 + static_assert(offsetof(siginfo32_t, si_uid) == 0x10); 472 + static_assert(offsetof(siginfo32_t, si_status) == 0x14); 473 + static_assert(offsetof(siginfo32_t, si_utime) == 0x18); 474 + static_assert(offsetof(siginfo32_t, si_stime) == 0x1C); 475 + 476 + CHECK_SI_OFFSET(_sigfault); 477 + CHECK_SI_SIZE (_sigfault, 4*sizeof(int)); 478 + static_assert(offsetof(siginfo32_t, si_addr) == 0x0C); 479 + 480 + static_assert(offsetof(siginfo32_t, si_trapno) == 0x10); 481 + 482 + static_assert(offsetof(siginfo32_t, si_addr_lsb) == 0x10); 483 + 484 + static_assert(offsetof(siginfo32_t, si_lower) == 0x14); 485 + static_assert(offsetof(siginfo32_t, si_upper) == 0x18); 486 + 487 + static_assert(offsetof(siginfo32_t, si_pkey) == 0x14); 488 + 489 + static_assert(offsetof(siginfo32_t, si_perf_data) == 0x10); 490 + static_assert(offsetof(siginfo32_t, si_perf_type) == 0x14); 491 + static_assert(offsetof(siginfo32_t, si_perf_flags) == 0x18); 492 + 493 + CHECK_SI_OFFSET(_sigpoll); 494 + CHECK_SI_SIZE (_sigpoll, 2*sizeof(int)); 495 + static_assert(offsetof(siginfo32_t, si_band) == 0x0C); 496 + static_assert(offsetof(siginfo32_t, si_fd) == 0x10); 497 + 498 + CHECK_SI_OFFSET(_sigsys); 499 + CHECK_SI_SIZE (_sigsys, 3*sizeof(int)); 500 + static_assert(offsetof(siginfo32_t, si_call_addr) == 0x0C); 501 + static_assert(offsetof(siginfo32_t, si_syscall) == 0x10); 502 + static_assert(offsetof(siginfo32_t, si_arch) == 0x14); 503 + 504 + /* any new si_fields should be added here */
+127
arch/x86/kernel/signal_64.c
··· 381 381 return 0; 382 382 } 383 383 #endif /* CONFIG_X86_X32_ABI */ 384 + 385 + #ifdef CONFIG_COMPAT 386 + void sigaction_compat_abi(struct k_sigaction *act, struct k_sigaction *oact) 387 + { 388 + if (!act) 389 + return; 390 + 391 + if (in_ia32_syscall()) 392 + act->sa.sa_flags |= SA_IA32_ABI; 393 + if (in_x32_syscall()) 394 + act->sa.sa_flags |= SA_X32_ABI; 395 + } 396 + #endif /* CONFIG_COMPAT */ 397 + 398 + /* 399 + * If adding a new si_code, there is probably new data in 400 + * the siginfo. Make sure folks bumping the si_code 401 + * limits also have to look at this code. Make sure any 402 + * new fields are handled in copy_siginfo_to_user32()! 403 + */ 404 + static_assert(NSIGILL == 11); 405 + static_assert(NSIGFPE == 15); 406 + static_assert(NSIGSEGV == 9); 407 + static_assert(NSIGBUS == 5); 408 + static_assert(NSIGTRAP == 6); 409 + static_assert(NSIGCHLD == 6); 410 + static_assert(NSIGSYS == 2); 411 + 412 + /* This is part of the ABI and can never change in size: */ 413 + static_assert(sizeof(siginfo_t) == 128); 414 + 415 + /* This is a part of the ABI and can never change in alignment */ 416 + static_assert(__alignof__(siginfo_t) == 8); 417 + 418 + /* 419 + * The offsets of all the (unioned) si_fields are fixed 420 + * in the ABI, of course. Make sure none of them ever 421 + * move and are always at the beginning: 422 + */ 423 + static_assert(offsetof(siginfo_t, si_signo) == 0); 424 + static_assert(offsetof(siginfo_t, si_errno) == 4); 425 + static_assert(offsetof(siginfo_t, si_code) == 8); 426 + 427 + /* 428 + * Ensure that the size of each si_field never changes. 429 + * If it does, it is a sign that the 430 + * copy_siginfo_to_user32() code below needs to updated 431 + * along with the size in the CHECK_SI_SIZE(). 432 + * 433 + * We repeat this check for both the generic and compat 434 + * siginfos. 435 + * 436 + * Note: it is OK for these to grow as long as the whole 437 + * structure stays within the padding size (checked 438 + * above). 439 + */ 440 + 441 + #define CHECK_SI_OFFSET(name) \ 442 + static_assert(offsetof(siginfo_t, _sifields) == \ 443 + offsetof(siginfo_t, _sifields.name)) 444 + #define CHECK_SI_SIZE(name, size) \ 445 + static_assert(sizeof_field(siginfo_t, _sifields.name) == size) 446 + 447 + CHECK_SI_OFFSET(_kill); 448 + CHECK_SI_SIZE (_kill, 2*sizeof(int)); 449 + static_assert(offsetof(siginfo_t, si_pid) == 0x10); 450 + static_assert(offsetof(siginfo_t, si_uid) == 0x14); 451 + 452 + CHECK_SI_OFFSET(_timer); 453 + CHECK_SI_SIZE (_timer, 6*sizeof(int)); 454 + static_assert(offsetof(siginfo_t, si_tid) == 0x10); 455 + static_assert(offsetof(siginfo_t, si_overrun) == 0x14); 456 + static_assert(offsetof(siginfo_t, si_value) == 0x18); 457 + 458 + CHECK_SI_OFFSET(_rt); 459 + CHECK_SI_SIZE (_rt, 4*sizeof(int)); 460 + static_assert(offsetof(siginfo_t, si_pid) == 0x10); 461 + static_assert(offsetof(siginfo_t, si_uid) == 0x14); 462 + static_assert(offsetof(siginfo_t, si_value) == 0x18); 463 + 464 + CHECK_SI_OFFSET(_sigchld); 465 + CHECK_SI_SIZE (_sigchld, 8*sizeof(int)); 466 + static_assert(offsetof(siginfo_t, si_pid) == 0x10); 467 + static_assert(offsetof(siginfo_t, si_uid) == 0x14); 468 + static_assert(offsetof(siginfo_t, si_status) == 0x18); 469 + static_assert(offsetof(siginfo_t, si_utime) == 0x20); 470 + static_assert(offsetof(siginfo_t, si_stime) == 0x28); 471 + 472 + #ifdef CONFIG_X86_X32_ABI 473 + /* no _sigchld_x32 in the generic siginfo_t */ 474 + static_assert(sizeof_field(compat_siginfo_t, _sifields._sigchld_x32) == 475 + 7*sizeof(int)); 476 + static_assert(offsetof(compat_siginfo_t, _sifields) == 477 + offsetof(compat_siginfo_t, _sifields._sigchld_x32)); 478 + static_assert(offsetof(compat_siginfo_t, _sifields._sigchld_x32._utime) == 0x18); 479 + static_assert(offsetof(compat_siginfo_t, _sifields._sigchld_x32._stime) == 0x20); 480 + #endif 481 + 482 + CHECK_SI_OFFSET(_sigfault); 483 + CHECK_SI_SIZE (_sigfault, 8*sizeof(int)); 484 + static_assert(offsetof(siginfo_t, si_addr) == 0x10); 485 + 486 + static_assert(offsetof(siginfo_t, si_trapno) == 0x18); 487 + 488 + static_assert(offsetof(siginfo_t, si_addr_lsb) == 0x18); 489 + 490 + static_assert(offsetof(siginfo_t, si_lower) == 0x20); 491 + static_assert(offsetof(siginfo_t, si_upper) == 0x28); 492 + 493 + static_assert(offsetof(siginfo_t, si_pkey) == 0x20); 494 + 495 + static_assert(offsetof(siginfo_t, si_perf_data) == 0x18); 496 + static_assert(offsetof(siginfo_t, si_perf_type) == 0x20); 497 + static_assert(offsetof(siginfo_t, si_perf_flags) == 0x24); 498 + 499 + CHECK_SI_OFFSET(_sigpoll); 500 + CHECK_SI_SIZE (_sigpoll, 4*sizeof(int)); 501 + static_assert(offsetof(siginfo_t, si_band) == 0x10); 502 + static_assert(offsetof(siginfo_t, si_fd) == 0x18); 503 + 504 + CHECK_SI_OFFSET(_sigsys); 505 + CHECK_SI_SIZE (_sigsys, 4*sizeof(int)); 506 + static_assert(offsetof(siginfo_t, si_call_addr) == 0x10); 507 + static_assert(offsetof(siginfo_t, si_syscall) == 0x18); 508 + static_assert(offsetof(siginfo_t, si_arch) == 0x1C); 509 + 510 + /* any new si_fields should be added here */
-191
arch/x86/kernel/signal_compat.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - #include <linux/compat.h> 3 - #include <linux/uaccess.h> 4 - #include <linux/ptrace.h> 5 - 6 - /* 7 - * The compat_siginfo_t structure and handing code is very easy 8 - * to break in several ways. It must always be updated when new 9 - * updates are made to the main siginfo_t, and 10 - * copy_siginfo_to_user32() must be updated when the 11 - * (arch-independent) copy_siginfo_to_user() is updated. 12 - * 13 - * It is also easy to put a new member in the compat_siginfo_t 14 - * which has implicit alignment which can move internal structure 15 - * alignment around breaking the ABI. This can happen if you, 16 - * for instance, put a plain 64-bit value in there. 17 - */ 18 - static inline void signal_compat_build_tests(void) 19 - { 20 - int _sifields_offset = offsetof(compat_siginfo_t, _sifields); 21 - 22 - /* 23 - * If adding a new si_code, there is probably new data in 24 - * the siginfo. Make sure folks bumping the si_code 25 - * limits also have to look at this code. Make sure any 26 - * new fields are handled in copy_siginfo_to_user32()! 27 - */ 28 - BUILD_BUG_ON(NSIGILL != 11); 29 - BUILD_BUG_ON(NSIGFPE != 15); 30 - BUILD_BUG_ON(NSIGSEGV != 9); 31 - BUILD_BUG_ON(NSIGBUS != 5); 32 - BUILD_BUG_ON(NSIGTRAP != 6); 33 - BUILD_BUG_ON(NSIGCHLD != 6); 34 - BUILD_BUG_ON(NSIGSYS != 2); 35 - 36 - /* This is part of the ABI and can never change in size: */ 37 - BUILD_BUG_ON(sizeof(siginfo_t) != 128); 38 - BUILD_BUG_ON(sizeof(compat_siginfo_t) != 128); 39 - 40 - /* This is a part of the ABI and can never change in alignment */ 41 - BUILD_BUG_ON(__alignof__(siginfo_t) != 8); 42 - BUILD_BUG_ON(__alignof__(compat_siginfo_t) != 4); 43 - 44 - /* 45 - * The offsets of all the (unioned) si_fields are fixed 46 - * in the ABI, of course. Make sure none of them ever 47 - * move and are always at the beginning: 48 - */ 49 - BUILD_BUG_ON(offsetof(compat_siginfo_t, _sifields) != 3 * sizeof(int)); 50 - #define CHECK_CSI_OFFSET(name) BUILD_BUG_ON(_sifields_offset != offsetof(compat_siginfo_t, _sifields.name)) 51 - 52 - BUILD_BUG_ON(offsetof(siginfo_t, si_signo) != 0); 53 - BUILD_BUG_ON(offsetof(siginfo_t, si_errno) != 4); 54 - BUILD_BUG_ON(offsetof(siginfo_t, si_code) != 8); 55 - 56 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_signo) != 0); 57 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_errno) != 4); 58 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_code) != 8); 59 - /* 60 - * Ensure that the size of each si_field never changes. 61 - * If it does, it is a sign that the 62 - * copy_siginfo_to_user32() code below needs to updated 63 - * along with the size in the CHECK_SI_SIZE(). 64 - * 65 - * We repeat this check for both the generic and compat 66 - * siginfos. 67 - * 68 - * Note: it is OK for these to grow as long as the whole 69 - * structure stays within the padding size (checked 70 - * above). 71 - */ 72 - #define CHECK_CSI_SIZE(name, size) BUILD_BUG_ON(size != sizeof(((compat_siginfo_t *)0)->_sifields.name)) 73 - #define CHECK_SI_SIZE(name, size) BUILD_BUG_ON(size != sizeof(((siginfo_t *)0)->_sifields.name)) 74 - 75 - CHECK_CSI_OFFSET(_kill); 76 - CHECK_CSI_SIZE (_kill, 2*sizeof(int)); 77 - CHECK_SI_SIZE (_kill, 2*sizeof(int)); 78 - 79 - BUILD_BUG_ON(offsetof(siginfo_t, si_pid) != 0x10); 80 - BUILD_BUG_ON(offsetof(siginfo_t, si_uid) != 0x14); 81 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_pid) != 0xC); 82 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_uid) != 0x10); 83 - 84 - CHECK_CSI_OFFSET(_timer); 85 - CHECK_CSI_SIZE (_timer, 3*sizeof(int)); 86 - CHECK_SI_SIZE (_timer, 6*sizeof(int)); 87 - 88 - BUILD_BUG_ON(offsetof(siginfo_t, si_tid) != 0x10); 89 - BUILD_BUG_ON(offsetof(siginfo_t, si_overrun) != 0x14); 90 - BUILD_BUG_ON(offsetof(siginfo_t, si_value) != 0x18); 91 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_tid) != 0x0C); 92 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_overrun) != 0x10); 93 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_value) != 0x14); 94 - 95 - CHECK_CSI_OFFSET(_rt); 96 - CHECK_CSI_SIZE (_rt, 3*sizeof(int)); 97 - CHECK_SI_SIZE (_rt, 4*sizeof(int)); 98 - 99 - BUILD_BUG_ON(offsetof(siginfo_t, si_pid) != 0x10); 100 - BUILD_BUG_ON(offsetof(siginfo_t, si_uid) != 0x14); 101 - BUILD_BUG_ON(offsetof(siginfo_t, si_value) != 0x18); 102 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_pid) != 0x0C); 103 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_uid) != 0x10); 104 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_value) != 0x14); 105 - 106 - CHECK_CSI_OFFSET(_sigchld); 107 - CHECK_CSI_SIZE (_sigchld, 5*sizeof(int)); 108 - CHECK_SI_SIZE (_sigchld, 8*sizeof(int)); 109 - 110 - BUILD_BUG_ON(offsetof(siginfo_t, si_pid) != 0x10); 111 - BUILD_BUG_ON(offsetof(siginfo_t, si_uid) != 0x14); 112 - BUILD_BUG_ON(offsetof(siginfo_t, si_status) != 0x18); 113 - BUILD_BUG_ON(offsetof(siginfo_t, si_utime) != 0x20); 114 - BUILD_BUG_ON(offsetof(siginfo_t, si_stime) != 0x28); 115 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_pid) != 0x0C); 116 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_uid) != 0x10); 117 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_status) != 0x14); 118 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_utime) != 0x18); 119 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_stime) != 0x1C); 120 - 121 - #ifdef CONFIG_X86_X32_ABI 122 - CHECK_CSI_OFFSET(_sigchld_x32); 123 - CHECK_CSI_SIZE (_sigchld_x32, 7*sizeof(int)); 124 - /* no _sigchld_x32 in the generic siginfo_t */ 125 - BUILD_BUG_ON(offsetof(compat_siginfo_t, _sifields._sigchld_x32._utime) != 0x18); 126 - BUILD_BUG_ON(offsetof(compat_siginfo_t, _sifields._sigchld_x32._stime) != 0x20); 127 - #endif 128 - 129 - CHECK_CSI_OFFSET(_sigfault); 130 - CHECK_CSI_SIZE (_sigfault, 4*sizeof(int)); 131 - CHECK_SI_SIZE (_sigfault, 8*sizeof(int)); 132 - 133 - BUILD_BUG_ON(offsetof(siginfo_t, si_addr) != 0x10); 134 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_addr) != 0x0C); 135 - 136 - BUILD_BUG_ON(offsetof(siginfo_t, si_trapno) != 0x18); 137 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_trapno) != 0x10); 138 - 139 - BUILD_BUG_ON(offsetof(siginfo_t, si_addr_lsb) != 0x18); 140 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_addr_lsb) != 0x10); 141 - 142 - BUILD_BUG_ON(offsetof(siginfo_t, si_lower) != 0x20); 143 - BUILD_BUG_ON(offsetof(siginfo_t, si_upper) != 0x28); 144 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_lower) != 0x14); 145 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_upper) != 0x18); 146 - 147 - BUILD_BUG_ON(offsetof(siginfo_t, si_pkey) != 0x20); 148 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_pkey) != 0x14); 149 - 150 - BUILD_BUG_ON(offsetof(siginfo_t, si_perf_data) != 0x18); 151 - BUILD_BUG_ON(offsetof(siginfo_t, si_perf_type) != 0x20); 152 - BUILD_BUG_ON(offsetof(siginfo_t, si_perf_flags) != 0x24); 153 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_perf_data) != 0x10); 154 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_perf_type) != 0x14); 155 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_perf_flags) != 0x18); 156 - 157 - CHECK_CSI_OFFSET(_sigpoll); 158 - CHECK_CSI_SIZE (_sigpoll, 2*sizeof(int)); 159 - CHECK_SI_SIZE (_sigpoll, 4*sizeof(int)); 160 - 161 - BUILD_BUG_ON(offsetof(siginfo_t, si_band) != 0x10); 162 - BUILD_BUG_ON(offsetof(siginfo_t, si_fd) != 0x18); 163 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_band) != 0x0C); 164 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_fd) != 0x10); 165 - 166 - CHECK_CSI_OFFSET(_sigsys); 167 - CHECK_CSI_SIZE (_sigsys, 3*sizeof(int)); 168 - CHECK_SI_SIZE (_sigsys, 4*sizeof(int)); 169 - 170 - BUILD_BUG_ON(offsetof(siginfo_t, si_call_addr) != 0x10); 171 - BUILD_BUG_ON(offsetof(siginfo_t, si_syscall) != 0x18); 172 - BUILD_BUG_ON(offsetof(siginfo_t, si_arch) != 0x1C); 173 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_call_addr) != 0x0C); 174 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_syscall) != 0x10); 175 - BUILD_BUG_ON(offsetof(compat_siginfo_t, si_arch) != 0x14); 176 - 177 - /* any new si_fields should be added here */ 178 - } 179 - 180 - void sigaction_compat_abi(struct k_sigaction *act, struct k_sigaction *oact) 181 - { 182 - signal_compat_build_tests(); 183 - 184 - if (!act) 185 - return; 186 - 187 - if (in_ia32_syscall()) 188 - act->sa.sa_flags |= SA_IA32_ABI; 189 - if (in_x32_syscall()) 190 - act->sa.sa_flags |= SA_X32_ABI; 191 - }