Bug 12881 - {get,set}timeofday declared with incorrect '__nonnull' attribute
Summary: {get,set}timeofday declared with incorrect '__nonnull' attribute
Status: RESOLVED INVALID
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.14
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-12 12:24 UTC by Aurelien Jarno
Modified: 2014-06-24 08:35 UTC (History)
0 users

See Also:
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Build: x86_64-unknown-linux-gnu
Last reconfirmed:
fweimer: security-


Attachments
Patch to fix the issue (493 bytes, patch)
2011-06-12 12:24 UTC, Aurelien Jarno
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aurelien Jarno 2011-06-12 12:24:44 UTC
Created attachment 5790 [details]
Patch to fix the issue

On Linux it is valid to call {get,set}timeofday() with a null timeval
pointer and non-null timezone pointer.  This will get or set the
kernel's local time offset, which is used for converting timestamps on
brain-dead filesystems like VFAT.  settimeofday(NULL, tz) is also used
to fix the system time during the boot process if the RTC is set to
local time for compatibility with a similarly brain-dead operating
system.

Patch to fix the problem is attached.
Comment 1 Ulrich Drepper 2011-06-16 01:59:22 UTC
These are invalid calls.  These calls should then use the syscalls directly and not cause everyone else to suffer from not being warned about invalid uses.