Re: wait4/waitpid/waitid oddness
From: Eric W. Biederman
Date: Fri Apr 07 2006 - 15:21:04 EST
"Joshua Hudson" <joshudson@xxxxxxxxx> writes:
> On 4/7/06, Eric W. Biederman <ebiederm@xxxxxxxxxxxx> wrote:
>> "Albert Cahalan" <acahalan@xxxxxxxxx> 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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/