Messages in this thread | | | Subject | Re: wait4/waitpid/waitid oddness | From | (Eric W. Biederman) | Date | Fri, 07 Apr 2006 13:19:41 -0600 |
| |
"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/
| |