[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Fixing settime1() to reject invalid struct timespec ?
While looking into clock_settime(2), i discovered that this syscall
does not fail as expected with EINVAL when an invalid struct timespec
Indeed, none of the called functions do use itimespecfix() to ensure
that the tv_sec and tv_nsec values are correct.
Adding such a verification would be best centralized in settime1()
function which is currently used by both native and compat
clock_settime() syscalls (and as a side effect, it will validate
settimeofday argument too).
Unfortunately, the clock_settime1()/settime1() chain use a `const
struct timespec' argument which cannot be modified by calling
To solve this, we can: (a) use an ugly __UNCONST() when calling
itimespecfix(), or (b) drop the const qualifier from
I do think the latter would be better.
Biological Software and Databanks.
Institut Pasteur, Paris.
Main Index |
Thread Index |