Re: compat_sys_times() bogus until jiffies >= 0.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: <lkml@...>, <linux-kernel@...>, <drepper@...>, <mtk-manpages@...>
Date: Wednesday, November 7, 2007 - 9:53 pm

Andrew Morton writes:


I think the best thing would be to ignore any error from copy_to_user
and always return the number of clock ticks.  We should call
force_successful_syscall_return, and glibc on x86 should be taught not
to interpret negative values as an error.

POSIX doesn't require us to return an EFAULT error if the buf argument
is bogus.  If userspace does supply a bogus buf pointer, then either
it will dereference it itself and get a segfault, or it won't
dereference it, in which case it obviously didn't care about the
values we tried to put there.

If we try to return an error under some circumstances, then there is
at least one 32-bit value for the number of ticks that will cause
confusion.  We can either change that value (or values) to some other
value, which seems pretty bogus, or we can just decide not to return
any errors.  The latter seems to me to have no significant downside
and to be the simplest solution to the problem.

Paul.
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
compat_sys_times() bogus until jiffies &gt;= 0., David Brown, (Wed Nov 7, 6:47 pm)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Andrew Morton, (Wed Nov 7, 7:28 pm)
Re: compat_sys_times() bogus until jiffies &gt;= 0., David Brown, (Thu Nov 8, 2:00 am)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Andrew Morton, (Wed Nov 7, 8:18 pm)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Andreas Schwab, (Wed Nov 7, 8:54 pm)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Andrew Morton, (Wed Nov 7, 9:17 pm)
Re: compat_sys_times() bogus until jiffies >= 0., Paul Mackerras, (Wed Nov 7, 9:53 pm)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Andrew Morton, (Wed Nov 7, 11:07 pm)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Denys Vlasenko, (Thu Nov 8, 3:27 pm)
Re: compat_sys_times() bogus until jiffies &gt;= 0., David Miller, (Wed Nov 7, 11:13 pm)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Paul Mackerras, (Thu Nov 8, 1:15 am)
Re: compat_sys_times() bogus until jiffies &gt;= 0., David Miller, (Thu Nov 8, 2:24 am)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Paul Mackerras, (Thu Nov 8, 12:59 am)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Andrew Morton, (Thu Nov 8, 1:20 am)
Re: compat_sys_times() bogus until jiffies &gt;= 0., David Miller, (Thu Nov 8, 2:25 am)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Andrew Morton, (Thu Nov 8, 3:09 am)
Re: compat_sys_times() bogus until jiffies &gt;= 0., David Miller, (Thu Nov 8, 3:14 am)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Paul Mackerras, (Thu Nov 8, 4:53 am)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Paul Mackerras, (Thu Nov 8, 1:36 am)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Andrew Morton, (Thu Nov 8, 2:12 am)
Re: compat_sys_times() bogus until jiffies &gt;= 0., David Miller, (Thu Nov 8, 2:22 am)
Re: compat_sys_times() bogus until jiffies &gt;= 0., David Miller, (Wed Nov 7, 10:09 pm)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Andreas Schwab, (Thu Nov 8, 6:20 am)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Chris Friesen, (Thu Nov 8, 10:42 am)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Ulrich Drepper, (Fri Nov 9, 2:20 pm)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Michael Kerrisk, (Thu Dec 20, 7:36 am)
Re: compat_sys_times() bogus until jiffies &gt;= 0., David Miller, (Thu Dec 20, 7:51 am)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Andi Kleen, (Fri Dec 21, 8:42 pm)
Re: compat_sys_times() bogus until jiffies &gt;= 0., David Miller, (Fri Dec 21, 9:41 pm)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Andi Kleen, (Fri Dec 21, 9:49 pm)
Re: compat_sys_times() bogus until jiffies &gt;= 0., David Miller, (Fri Dec 21, 9:45 pm)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Andi Kleen, (Fri Dec 21, 9:53 pm)
Re: compat_sys_times() bogus until jiffies &gt;= 0., David Miller, (Sat Dec 22, 12:36 am)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Andi Kleen, (Sat Dec 22, 8:47 am)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Denys Vlasenko, (Thu Nov 8, 3:25 pm)
Re: compat_sys_times() bogus until jiffies &gt;= 0., David Miller, (Wed Nov 7, 8:50 pm)
Re: compat_sys_times() bogus until jiffies &gt;= 0., Andrew Morton, (Wed Nov 7, 9:13 pm)