lkml.org 
[lkml]   [2004]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] waitid system call
> Is it really necessary to check the exit code after each put_user?
> if (!retval && access_ok(VERIFY_WRITE, infop, sizeof(*infop)))) {
> retval = __put_user(0, &infop->si_signo);
> retval |= __put_user(0, &infop->si_errno);
> retval |= __put_user(0, &infop->si_code);
> retval |= __put_user(0, &infop->si_pid);
> retval |= __put_user(0, &infop->si_uid);
> retval |= __put_user(0, &infop->si_status);
> }
> is what kernel usually does when filling multiple structure members.

That is certainly fine by me, but shouldn't that be setting retval to
-EFAULT if access_ok fails? The waitid patch has a couple of other spots
where those several members are filled in and the code uses the several if's.
If one should change I suppose they all should.


Thanks,
Roland
-
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: 2005-03-22 14:05    [W:0.069 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site