Commit d7d5f9fd authored by Andrei Vagin's avatar Andrei Vagin

zdtm/sigpending: check only relevant part of siginfo

Recently, a kernel behaviour how siginfo is copied into user-space was
changed:

4ce5f9c9e754 ("signal: Use a smaller struct siginfo in the kernel")

According to the rt_sigqueueinfo man page, the caller should set
si_code, si_pid, si_uid, si_value and there is no guarantee about other
fields.
Signed-off-by: 's avatarAndrei Vagin <avagin@gmail.com>
parent c74b83cd
...@@ -46,9 +46,8 @@ typedef union cr_siginfo cr_siginfo_t; ...@@ -46,9 +46,8 @@ typedef union cr_siginfo cr_siginfo_t;
#define siginf_body(s) (&((cr_siginfo_t *)(s))->_info._sifields) #define siginf_body(s) (&((cr_siginfo_t *)(s))->_info._sifields)
#ifdef __i386__
/* /*
* On x86_32 kernel puts only relevant union member when signal arrives, * The kernel puts only relevant union member when signal arrives,
* leaving _si_fields to be filled with junk from stack. Check only * leaving _si_fields to be filled with junk from stack. Check only
* first 12 bytes: * first 12 bytes:
* // POSIX.1b signals. * // POSIX.1b signals.
...@@ -61,9 +60,6 @@ typedef union cr_siginfo cr_siginfo_t; ...@@ -61,9 +60,6 @@ typedef union cr_siginfo cr_siginfo_t;
* Look at __copy_siginfo_to_user32() for more information. * Look at __copy_siginfo_to_user32() for more information.
*/ */
# define _si_fields_sz 12 # define _si_fields_sz 12
#else
# define _si_fields_sz (sizeof(siginfo_t) - offsetof(cr_siginfo_t, _info._sifields))
#endif
#define siginfo_filled (offsetof(cr_siginfo_t, _info._sifields) + _si_fields_sz) #define siginfo_filled (offsetof(cr_siginfo_t, _info._sifields) + _si_fields_sz)
static pthread_mutex_t exit_lock; static pthread_mutex_t exit_lock;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment