lkml.org 
[lkml]   [2006]   [Apr]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: wait4/waitpid/waitid oddness
From
Date
"Joshua Hudson" <joshudson@gmail.com> writes:

> On 4/7/06, Eric W. Biederman <ebiederm@xmission.com> wrote:
>> "Albert Cahalan" <acahalan@gmail.com> writes:
>>
>> > The kernel prohibits:
>> >
>> > 1. WNOHANG on waitpid/wait4
>>
>> Not 2.6.17-rc1, and not for a lot of earlier kernels.
>> At least not on ingress, and just skimming the code
>> I can't see any deeper checks that would prevent this.
>>
>> > 2. __WALL on waitid
>> >
>> > Why? I need both at once.
>>
>> Which kernel is failing, and how?
>
> LKNL 2.6.16.1 has this check. Haven't checked any others.

So what I see current in wait4 is:
> asmlinkage long sys_wait4(pid_t pid, int __user *stat_addr,
> int options, struct rusage __user *ru)
> {
> long ret;
>
> if (options & ~(WNOHANG|WUNTRACED|WCONTINUED|
> __WNOTHREAD|__WCLONE|__WALL))
> return -EINVAL;

This denies access if you use other flags but it should allow
__WALL and WNOHANG together. I didn't see anything in do_wait,
that would prohibit this.

> ret = do_wait(pid, options | WEXITED, NULL, stat_addr, ru);
>
> /* avoid REGPARM breakage on x86: */
> prevent_tail_call(ret);
> return ret;
> }

So where are you seeing the check in 2.6.16.1?

Eric


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

\
 
 \ /
  Last update: 2006-04-07 21:23    [W:1.835 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site