Skip to content

Commit 11648b8

Browse files
arndbdavem330
authored andcommitted
sparc64: fix adjtimex regression
Anatoly Pugachev reported one of the y2038 patches to introduce a fatal bug from a stupid typo: [ 96.384129] watchdog: BUG: soft lockup - CPU#8 stuck for 22s! ... [ 96.385624] [0000000000652ca4] handle_mm_fault+0x84/0x320 [ 96.385668] [0000000000b6f2bc] do_sparc64_fault+0x43c/0x820 [ 96.385720] [0000000000407754] sparc64_realfault_common+0x10/0x20 [ 96.385769] [000000000042fa28] __do_sys_sparc_clock_adjtime+0x28/0x80 [ 96.385819] [00000000004307f0] sys_sparc_clock_adjtime+0x10/0x20 [ 96.385866] [0000000000406294] linux_sparc_syscall+0x34/0x44 Fix the code to dereference the correct pointer again. Reported-by: Anatoly Pugachev <[email protected]> Tested-by: Anatoly Pugachev <[email protected]> Fixes: 251ec1c ("y2038: sparc: remove use of struct timex") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 94f2630 commit 11648b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/sparc/kernel/sys_sparc_64.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ SYSCALL_DEFINE2(getdomainname, char __user *, name, int, len)
551551
SYSCALL_DEFINE1(sparc_adjtimex, struct __kernel_timex __user *, txc_p)
552552
{
553553
struct __kernel_timex txc;
554-
struct __kernel_old_timeval *tv = (void *)&txc_p->time;
554+
struct __kernel_old_timeval *tv = (void *)&txc.time;
555555
int ret;
556556

557557
/* Copy the user data space into the kernel copy
@@ -576,7 +576,7 @@ SYSCALL_DEFINE2(sparc_clock_adjtime, const clockid_t, which_clock,
576576
struct __kernel_timex __user *, txc_p)
577577
{
578578
struct __kernel_timex txc;
579-
struct __kernel_old_timeval *tv = (void *)&txc_p->time;
579+
struct __kernel_old_timeval *tv = (void *)&txc.time;
580580
int ret;
581581

582582
if (!IS_ENABLED(CONFIG_POSIX_TIMERS)) {

0 commit comments

Comments
 (0)