lkml.org 
[lkml]   [2000]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: User-mode linux stack overflow: could be generic problem
Date
From
Thank you!

I've been waiting for someone to send me that stack. There aren't any real
smoking guns there. I'm guessing that the difference between your laptop and
the machine it works on is that your laptop is running a fairly recent kernel
(2.4.0-testx) and the other isn't. The sigcontext struct greatly increased in
size (to ~800 bytes IIRC) to accomodate the MMX registers or something. There
are three signals on your stack, so those frames by themselves are taking up
half the stack page.

Anyway, the patch below removes 256 bytes from the set_signals frame. It
ought to alleviate things a bit. I'll be looking for other things I can do,
as well. Let me know how it works for you.

Jeff

--- arch/um/kernel/signal_user.c~ Thu Sep 14 17:00:08 2000
+++ arch/um/kernel/signal_user.c Sun Oct 8 00:21:29 2000
@@ -45,26 +45,29 @@

int set_signals(int enable)
{
- sigset_t mask, unmask, old;
+ sigset_t mask;
+ int ret;

check_stack_overflow(&enable);
+ sigprocmask(SIG_BLOCK, NULL, &mask);
+ ret = enable_mask(&mask);
sigemptyset(&mask);
- sigemptyset(&unmask);
- if(enable & (1 << SIGIO_BIT)) sigaddset(&unmask, SIGIO);
- else sigaddset(&mask, SIGIO);
+ if(enable & (1 << SIGIO_BIT)) sigaddset(&mask, SIGIO);
if(enable & (1 << SIGVTALRM_BIT)){
- sigaddset(&unmask, SIGVTALRM);
- sigaddset(&unmask, SIGALRM);
+ sigaddset(&mask, SIGVTALRM);
+ sigaddset(&mask, SIGALRM);
}
- else {
+ if(sigprocmask(SIG_UNBLOCK, &mask, NULL) < 0)
+ panic("Failed to enable signals");
+ sigemptyset(&mask);
+ if((enable & (1 << SIGIO_BIT)) == 0) sigaddset(&mask, SIGIO);
+ if((enable & (1 << SIGVTALRM_BIT)) == 0){
sigaddset(&mask, SIGVTALRM);
sigaddset(&mask, SIGALRM);
}
- if(sigprocmask(SIG_BLOCK, &mask, &old) < 0)
- panic("Failed to change signal mask");
- if(sigprocmask(SIG_UNBLOCK, &unmask, NULL) < 0)
- panic("Failed to change signal mask");
- return(enable_mask(&old));
+ if(sigprocmask(SIG_BLOCK, &mask, NULL) < 0)
+ panic("Failed to block signals");
+ return(ret);
}

/*

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:08    [W:0.048 / U:2.308 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site