File: | ipc/compat_mq.c |
Warning: | line 106, column 7 Copies out a struct with a union element with different sizes |
1 | /* | |||||
2 | * ipc/compat_mq.c | |||||
3 | * 32 bit emulation for POSIX message queue system calls | |||||
4 | * | |||||
5 | * Copyright (C) 2004 IBM Deutschland Entwicklung GmbH, IBM Corporation | |||||
6 | * Author: Arnd Bergmann <[email protected]> | |||||
7 | */ | |||||
8 | ||||||
9 | #include <linux1/compat.h> | |||||
10 | #include <linux1/fs.h> | |||||
11 | #include <linux1/kernel.h> | |||||
12 | #include <linux1/mqueue.h> | |||||
13 | #include <linux1/syscalls.h> | |||||
14 | ||||||
15 | #include <linux1/uaccess.h> | |||||
16 | ||||||
17 | struct compat_mq_attr { | |||||
18 | compat_long_t mq_flags; /* message queue flags */ | |||||
19 | compat_long_t mq_maxmsg; /* maximum number of messages */ | |||||
20 | compat_long_t mq_msgsize; /* maximum message size */ | |||||
21 | compat_long_t mq_curmsgs; /* number of messages currently queued */ | |||||
22 | compat_long_t __reserved[4]; /* ignored for input, zeroed for output */ | |||||
23 | }; | |||||
24 | ||||||
25 | static inlineinline __attribute__((no_instrument_function)) int get_compat_mq_attr(struct mq_attr *attr, | |||||
26 | const struct compat_mq_attr __user *uattr) | |||||
27 | { | |||||
28 | if (!access_ok(VERIFY_READ, uattr, sizeof *uattr)(!({ (void)0; __chk_range_not_ok((unsigned long )(uattr), sizeof *uattr, (get_current()->thread.addr_limit.seg)); }))) | |||||
29 | return -EFAULT14; | |||||
30 | ||||||
31 | return __get_user(attr->mq_flags, &uattr->mq_flags)({ int __gu_err; __typeof__(__builtin_choose_expr(sizeof(*((& uattr->mq_flags))) > sizeof(0UL), 0ULL, 0UL)) __gu_val; stac(); do { __gu_err = 0; (void)0; switch ((sizeof(*(&uattr ->mq_flags)))) { case 1: asm volatile("\n" "1: mov""b"" %2,%" "b""1\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " xor" "b"" %""b""1,%""b""1\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r" (__gu_err), "=q"(__gu_val) : "m" ((*(struct __large_struct *)(((&uattr->mq_flags))))), "i" (-14), "0" (__gu_err) ); break; case 2: asm volatile("\n" "1: mov""w"" %2,%""w""1\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " xor""w" " %""w""1,%""w""1\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r" (__gu_err), "=r"(__gu_val) : "m" ((*(struct __large_struct *)(((&uattr->mq_flags))))), "i" (-14), "0" (__gu_err) ); break; case 4: asm volatile("\n" "1: mov""l"" %2,%""k""1\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " xor""l" " %""k""1,%""k""1\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r" (__gu_err), "=r"(__gu_val) : "m" ((*(struct __large_struct *)(((&uattr->mq_flags))))), "i" (-14), "0" (__gu_err) ); break; case 8: asm volatile("\n" "1: mov""q"" %2,%""""1\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " xor""q" " %""""1,%""""1\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r" (__gu_err), "=r"(__gu_val) : "m" ((*(struct __large_struct *)(((&uattr->mq_flags))))), "i" (-14), "0" (__gu_err) ); break; default: (__gu_val) = __get_user_bad(); } } while ( 0); clac(); ((attr->mq_flags)) = ( __typeof__(*((&uattr ->mq_flags))))__gu_val; __builtin_expect(__gu_err, 0); }) | |||||
32 | | __get_user(attr->mq_maxmsg, &uattr->mq_maxmsg)({ int __gu_err; __typeof__(__builtin_choose_expr(sizeof(*((& uattr->mq_maxmsg))) > sizeof(0UL), 0ULL, 0UL)) __gu_val ; stac(); do { __gu_err = 0; (void)0; switch ((sizeof(*(& uattr->mq_maxmsg)))) { case 1: asm volatile("\n" "1: mov""b" " %2,%""b""1\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " xor""b"" %""b""1,%""b""1\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r" (__gu_err), "=q"(__gu_val) : "m" ((*(struct __large_struct *)(((&uattr->mq_maxmsg))))), "i" (-14), "0" (__gu_err )); break; case 2: asm volatile("\n" "1: mov""w"" %2,%""w""1\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " xor""w" " %""w""1,%""w""1\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r" (__gu_err), "=r"(__gu_val) : "m" ((*(struct __large_struct *)(((&uattr->mq_maxmsg))))), "i" (-14), "0" (__gu_err )); break; case 4: asm volatile("\n" "1: mov""l"" %2,%""k""1\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " xor""l" " %""k""1,%""k""1\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r" (__gu_err), "=r"(__gu_val) : "m" ((*(struct __large_struct *)(((&uattr->mq_maxmsg))))), "i" (-14), "0" (__gu_err )); break; case 8: asm volatile("\n" "1: mov""q"" %2,%""""1\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " xor""q" " %""""1,%""""1\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r" (__gu_err), "=r"(__gu_val) : "m" ((*(struct __large_struct *)(((&uattr->mq_maxmsg))))), "i" (-14), "0" (__gu_err )); break; default: (__gu_val) = __get_user_bad(); } } while ( 0); clac(); ((attr->mq_maxmsg)) = ( __typeof__(*((&uattr ->mq_maxmsg))))__gu_val; __builtin_expect(__gu_err, 0); }) | |||||
33 | | __get_user(attr->mq_msgsize, &uattr->mq_msgsize)({ int __gu_err; __typeof__(__builtin_choose_expr(sizeof(*((& uattr->mq_msgsize))) > sizeof(0UL), 0ULL, 0UL)) __gu_val ; stac(); do { __gu_err = 0; (void)0; switch ((sizeof(*(& uattr->mq_msgsize)))) { case 1: asm volatile("\n" "1: mov" "b"" %2,%""b""1\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " xor""b"" %""b""1,%""b""1\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r" (__gu_err), "=q"(__gu_val) : "m" ((*(struct __large_struct *)(((&uattr->mq_msgsize))))), "i" (-14), "0" (__gu_err )); break; case 2: asm volatile("\n" "1: mov""w"" %2,%""w""1\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " xor""w" " %""w""1,%""w""1\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r" (__gu_err), "=r"(__gu_val) : "m" ((*(struct __large_struct *)(((&uattr->mq_msgsize))))), "i" (-14), "0" (__gu_err )); break; case 4: asm volatile("\n" "1: mov""l"" %2,%""k""1\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " xor""l" " %""k""1,%""k""1\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r" (__gu_err), "=r"(__gu_val) : "m" ((*(struct __large_struct *)(((&uattr->mq_msgsize))))), "i" (-14), "0" (__gu_err )); break; case 8: asm volatile("\n" "1: mov""q"" %2,%""""1\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " xor""q" " %""""1,%""""1\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r" (__gu_err), "=r"(__gu_val) : "m" ((*(struct __large_struct *)(((&uattr->mq_msgsize))))), "i" (-14), "0" (__gu_err )); break; default: (__gu_val) = __get_user_bad(); } } while ( 0); clac(); ((attr->mq_msgsize)) = ( __typeof__(*((&uattr ->mq_msgsize))))__gu_val; __builtin_expect(__gu_err, 0); } ) | |||||
34 | | __get_user(attr->mq_curmsgs, &uattr->mq_curmsgs)({ int __gu_err; __typeof__(__builtin_choose_expr(sizeof(*((& uattr->mq_curmsgs))) > sizeof(0UL), 0ULL, 0UL)) __gu_val ; stac(); do { __gu_err = 0; (void)0; switch ((sizeof(*(& uattr->mq_curmsgs)))) { case 1: asm volatile("\n" "1: mov" "b"" %2,%""b""1\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " xor""b"" %""b""1,%""b""1\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r" (__gu_err), "=q"(__gu_val) : "m" ((*(struct __large_struct *)(((&uattr->mq_curmsgs))))), "i" (-14), "0" (__gu_err )); break; case 2: asm volatile("\n" "1: mov""w"" %2,%""w""1\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " xor""w" " %""w""1,%""w""1\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r" (__gu_err), "=r"(__gu_val) : "m" ((*(struct __large_struct *)(((&uattr->mq_curmsgs))))), "i" (-14), "0" (__gu_err )); break; case 4: asm volatile("\n" "1: mov""l"" %2,%""k""1\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " xor""l" " %""k""1,%""k""1\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r" (__gu_err), "=r"(__gu_val) : "m" ((*(struct __large_struct *)(((&uattr->mq_curmsgs))))), "i" (-14), "0" (__gu_err )); break; case 8: asm volatile("\n" "1: mov""q"" %2,%""""1\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " xor""q" " %""""1,%""""1\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r" (__gu_err), "=r"(__gu_val) : "m" ((*(struct __large_struct *)(((&uattr->mq_curmsgs))))), "i" (-14), "0" (__gu_err )); break; default: (__gu_val) = __get_user_bad(); } } while ( 0); clac(); ((attr->mq_curmsgs)) = ( __typeof__(*((&uattr ->mq_curmsgs))))__gu_val; __builtin_expect(__gu_err, 0); } ); | |||||
35 | } | |||||
36 | ||||||
37 | static inlineinline __attribute__((no_instrument_function)) int put_compat_mq_attr(const struct mq_attr *attr, | |||||
38 | struct compat_mq_attr __user *uattr) | |||||
39 | { | |||||
40 | if (clear_user(uattr, sizeof *uattr)) | |||||
41 | return -EFAULT14; | |||||
42 | ||||||
43 | return __put_user(attr->mq_flags, &uattr->mq_flags)({ int __pu_err; stac(); do { __pu_err = 0; (void)0; switch ( (sizeof(*(&uattr->mq_flags)))) { case 1: asm volatile( "\n" "1: mov""b"" %""b""1,%2\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r"(__pu_err) : "iq"(((__typeof__(*(&uattr->mq_flags )))(attr->mq_flags))), "m" ((*(struct __large_struct *)((( &uattr->mq_flags))))), "i" (-14), "0" (__pu_err)); break ; case 2: asm volatile("\n" "1: mov""w"" %""w""1,%2\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r"(__pu_err) : "ir"(((__typeof__ (*(&uattr->mq_flags)))(attr->mq_flags))), "m" ((*(struct __large_struct *)(((&uattr->mq_flags))))), "i" (-14), "0" (__pu_err)); break; case 4: asm volatile("\n" "1: mov""l" " %""k""1,%2\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r"(__pu_err) : "ir"(((__typeof__(*(&uattr->mq_flags )))(attr->mq_flags))), "m" ((*(struct __large_struct *)((( &uattr->mq_flags))))), "i" (-14), "0" (__pu_err)); break ; case 8: asm volatile("\n" "1: mov""q"" %""""1,%2\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r"(__pu_err) : "er"((__typeof__(*((&uattr->mq_flags ))))(((__typeof__(*(&uattr->mq_flags)))(attr->mq_flags )))), "m" ((*(struct __large_struct *)(((&uattr->mq_flags ))))), "i" (-14), "0" (__pu_err)); break; default: __put_user_bad (); } } while (0); clac(); __builtin_expect(__pu_err, 0); }) | |||||
44 | | __put_user(attr->mq_maxmsg, &uattr->mq_maxmsg)({ int __pu_err; stac(); do { __pu_err = 0; (void)0; switch ( (sizeof(*(&uattr->mq_maxmsg)))) { case 1: asm volatile ("\n" "1: mov""b"" %""b""1,%2\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r"(__pu_err) : "iq"(((__typeof__(*(&uattr->mq_maxmsg )))(attr->mq_maxmsg))), "m" ((*(struct __large_struct *)(( (&uattr->mq_maxmsg))))), "i" (-14), "0" (__pu_err)); break ; case 2: asm volatile("\n" "1: mov""w"" %""w""1,%2\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r"(__pu_err) : "ir"(((__typeof__ (*(&uattr->mq_maxmsg)))(attr->mq_maxmsg))), "m" ((* (struct __large_struct *)(((&uattr->mq_maxmsg))))), "i" (-14), "0" (__pu_err)); break; case 4: asm volatile("\n" "1: mov" "l"" %""k""1,%2\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r"(__pu_err) : "ir"(((__typeof__(*(&uattr->mq_maxmsg )))(attr->mq_maxmsg))), "m" ((*(struct __large_struct *)(( (&uattr->mq_maxmsg))))), "i" (-14), "0" (__pu_err)); break ; case 8: asm volatile("\n" "1: mov""q"" %""""1,%2\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r"(__pu_err) : "er"((__typeof__(*((&uattr->mq_maxmsg ))))(((__typeof__(*(&uattr->mq_maxmsg)))(attr->mq_maxmsg )))), "m" ((*(struct __large_struct *)(((&uattr->mq_maxmsg ))))), "i" (-14), "0" (__pu_err)); break; default: __put_user_bad (); } } while (0); clac(); __builtin_expect(__pu_err, 0); }) | |||||
45 | | __put_user(attr->mq_msgsize, &uattr->mq_msgsize)({ int __pu_err; stac(); do { __pu_err = 0; (void)0; switch ( (sizeof(*(&uattr->mq_msgsize)))) { case 1: asm volatile ("\n" "1: mov""b"" %""b""1,%2\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r"(__pu_err) : "iq"(((__typeof__(*(&uattr->mq_msgsize )))(attr->mq_msgsize))), "m" ((*(struct __large_struct *)( ((&uattr->mq_msgsize))))), "i" (-14), "0" (__pu_err)); break; case 2: asm volatile("\n" "1: mov""w"" %""w""1,%2\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r"(__pu_err) : "ir"(((__typeof__ (*(&uattr->mq_msgsize)))(attr->mq_msgsize))), "m" ( (*(struct __large_struct *)(((&uattr->mq_msgsize))))), "i" (-14), "0" (__pu_err)); break; case 4: asm volatile("\n" "1: mov""l"" %""k""1,%2\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r"(__pu_err) : "ir"(((__typeof__(*(&uattr->mq_msgsize )))(attr->mq_msgsize))), "m" ((*(struct __large_struct *)( ((&uattr->mq_msgsize))))), "i" (-14), "0" (__pu_err)); break; case 8: asm volatile("\n" "1: mov""q"" %""""1,%2\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r"(__pu_err) : "er"((__typeof__ (*((&uattr->mq_msgsize))))(((__typeof__(*(&uattr-> mq_msgsize)))(attr->mq_msgsize)))), "m" ((*(struct __large_struct *)(((&uattr->mq_msgsize))))), "i" (-14), "0" (__pu_err )); break; default: __put_user_bad(); } } while (0); clac(); __builtin_expect (__pu_err, 0); }) | |||||
46 | | __put_user(attr->mq_curmsgs, &uattr->mq_curmsgs)({ int __pu_err; stac(); do { __pu_err = 0; (void)0; switch ( (sizeof(*(&uattr->mq_curmsgs)))) { case 1: asm volatile ("\n" "1: mov""b"" %""b""1,%2\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r"(__pu_err) : "iq"(((__typeof__(*(&uattr->mq_curmsgs )))(attr->mq_curmsgs))), "m" ((*(struct __large_struct *)( ((&uattr->mq_curmsgs))))), "i" (-14), "0" (__pu_err)); break; case 2: asm volatile("\n" "1: mov""w"" %""w""1,%2\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r"(__pu_err) : "ir"(((__typeof__ (*(&uattr->mq_curmsgs)))(attr->mq_curmsgs))), "m" ( (*(struct __large_struct *)(((&uattr->mq_curmsgs))))), "i" (-14), "0" (__pu_err)); break; case 4: asm volatile("\n" "1: mov""l"" %""k""1,%2\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r"(__pu_err) : "ir"(((__typeof__(*(&uattr->mq_curmsgs )))(attr->mq_curmsgs))), "m" ((*(struct __large_struct *)( ((&uattr->mq_curmsgs))))), "i" (-14), "0" (__pu_err)); break; case 8: asm volatile("\n" "1: mov""q"" %""""1,%2\n" "2:\n" ".section .fixup,\"ax\"\n" "3: mov %3,%0\n" " jmp 2b\n" ".previous\n" " .pushsection \"__ex_table\",\"a\"\n" " .balign 4\n" " .long (" "1b" ") - .\n" " .long (" "3b" ") - .\n" " .long (" "ex_handler_default" ") - .\n" " .popsection\n" : "=r"(__pu_err) : "er"((__typeof__ (*((&uattr->mq_curmsgs))))(((__typeof__(*(&uattr-> mq_curmsgs)))(attr->mq_curmsgs)))), "m" ((*(struct __large_struct *)(((&uattr->mq_curmsgs))))), "i" (-14), "0" (__pu_err )); break; default: __put_user_bad(); } } while (0); clac(); __builtin_expect (__pu_err, 0); }); | |||||
47 | } | |||||
48 | ||||||
49 | COMPAT_SYSCALL_DEFINE4(mq_open, const char __user *, u_name,long compat_sys_mq_open(const char * u_name, int oflag, compat_mode_t mode, struct compat_mq_attr * u_attr) __attribute__((alias("compat_SyS_mq_open" ))); static inline __attribute__((no_instrument_function)) long C_SYSC_mq_open(const char * u_name, int oflag, compat_mode_t mode, struct compat_mq_attr * u_attr); long compat_SyS_mq_open (__typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const char *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const char *)0), typeof(0ULL))), 0LL, 0L)) u_name, __typeof (__builtin_choose_expr((__builtin_types_compatible_p(typeof(( int)0), typeof(0LL)) || __builtin_types_compatible_p(typeof(( int)0), typeof(0ULL))), 0LL, 0L)) oflag, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((compat_mode_t)0), typeof (0LL)) || __builtin_types_compatible_p(typeof((compat_mode_t) 0), typeof(0ULL))), 0LL, 0L)) mode, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((struct compat_mq_attr * )0), typeof(0LL)) || __builtin_types_compatible_p(typeof((struct compat_mq_attr *)0), typeof(0ULL))), 0LL, 0L)) u_attr); long compat_SyS_mq_open(__typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const char *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const char *)0), typeof(0ULL))), 0LL, 0L)) u_name, __typeof (__builtin_choose_expr((__builtin_types_compatible_p(typeof(( int)0), typeof(0LL)) || __builtin_types_compatible_p(typeof(( int)0), typeof(0ULL))), 0LL, 0L)) oflag, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((compat_mode_t)0), typeof (0LL)) || __builtin_types_compatible_p(typeof((compat_mode_t) 0), typeof(0ULL))), 0LL, 0L)) mode, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((struct compat_mq_attr * )0), typeof(0LL)) || __builtin_types_compatible_p(typeof((struct compat_mq_attr *)0), typeof(0ULL))), 0LL, 0L)) u_attr) { return C_SYSC_mq_open(((const char *)(unsigned long)(u_name)), ((int )(unsigned long)(oflag)), ((compat_mode_t)(unsigned long)(mode )), ((struct compat_mq_attr *)(unsigned long)(u_attr))); } static inline __attribute__((no_instrument_function)) long C_SYSC_mq_open (const char * u_name, int oflag, compat_mode_t mode, struct compat_mq_attr * u_attr) | |||||
50 | int, oflag, compat_mode_t, mode,long compat_sys_mq_open(const char * u_name, int oflag, compat_mode_t mode, struct compat_mq_attr * u_attr) __attribute__((alias("compat_SyS_mq_open" ))); static inline __attribute__((no_instrument_function)) long C_SYSC_mq_open(const char * u_name, int oflag, compat_mode_t mode, struct compat_mq_attr * u_attr); long compat_SyS_mq_open (__typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const char *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const char *)0), typeof(0ULL))), 0LL, 0L)) u_name, __typeof (__builtin_choose_expr((__builtin_types_compatible_p(typeof(( int)0), typeof(0LL)) || __builtin_types_compatible_p(typeof(( int)0), typeof(0ULL))), 0LL, 0L)) oflag, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((compat_mode_t)0), typeof (0LL)) || __builtin_types_compatible_p(typeof((compat_mode_t) 0), typeof(0ULL))), 0LL, 0L)) mode, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((struct compat_mq_attr * )0), typeof(0LL)) || __builtin_types_compatible_p(typeof((struct compat_mq_attr *)0), typeof(0ULL))), 0LL, 0L)) u_attr); long compat_SyS_mq_open(__typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const char *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const char *)0), typeof(0ULL))), 0LL, 0L)) u_name, __typeof (__builtin_choose_expr((__builtin_types_compatible_p(typeof(( int)0), typeof(0LL)) || __builtin_types_compatible_p(typeof(( int)0), typeof(0ULL))), 0LL, 0L)) oflag, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((compat_mode_t)0), typeof (0LL)) || __builtin_types_compatible_p(typeof((compat_mode_t) 0), typeof(0ULL))), 0LL, 0L)) mode, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((struct compat_mq_attr * )0), typeof(0LL)) || __builtin_types_compatible_p(typeof((struct compat_mq_attr *)0), typeof(0ULL))), 0LL, 0L)) u_attr) { return C_SYSC_mq_open(((const char *)(unsigned long)(u_name)), ((int )(unsigned long)(oflag)), ((compat_mode_t)(unsigned long)(mode )), ((struct compat_mq_attr *)(unsigned long)(u_attr))); } static inline __attribute__((no_instrument_function)) long C_SYSC_mq_open (const char * u_name, int oflag, compat_mode_t mode, struct compat_mq_attr * u_attr) | |||||
51 | struct compat_mq_attr __user *, u_attr)long compat_sys_mq_open(const char * u_name, int oflag, compat_mode_t mode, struct compat_mq_attr * u_attr) __attribute__((alias("compat_SyS_mq_open" ))); static inline __attribute__((no_instrument_function)) long C_SYSC_mq_open(const char * u_name, int oflag, compat_mode_t mode, struct compat_mq_attr * u_attr); long compat_SyS_mq_open (__typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const char *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const char *)0), typeof(0ULL))), 0LL, 0L)) u_name, __typeof (__builtin_choose_expr((__builtin_types_compatible_p(typeof(( int)0), typeof(0LL)) || __builtin_types_compatible_p(typeof(( int)0), typeof(0ULL))), 0LL, 0L)) oflag, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((compat_mode_t)0), typeof (0LL)) || __builtin_types_compatible_p(typeof((compat_mode_t) 0), typeof(0ULL))), 0LL, 0L)) mode, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((struct compat_mq_attr * )0), typeof(0LL)) || __builtin_types_compatible_p(typeof((struct compat_mq_attr *)0), typeof(0ULL))), 0LL, 0L)) u_attr); long compat_SyS_mq_open(__typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const char *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const char *)0), typeof(0ULL))), 0LL, 0L)) u_name, __typeof (__builtin_choose_expr((__builtin_types_compatible_p(typeof(( int)0), typeof(0LL)) || __builtin_types_compatible_p(typeof(( int)0), typeof(0ULL))), 0LL, 0L)) oflag, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((compat_mode_t)0), typeof (0LL)) || __builtin_types_compatible_p(typeof((compat_mode_t) 0), typeof(0ULL))), 0LL, 0L)) mode, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((struct compat_mq_attr * )0), typeof(0LL)) || __builtin_types_compatible_p(typeof((struct compat_mq_attr *)0), typeof(0ULL))), 0LL, 0L)) u_attr) { return C_SYSC_mq_open(((const char *)(unsigned long)(u_name)), ((int )(unsigned long)(oflag)), ((compat_mode_t)(unsigned long)(mode )), ((struct compat_mq_attr *)(unsigned long)(u_attr))); } static inline __attribute__((no_instrument_function)) long C_SYSC_mq_open (const char * u_name, int oflag, compat_mode_t mode, struct compat_mq_attr * u_attr) | |||||
52 | { | |||||
53 | void __user *p = NULL((void *)0); | |||||
54 | if (u_attr && oflag & O_CREAT00000100) { | |||||
55 | struct mq_attr attr; | |||||
56 | ||||||
57 | memset(&attr, 0, sizeof(attr)); | |||||
58 | ||||||
59 | p = compat_alloc_user_space(sizeof(attr)); | |||||
60 | if (get_compat_mq_attr(&attr, u_attr) || | |||||
61 | copy_to_user(p, &attr, sizeof(attr))) | |||||
62 | return -EFAULT14; | |||||
63 | } | |||||
64 | return sys_mq_open(u_name, oflag, mode, p); | |||||
65 | } | |||||
66 | ||||||
67 | COMPAT_SYSCALL_DEFINE5(mq_timedsend, mqd_t, mqdes,long compat_sys_mq_timedsend(mqd_t mqdes, const char * u_msg_ptr , compat_size_t msg_len, unsigned int msg_prio, const struct compat_timespec * u_abs_timeout) __attribute__((alias("compat_SyS_mq_timedsend" ))); static inline __attribute__((no_instrument_function)) long C_SYSC_mq_timedsend(mqd_t mqdes, const char * u_msg_ptr, compat_size_t msg_len, unsigned int msg_prio, const struct compat_timespec * u_abs_timeout); long compat_SyS_mq_timedsend(__typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t)0), typeof(0ULL ))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const char *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const char *)0), typeof(0ULL))), 0LL, 0L)) u_msg_ptr , __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((compat_size_t)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((compat_size_t)0), typeof(0ULL))), 0LL, 0L)) msg_len, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((unsigned int)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((unsigned int)0), typeof(0ULL))), 0LL, 0L)) msg_prio, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0ULL))), 0LL , 0L)) u_abs_timeout); long compat_SyS_mq_timedsend(__typeof( __builtin_choose_expr((__builtin_types_compatible_p(typeof((mqd_t )0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t )0), typeof(0ULL))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((const char *)0), typeof (0LL)) || __builtin_types_compatible_p(typeof((const char *)0 ), typeof(0ULL))), 0LL, 0L)) u_msg_ptr, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((compat_size_t)0), typeof (0LL)) || __builtin_types_compatible_p(typeof((compat_size_t) 0), typeof(0ULL))), 0LL, 0L)) msg_len, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((unsigned int)0), typeof (0LL)) || __builtin_types_compatible_p(typeof((unsigned int)0 ), typeof(0ULL))), 0LL, 0L)) msg_prio, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((const struct compat_timespec *)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((const struct compat_timespec *)0), typeof(0ULL))), 0LL, 0L)) u_abs_timeout ) { return C_SYSC_mq_timedsend(((mqd_t)(unsigned long)(mqdes) ), ((const char *)(unsigned long)(u_msg_ptr)), ((compat_size_t )(unsigned long)(msg_len)), ((unsigned int)(unsigned long)(msg_prio )), ((const struct compat_timespec *)(unsigned long)(u_abs_timeout ))); } static inline __attribute__((no_instrument_function)) long C_SYSC_mq_timedsend(mqd_t mqdes, const char * u_msg_ptr, compat_size_t msg_len, unsigned int msg_prio, const struct compat_timespec * u_abs_timeout) | |||||
68 | const char __user *, u_msg_ptr,long compat_sys_mq_timedsend(mqd_t mqdes, const char * u_msg_ptr , compat_size_t msg_len, unsigned int msg_prio, const struct compat_timespec * u_abs_timeout) __attribute__((alias("compat_SyS_mq_timedsend" ))); static inline __attribute__((no_instrument_function)) long C_SYSC_mq_timedsend(mqd_t mqdes, const char * u_msg_ptr, compat_size_t msg_len, unsigned int msg_prio, const struct compat_timespec * u_abs_timeout); long compat_SyS_mq_timedsend(__typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t)0), typeof(0ULL ))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const char *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const char *)0), typeof(0ULL))), 0LL, 0L)) u_msg_ptr , __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((compat_size_t)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((compat_size_t)0), typeof(0ULL))), 0LL, 0L)) msg_len, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((unsigned int)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((unsigned int)0), typeof(0ULL))), 0LL, 0L)) msg_prio, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0ULL))), 0LL , 0L)) u_abs_timeout); long compat_SyS_mq_timedsend(__typeof( __builtin_choose_expr((__builtin_types_compatible_p(typeof((mqd_t )0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t )0), typeof(0ULL))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((const char *)0), typeof (0LL)) || __builtin_types_compatible_p(typeof((const char *)0 ), typeof(0ULL))), 0LL, 0L)) u_msg_ptr, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((compat_size_t)0), typeof (0LL)) || __builtin_types_compatible_p(typeof((compat_size_t) 0), typeof(0ULL))), 0LL, 0L)) msg_len, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((unsigned int)0), typeof (0LL)) || __builtin_types_compatible_p(typeof((unsigned int)0 ), typeof(0ULL))), 0LL, 0L)) msg_prio, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((const struct compat_timespec *)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((const struct compat_timespec *)0), typeof(0ULL))), 0LL, 0L)) u_abs_timeout ) { return C_SYSC_mq_timedsend(((mqd_t)(unsigned long)(mqdes) ), ((const char *)(unsigned long)(u_msg_ptr)), ((compat_size_t )(unsigned long)(msg_len)), ((unsigned int)(unsigned long)(msg_prio )), ((const struct compat_timespec *)(unsigned long)(u_abs_timeout ))); } static inline __attribute__((no_instrument_function)) long C_SYSC_mq_timedsend(mqd_t mqdes, const char * u_msg_ptr, compat_size_t msg_len, unsigned int msg_prio, const struct compat_timespec * u_abs_timeout) | |||||
69 | compat_size_t, msg_len, unsigned int, msg_prio,long compat_sys_mq_timedsend(mqd_t mqdes, const char * u_msg_ptr , compat_size_t msg_len, unsigned int msg_prio, const struct compat_timespec * u_abs_timeout) __attribute__((alias("compat_SyS_mq_timedsend" ))); static inline __attribute__((no_instrument_function)) long C_SYSC_mq_timedsend(mqd_t mqdes, const char * u_msg_ptr, compat_size_t msg_len, unsigned int msg_prio, const struct compat_timespec * u_abs_timeout); long compat_SyS_mq_timedsend(__typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t)0), typeof(0ULL ))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const char *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const char *)0), typeof(0ULL))), 0LL, 0L)) u_msg_ptr , __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((compat_size_t)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((compat_size_t)0), typeof(0ULL))), 0LL, 0L)) msg_len, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((unsigned int)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((unsigned int)0), typeof(0ULL))), 0LL, 0L)) msg_prio, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0ULL))), 0LL , 0L)) u_abs_timeout); long compat_SyS_mq_timedsend(__typeof( __builtin_choose_expr((__builtin_types_compatible_p(typeof((mqd_t )0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t )0), typeof(0ULL))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((const char *)0), typeof (0LL)) || __builtin_types_compatible_p(typeof((const char *)0 ), typeof(0ULL))), 0LL, 0L)) u_msg_ptr, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((compat_size_t)0), typeof (0LL)) || __builtin_types_compatible_p(typeof((compat_size_t) 0), typeof(0ULL))), 0LL, 0L)) msg_len, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((unsigned int)0), typeof (0LL)) || __builtin_types_compatible_p(typeof((unsigned int)0 ), typeof(0ULL))), 0LL, 0L)) msg_prio, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((const struct compat_timespec *)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((const struct compat_timespec *)0), typeof(0ULL))), 0LL, 0L)) u_abs_timeout ) { return C_SYSC_mq_timedsend(((mqd_t)(unsigned long)(mqdes) ), ((const char *)(unsigned long)(u_msg_ptr)), ((compat_size_t )(unsigned long)(msg_len)), ((unsigned int)(unsigned long)(msg_prio )), ((const struct compat_timespec *)(unsigned long)(u_abs_timeout ))); } static inline __attribute__((no_instrument_function)) long C_SYSC_mq_timedsend(mqd_t mqdes, const char * u_msg_ptr, compat_size_t msg_len, unsigned int msg_prio, const struct compat_timespec * u_abs_timeout) | |||||
70 | const struct compat_timespec __user *, u_abs_timeout)long compat_sys_mq_timedsend(mqd_t mqdes, const char * u_msg_ptr , compat_size_t msg_len, unsigned int msg_prio, const struct compat_timespec * u_abs_timeout) __attribute__((alias("compat_SyS_mq_timedsend" ))); static inline __attribute__((no_instrument_function)) long C_SYSC_mq_timedsend(mqd_t mqdes, const char * u_msg_ptr, compat_size_t msg_len, unsigned int msg_prio, const struct compat_timespec * u_abs_timeout); long compat_SyS_mq_timedsend(__typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t)0), typeof(0ULL ))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const char *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const char *)0), typeof(0ULL))), 0LL, 0L)) u_msg_ptr , __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((compat_size_t)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((compat_size_t)0), typeof(0ULL))), 0LL, 0L)) msg_len, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((unsigned int)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((unsigned int)0), typeof(0ULL))), 0LL, 0L)) msg_prio, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0ULL))), 0LL , 0L)) u_abs_timeout); long compat_SyS_mq_timedsend(__typeof( __builtin_choose_expr((__builtin_types_compatible_p(typeof((mqd_t )0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t )0), typeof(0ULL))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((const char *)0), typeof (0LL)) || __builtin_types_compatible_p(typeof((const char *)0 ), typeof(0ULL))), 0LL, 0L)) u_msg_ptr, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((compat_size_t)0), typeof (0LL)) || __builtin_types_compatible_p(typeof((compat_size_t) 0), typeof(0ULL))), 0LL, 0L)) msg_len, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((unsigned int)0), typeof (0LL)) || __builtin_types_compatible_p(typeof((unsigned int)0 ), typeof(0ULL))), 0LL, 0L)) msg_prio, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((const struct compat_timespec *)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((const struct compat_timespec *)0), typeof(0ULL))), 0LL, 0L)) u_abs_timeout ) { return C_SYSC_mq_timedsend(((mqd_t)(unsigned long)(mqdes) ), ((const char *)(unsigned long)(u_msg_ptr)), ((compat_size_t )(unsigned long)(msg_len)), ((unsigned int)(unsigned long)(msg_prio )), ((const struct compat_timespec *)(unsigned long)(u_abs_timeout ))); } static inline __attribute__((no_instrument_function)) long C_SYSC_mq_timedsend(mqd_t mqdes, const char * u_msg_ptr, compat_size_t msg_len, unsigned int msg_prio, const struct compat_timespec * u_abs_timeout) | |||||
71 | { | |||||
72 | struct timespec __user *u_ts; | |||||
73 | ||||||
74 | if (compat_convert_timespec(&u_ts, u_abs_timeout)) | |||||
75 | return -EFAULT14; | |||||
76 | ||||||
77 | return sys_mq_timedsend(mqdes, u_msg_ptr, msg_len, | |||||
78 | msg_prio, u_ts); | |||||
79 | } | |||||
80 | ||||||
81 | COMPAT_SYSCALL_DEFINE5(mq_timedreceive, mqd_t, mqdes,long compat_sys_mq_timedreceive(mqd_t mqdes, char * u_msg_ptr , compat_size_t msg_len, unsigned int * u_msg_prio, const struct compat_timespec * u_abs_timeout) __attribute__((alias("compat_SyS_mq_timedreceive" ))); static inline __attribute__((no_instrument_function)) long C_SYSC_mq_timedreceive(mqd_t mqdes, char * u_msg_ptr, compat_size_t msg_len, unsigned int * u_msg_prio, const struct compat_timespec * u_abs_timeout); long compat_SyS_mq_timedreceive(__typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t)0), typeof(0ULL ))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((char *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((char *)0), typeof(0ULL))), 0LL, 0L)) u_msg_ptr, __typeof (__builtin_choose_expr((__builtin_types_compatible_p(typeof(( compat_size_t)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((compat_size_t)0), typeof(0ULL))), 0LL, 0L)) msg_len, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((unsigned int *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((unsigned int *)0), typeof(0ULL))), 0LL, 0L)) u_msg_prio , __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0ULL))), 0LL , 0L)) u_abs_timeout); long compat_SyS_mq_timedreceive(__typeof (__builtin_choose_expr((__builtin_types_compatible_p(typeof(( mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof ((mqd_t)0), typeof(0ULL))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((char *)0), typeof(0LL) ) || __builtin_types_compatible_p(typeof((char *)0), typeof(0ULL ))), 0LL, 0L)) u_msg_ptr, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((compat_size_t)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((compat_size_t)0), typeof(0ULL))), 0LL, 0L)) msg_len, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((unsigned int *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((unsigned int *)0), typeof(0ULL))), 0LL, 0L)) u_msg_prio , __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0ULL))), 0LL , 0L)) u_abs_timeout) { return C_SYSC_mq_timedreceive(((mqd_t )(unsigned long)(mqdes)), ((char *)(unsigned long)(u_msg_ptr) ), ((compat_size_t)(unsigned long)(msg_len)), ((unsigned int * )(unsigned long)(u_msg_prio)), ((const struct compat_timespec *)(unsigned long)(u_abs_timeout))); } static inline __attribute__ ((no_instrument_function)) long C_SYSC_mq_timedreceive(mqd_t mqdes , char * u_msg_ptr, compat_size_t msg_len, unsigned int * u_msg_prio , const struct compat_timespec * u_abs_timeout) | |||||
82 | char __user *, u_msg_ptr,long compat_sys_mq_timedreceive(mqd_t mqdes, char * u_msg_ptr , compat_size_t msg_len, unsigned int * u_msg_prio, const struct compat_timespec * u_abs_timeout) __attribute__((alias("compat_SyS_mq_timedreceive" ))); static inline __attribute__((no_instrument_function)) long C_SYSC_mq_timedreceive(mqd_t mqdes, char * u_msg_ptr, compat_size_t msg_len, unsigned int * u_msg_prio, const struct compat_timespec * u_abs_timeout); long compat_SyS_mq_timedreceive(__typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t)0), typeof(0ULL ))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((char *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((char *)0), typeof(0ULL))), 0LL, 0L)) u_msg_ptr, __typeof (__builtin_choose_expr((__builtin_types_compatible_p(typeof(( compat_size_t)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((compat_size_t)0), typeof(0ULL))), 0LL, 0L)) msg_len, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((unsigned int *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((unsigned int *)0), typeof(0ULL))), 0LL, 0L)) u_msg_prio , __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0ULL))), 0LL , 0L)) u_abs_timeout); long compat_SyS_mq_timedreceive(__typeof (__builtin_choose_expr((__builtin_types_compatible_p(typeof(( mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof ((mqd_t)0), typeof(0ULL))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((char *)0), typeof(0LL) ) || __builtin_types_compatible_p(typeof((char *)0), typeof(0ULL ))), 0LL, 0L)) u_msg_ptr, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((compat_size_t)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((compat_size_t)0), typeof(0ULL))), 0LL, 0L)) msg_len, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((unsigned int *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((unsigned int *)0), typeof(0ULL))), 0LL, 0L)) u_msg_prio , __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0ULL))), 0LL , 0L)) u_abs_timeout) { return C_SYSC_mq_timedreceive(((mqd_t )(unsigned long)(mqdes)), ((char *)(unsigned long)(u_msg_ptr) ), ((compat_size_t)(unsigned long)(msg_len)), ((unsigned int * )(unsigned long)(u_msg_prio)), ((const struct compat_timespec *)(unsigned long)(u_abs_timeout))); } static inline __attribute__ ((no_instrument_function)) long C_SYSC_mq_timedreceive(mqd_t mqdes , char * u_msg_ptr, compat_size_t msg_len, unsigned int * u_msg_prio , const struct compat_timespec * u_abs_timeout) | |||||
83 | compat_size_t, msg_len, unsigned int __user *, u_msg_prio,long compat_sys_mq_timedreceive(mqd_t mqdes, char * u_msg_ptr , compat_size_t msg_len, unsigned int * u_msg_prio, const struct compat_timespec * u_abs_timeout) __attribute__((alias("compat_SyS_mq_timedreceive" ))); static inline __attribute__((no_instrument_function)) long C_SYSC_mq_timedreceive(mqd_t mqdes, char * u_msg_ptr, compat_size_t msg_len, unsigned int * u_msg_prio, const struct compat_timespec * u_abs_timeout); long compat_SyS_mq_timedreceive(__typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t)0), typeof(0ULL ))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((char *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((char *)0), typeof(0ULL))), 0LL, 0L)) u_msg_ptr, __typeof (__builtin_choose_expr((__builtin_types_compatible_p(typeof(( compat_size_t)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((compat_size_t)0), typeof(0ULL))), 0LL, 0L)) msg_len, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((unsigned int *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((unsigned int *)0), typeof(0ULL))), 0LL, 0L)) u_msg_prio , __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0ULL))), 0LL , 0L)) u_abs_timeout); long compat_SyS_mq_timedreceive(__typeof (__builtin_choose_expr((__builtin_types_compatible_p(typeof(( mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof ((mqd_t)0), typeof(0ULL))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((char *)0), typeof(0LL) ) || __builtin_types_compatible_p(typeof((char *)0), typeof(0ULL ))), 0LL, 0L)) u_msg_ptr, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((compat_size_t)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((compat_size_t)0), typeof(0ULL))), 0LL, 0L)) msg_len, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((unsigned int *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((unsigned int *)0), typeof(0ULL))), 0LL, 0L)) u_msg_prio , __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0ULL))), 0LL , 0L)) u_abs_timeout) { return C_SYSC_mq_timedreceive(((mqd_t )(unsigned long)(mqdes)), ((char *)(unsigned long)(u_msg_ptr) ), ((compat_size_t)(unsigned long)(msg_len)), ((unsigned int * )(unsigned long)(u_msg_prio)), ((const struct compat_timespec *)(unsigned long)(u_abs_timeout))); } static inline __attribute__ ((no_instrument_function)) long C_SYSC_mq_timedreceive(mqd_t mqdes , char * u_msg_ptr, compat_size_t msg_len, unsigned int * u_msg_prio , const struct compat_timespec * u_abs_timeout) | |||||
84 | const struct compat_timespec __user *, u_abs_timeout)long compat_sys_mq_timedreceive(mqd_t mqdes, char * u_msg_ptr , compat_size_t msg_len, unsigned int * u_msg_prio, const struct compat_timespec * u_abs_timeout) __attribute__((alias("compat_SyS_mq_timedreceive" ))); static inline __attribute__((no_instrument_function)) long C_SYSC_mq_timedreceive(mqd_t mqdes, char * u_msg_ptr, compat_size_t msg_len, unsigned int * u_msg_prio, const struct compat_timespec * u_abs_timeout); long compat_SyS_mq_timedreceive(__typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t)0), typeof(0ULL ))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((char *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((char *)0), typeof(0ULL))), 0LL, 0L)) u_msg_ptr, __typeof (__builtin_choose_expr((__builtin_types_compatible_p(typeof(( compat_size_t)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((compat_size_t)0), typeof(0ULL))), 0LL, 0L)) msg_len, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((unsigned int *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((unsigned int *)0), typeof(0ULL))), 0LL, 0L)) u_msg_prio , __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0ULL))), 0LL , 0L)) u_abs_timeout); long compat_SyS_mq_timedreceive(__typeof (__builtin_choose_expr((__builtin_types_compatible_p(typeof(( mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof ((mqd_t)0), typeof(0ULL))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((char *)0), typeof(0LL) ) || __builtin_types_compatible_p(typeof((char *)0), typeof(0ULL ))), 0LL, 0L)) u_msg_ptr, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((compat_size_t)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((compat_size_t)0), typeof(0ULL))), 0LL, 0L)) msg_len, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((unsigned int *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((unsigned int *)0), typeof(0ULL))), 0LL, 0L)) u_msg_prio , __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_timespec *)0), typeof(0ULL))), 0LL , 0L)) u_abs_timeout) { return C_SYSC_mq_timedreceive(((mqd_t )(unsigned long)(mqdes)), ((char *)(unsigned long)(u_msg_ptr) ), ((compat_size_t)(unsigned long)(msg_len)), ((unsigned int * )(unsigned long)(u_msg_prio)), ((const struct compat_timespec *)(unsigned long)(u_abs_timeout))); } static inline __attribute__ ((no_instrument_function)) long C_SYSC_mq_timedreceive(mqd_t mqdes , char * u_msg_ptr, compat_size_t msg_len, unsigned int * u_msg_prio , const struct compat_timespec * u_abs_timeout) | |||||
85 | { | |||||
86 | struct timespec __user *u_ts; | |||||
87 | ||||||
88 | if (compat_convert_timespec(&u_ts, u_abs_timeout)) | |||||
89 | return -EFAULT14; | |||||
90 | ||||||
91 | return sys_mq_timedreceive(mqdes, u_msg_ptr, msg_len, | |||||
92 | u_msg_prio, u_ts); | |||||
93 | } | |||||
94 | ||||||
95 | COMPAT_SYSCALL_DEFINE2(mq_notify, mqd_t, mqdes,long compat_sys_mq_notify(mqd_t mqdes, const struct compat_sigevent * u_notification) __attribute__((alias("compat_SyS_mq_notify" ))); static inline __attribute__((no_instrument_function)) long C_SYSC_mq_notify(mqd_t mqdes, const struct compat_sigevent * u_notification); long compat_SyS_mq_notify(__typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t)0), typeof(0ULL ))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_sigevent *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_sigevent *)0), typeof(0ULL))), 0LL , 0L)) u_notification); long compat_SyS_mq_notify(__typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t)0), typeof(0ULL ))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_sigevent *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_sigevent *)0), typeof(0ULL))), 0LL , 0L)) u_notification) { return C_SYSC_mq_notify(((mqd_t)(unsigned long)(mqdes)), ((const struct compat_sigevent *)(unsigned long )(u_notification))); } static inline __attribute__((no_instrument_function )) long C_SYSC_mq_notify(mqd_t mqdes, const struct compat_sigevent * u_notification) | |||||
| ||||||
96 | const struct compat_sigevent __user *, u_notification)long compat_sys_mq_notify(mqd_t mqdes, const struct compat_sigevent * u_notification) __attribute__((alias("compat_SyS_mq_notify" ))); static inline __attribute__((no_instrument_function)) long C_SYSC_mq_notify(mqd_t mqdes, const struct compat_sigevent * u_notification); long compat_SyS_mq_notify(__typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t)0), typeof(0ULL ))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_sigevent *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_sigevent *)0), typeof(0ULL))), 0LL , 0L)) u_notification); long compat_SyS_mq_notify(__typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t)0), typeof(0ULL ))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_sigevent *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_sigevent *)0), typeof(0ULL))), 0LL , 0L)) u_notification) { return C_SYSC_mq_notify(((mqd_t)(unsigned long)(mqdes)), ((const struct compat_sigevent *)(unsigned long )(u_notification))); } static inline __attribute__((no_instrument_function )) long C_SYSC_mq_notify(mqd_t mqdes, const struct compat_sigevent * u_notification) | |||||
97 | { | |||||
98 | struct sigevent __user *p = NULL((void *)0); | |||||
99 | if (u_notification) { | |||||
100 | struct sigevent n; | |||||
101 | p = compat_alloc_user_space(sizeof(*p)); | |||||
102 | if (get_compat_sigevent(&n, u_notification)) | |||||
103 | return -EFAULT14; | |||||
104 | if (n.sigev_notify == SIGEV_THREAD2) | |||||
105 | n.sigev_value.sival_ptr = compat_ptr(n.sigev_value.sival_int); | |||||
106 | if (copy_to_user(p, &n, sizeof(*p))) | |||||
| ||||||
107 | return -EFAULT14; | |||||
108 | } | |||||
109 | return sys_mq_notify(mqdes, p); | |||||
110 | } | |||||
111 | ||||||
112 | COMPAT_SYSCALL_DEFINE3(mq_getsetattr, mqd_t, mqdes,long compat_sys_mq_getsetattr(mqd_t mqdes, const struct compat_mq_attr * u_mqstat, struct compat_mq_attr * u_omqstat) __attribute__ ((alias("compat_SyS_mq_getsetattr"))); static inline __attribute__ ((no_instrument_function)) long C_SYSC_mq_getsetattr(mqd_t mqdes , const struct compat_mq_attr * u_mqstat, struct compat_mq_attr * u_omqstat); long compat_SyS_mq_getsetattr(__typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t)0), typeof(0ULL ))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_mq_attr *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_mq_attr *)0), typeof(0ULL))), 0LL , 0L)) u_mqstat, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((struct compat_mq_attr *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((struct compat_mq_attr *)0), typeof(0ULL))), 0LL, 0L) ) u_omqstat); long compat_SyS_mq_getsetattr(__typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t)0), typeof(0ULL ))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_mq_attr *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_mq_attr *)0), typeof(0ULL))), 0LL , 0L)) u_mqstat, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((struct compat_mq_attr *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((struct compat_mq_attr *)0), typeof(0ULL))), 0LL, 0L) ) u_omqstat) { return C_SYSC_mq_getsetattr(((mqd_t)(unsigned long )(mqdes)), ((const struct compat_mq_attr *)(unsigned long)(u_mqstat )), ((struct compat_mq_attr *)(unsigned long)(u_omqstat))); } static inline __attribute__((no_instrument_function)) long C_SYSC_mq_getsetattr (mqd_t mqdes, const struct compat_mq_attr * u_mqstat, struct compat_mq_attr * u_omqstat) | |||||
113 | const struct compat_mq_attr __user *, u_mqstat,long compat_sys_mq_getsetattr(mqd_t mqdes, const struct compat_mq_attr * u_mqstat, struct compat_mq_attr * u_omqstat) __attribute__ ((alias("compat_SyS_mq_getsetattr"))); static inline __attribute__ ((no_instrument_function)) long C_SYSC_mq_getsetattr(mqd_t mqdes , const struct compat_mq_attr * u_mqstat, struct compat_mq_attr * u_omqstat); long compat_SyS_mq_getsetattr(__typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t)0), typeof(0ULL ))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_mq_attr *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_mq_attr *)0), typeof(0ULL))), 0LL , 0L)) u_mqstat, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((struct compat_mq_attr *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((struct compat_mq_attr *)0), typeof(0ULL))), 0LL, 0L) ) u_omqstat); long compat_SyS_mq_getsetattr(__typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t)0), typeof(0ULL ))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_mq_attr *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_mq_attr *)0), typeof(0ULL))), 0LL , 0L)) u_mqstat, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((struct compat_mq_attr *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((struct compat_mq_attr *)0), typeof(0ULL))), 0LL, 0L) ) u_omqstat) { return C_SYSC_mq_getsetattr(((mqd_t)(unsigned long )(mqdes)), ((const struct compat_mq_attr *)(unsigned long)(u_mqstat )), ((struct compat_mq_attr *)(unsigned long)(u_omqstat))); } static inline __attribute__((no_instrument_function)) long C_SYSC_mq_getsetattr (mqd_t mqdes, const struct compat_mq_attr * u_mqstat, struct compat_mq_attr * u_omqstat) | |||||
114 | struct compat_mq_attr __user *, u_omqstat)long compat_sys_mq_getsetattr(mqd_t mqdes, const struct compat_mq_attr * u_mqstat, struct compat_mq_attr * u_omqstat) __attribute__ ((alias("compat_SyS_mq_getsetattr"))); static inline __attribute__ ((no_instrument_function)) long C_SYSC_mq_getsetattr(mqd_t mqdes , const struct compat_mq_attr * u_mqstat, struct compat_mq_attr * u_omqstat); long compat_SyS_mq_getsetattr(__typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t)0), typeof(0ULL ))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_mq_attr *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_mq_attr *)0), typeof(0ULL))), 0LL , 0L)) u_mqstat, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((struct compat_mq_attr *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((struct compat_mq_attr *)0), typeof(0ULL))), 0LL, 0L) ) u_omqstat); long compat_SyS_mq_getsetattr(__typeof(__builtin_choose_expr ((__builtin_types_compatible_p(typeof((mqd_t)0), typeof(0LL)) || __builtin_types_compatible_p(typeof((mqd_t)0), typeof(0ULL ))), 0LL, 0L)) mqdes, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((const struct compat_mq_attr *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((const struct compat_mq_attr *)0), typeof(0ULL))), 0LL , 0L)) u_mqstat, __typeof(__builtin_choose_expr((__builtin_types_compatible_p (typeof((struct compat_mq_attr *)0), typeof(0LL)) || __builtin_types_compatible_p (typeof((struct compat_mq_attr *)0), typeof(0ULL))), 0LL, 0L) ) u_omqstat) { return C_SYSC_mq_getsetattr(((mqd_t)(unsigned long )(mqdes)), ((const struct compat_mq_attr *)(unsigned long)(u_mqstat )), ((struct compat_mq_attr *)(unsigned long)(u_omqstat))); } static inline __attribute__((no_instrument_function)) long C_SYSC_mq_getsetattr (mqd_t mqdes, const struct compat_mq_attr * u_mqstat, struct compat_mq_attr * u_omqstat) | |||||
115 | { | |||||
116 | struct mq_attr mqstat; | |||||
117 | struct mq_attr __user *p = compat_alloc_user_space(2 * sizeof(*p)); | |||||
118 | long ret; | |||||
119 | ||||||
120 | memset(&mqstat, 0, sizeof(mqstat)); | |||||
121 | ||||||
122 | if (u_mqstat) { | |||||
123 | if (get_compat_mq_attr(&mqstat, u_mqstat) || | |||||
124 | copy_to_user(p, &mqstat, sizeof(mqstat))) | |||||
125 | return -EFAULT14; | |||||
126 | } | |||||
127 | ret = sys_mq_getsetattr(mqdes, | |||||
128 | u_mqstat ? p : NULL((void *)0), | |||||
129 | u_omqstat ? p + 1 : NULL((void *)0)); | |||||
130 | if (ret) | |||||
131 | return ret; | |||||
132 | if (u_omqstat) { | |||||
133 | if (copy_from_user(&mqstat, p + 1, sizeof(mqstat)) || | |||||
134 | put_compat_mq_attr(&mqstat, u_omqstat)) | |||||
135 | return -EFAULT14; | |||||
136 | } | |||||
137 | return 0; | |||||
138 | } |