mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
sigaltstack: support SS_AUTODISARM for CONFIG_COMPAT
Currently SS_AUTODISARM is not supported in compatibility mode, but does not return -EINVAL either. This makes dosemu built with -m32 on x86_64 to crash. Also the kernel's sigaltstack selftest fails if compiled with -m32. This patch adds the needed support. Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Stas Sergeev <[email protected]> Cc: Milosz Tanski <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Al Viro <[email protected]> Cc: Arnd Bergmann <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Nicolas Pitre <[email protected]> Cc: Waiman Long <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Dmitry Safonov <[email protected]> Cc: Wang Xiaoqiang <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
b899ba7d8c
commit
441398d378
2 changed files with 12 additions and 3 deletions
|
|
@ -3239,10 +3239,17 @@ int compat_restore_altstack(const compat_stack_t __user *uss)
|
|||
|
||||
int __compat_save_altstack(compat_stack_t __user *uss, unsigned long sp)
|
||||
{
|
||||
int err;
|
||||
struct task_struct *t = current;
|
||||
return __put_user(ptr_to_compat((void __user *)t->sas_ss_sp), &uss->ss_sp) |
|
||||
__put_user(sas_ss_flags(sp), &uss->ss_flags) |
|
||||
err = __put_user(ptr_to_compat((void __user *)t->sas_ss_sp),
|
||||
&uss->ss_sp) |
|
||||
__put_user(t->sas_ss_flags, &uss->ss_flags) |
|
||||
__put_user(t->sas_ss_size, &uss->ss_size);
|
||||
if (err)
|
||||
return err;
|
||||
if (t->sas_ss_flags & SS_AUTODISARM)
|
||||
sas_ss_reset(t);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue