diff options
author | John Wright <[email protected]> | 2009-04-29 14:32:01 -0600 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2009-04-30 12:31:45 +0200 |
commit | 2f65dd475c6a8a997145ea83cc3d2d5e6dc55af1 (patch) | |
tree | ea094eebb66277be8f5d67884f3dd55a609d1bc4 /net/lapb/lapb_subr.c | |
parent | 091438dd5668396328a3419abcbc6591159eb8d1 (diff) |
x86: gettimeofday() vDSO: fix segfault when tv == NULL
According to the gettimeofday(2) manual:
If either tv or tz is NULL, the corresponding structure is not
set or returned.
Since it is legal to give NULL as the tv argument, the code should make
sure tv is not NULL before trying to dereference it.
This issue manifests itself on x86_64 when vdso=0 is not on the kernel
command-line and libc uses the vDSO for gettimeofday() (e.g. glibc >=
2.7). A simple reproducer:
#include <stdio.h>
#include <sys/time.h>
int main(void)
{
struct timezone tz;
gettimeofday(NULL, &tz);
return 0;
}
See http://bugs.debian.org/466491 for more details.
[ Impact: fix gettimeofday(NULL, &tz) segfault ]
Signed-off-by: John Wright <[email protected]>
Cc: Andi Kleen <[email protected]>
Cc: John Wright <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'net/lapb/lapb_subr.c')
0 files changed, 0 insertions, 0 deletions