Commit 95210f58 authored by Arun Sharma's avatar Arun Sharma Committed by David Mosberger

[PATCH] ia64: MINSIGSTKSZ on ia32

MINSIGSTKSZ is defined differently for i386 and ia64. This patch improves
compatibility with apps which use sigaltstack(2) with sizes between
MINSIGSTKSZ_IA32 and MINSIGSTKSZ.
parent 327d6c7d
...@@ -76,6 +76,7 @@ ...@@ -76,6 +76,7 @@
#define OFFSET4K(a) ((a) & 0xfff) #define OFFSET4K(a) ((a) & 0xfff)
#define PAGE_START(addr) ((addr) & PAGE_MASK) #define PAGE_START(addr) ((addr) & PAGE_MASK)
#define MINSIGSTKSZ_IA32 2048
#define high2lowuid(uid) ((uid) > 65535 ? 65534 : (uid)) #define high2lowuid(uid) ((uid) > 65535 ? 65534 : (uid))
#define high2lowgid(gid) ((gid) > 65535 ? 65534 : (gid)) #define high2lowgid(gid) ((gid) > 65535 ? 65534 : (gid))
...@@ -2262,10 +2263,18 @@ sys32_sigaltstack (ia32_stack_t *uss32, ia32_stack_t *uoss32, ...@@ -2262,10 +2263,18 @@ sys32_sigaltstack (ia32_stack_t *uss32, ia32_stack_t *uoss32,
return -EFAULT; return -EFAULT;
uss.ss_sp = (void *) (long) buf32.ss_sp; uss.ss_sp = (void *) (long) buf32.ss_sp;
uss.ss_flags = buf32.ss_flags; uss.ss_flags = buf32.ss_flags;
uss.ss_size = buf32.ss_size; /* MINSIGSTKSZ is different for ia32 vs ia64. We lie here to pass the
check and set it to the user requested value later */
if (buf32.ss_size < MINSIGSTKSZ_IA32) {
ret = -ENOMEM;
goto out;
}
uss.ss_size = MINSIGSTKSZ;
set_fs(KERNEL_DS); set_fs(KERNEL_DS);
ret = do_sigaltstack(uss32 ? &uss : NULL, &uoss, pt->r12); ret = do_sigaltstack(uss32 ? &uss : NULL, &uoss, pt->r12);
current->sas_ss_size = buf32.ss_size;
set_fs(old_fs); set_fs(old_fs);
out:
if (ret < 0) if (ret < 0)
return(ret); return(ret);
if (uoss32) { if (uoss32) {
......
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