Re: wait4/waitpid/waitid oddness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Joshua Hudson" <[email protected]> writes:

> On 4/7/06, Eric W. Biederman <[email protected]> wrote:
>> "Albert Cahalan" <[email protected]> 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux