Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1573718

Re: [PATCH] sigaltstack: support SS_AUTODISARM for CONFIG_COMPAT

From Andy Lutomirski <luto@amacapital.net>
Newsgroups linux.kernel
Subject Re: [PATCH] sigaltstack: support SS_AUTODISARM for CONFIG_COMPAT
Date 2017-02-04 18:40 +0100
Message-ID <t7ctz-3H6-3@gated-at.bofh.it> (permalink)
References <t7ctz-3H6-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sat, Feb 4, 2017 at 4:07 AM, Stas Sergeev <stsp@list.ru> wrote:
> 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. It also improves the
> selftest output a little (%i changed to %x for bitmasks).
>
> Signed-off-by: Stas Sergeev <stsp@users.sourceforge.net>
>

Spurious newline.  Also, should this be cc:stable?

> CC: Shuah Khan <shuahkh@osg.samsung.com>
> CC: Andrew Morton <akpm@linux-foundation.org>
> CC: Jiri Kosina <jkosina@suse.cz>
> CC: Al Viro <viro@zeniv.linux.org.uk>
> CC: Stephen Bates <stephen.bates@pmcs.com>
> CC: Milosz Tanski <milosz@adfin.com>
> CC: Andy Lutomirski <luto@kernel.org>
> CC: Ingo Molnar <mingo@kernel.org>
> CC: "Peter Zijlstra (Intel)" <peterz@infradead.org>
> CC: Helge Deller <deller@gmx.de>
> CC: Wang Xiaoqiang <wangxq10@lzu.edu.cn>
> CC: Dave Hansen <dave.hansen@linux.intel.com>
> CC: Sasha Levin <sasha.levin@oracle.com>
> CC: linux-kernel@vger.kernel.org
> ---
>  include/linux/compat.h                    |  4 +++-
>  kernel/signal.c                           | 11 +++++++++--
>  tools/testing/selftests/sigaltstack/sas.c |  7 ++++---
>  3 files changed, 16 insertions(+), 6 deletions(-)
>
> diff --git a/include/linux/compat.h b/include/linux/compat.h
> index 6360939..d8535a4 100644
> --- a/include/linux/compat.h
> +++ b/include/linux/compat.h
> @@ -711,8 +711,10 @@ int __compat_save_altstack(compat_stack_t __user *, unsigned long);
>         compat_stack_t __user *__uss = uss; \
>         struct task_struct *t = current; \
>         put_user_ex(ptr_to_compat((void __user *)t->sas_ss_sp), &__uss->ss_sp); \
> -       put_user_ex(sas_ss_flags(sp), &__uss->ss_flags); \
> +       put_user_ex(t->sas_ss_flags, &__uss->ss_flags); \

Should the sas_ss_flags() helper be deleted, perhaps?  This code seems
a bit odd -- it no longer does the on_sig_stack(sp) check..  (It
matches the non-compat code.)

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH] sigaltstack: support SS_AUTODISARM for CONFIG_COMPAT Andy Lutomirski <luto@amacapital.net> - 2017-02-04 18:40 +0100
  Re: [PATCH] sigaltstack: support SS_AUTODISARM for CONFIG_COMPAT Stas Sergeev <stsp@list.ru> - 2017-02-04 19:00 +0100

csiph-web