[syzbot] [net?] BUG: unable to handle kernel NULL pointer dereference in pc_clock_gettime

11 views
Skip to first unread message

syzbot

unread,
Oct 25, 2025, 7:10:21 PM (13 days ago) Oct 25
to andrew...@lunn.ch, da...@davemloft.net, edum...@google.com, ku...@kernel.org, linux-...@vger.kernel.org, net...@vger.kernel.org, pab...@redhat.com, richard...@gmail.com, syzkall...@googlegroups.com
Hello,

syzbot found the following issue on:

HEAD commit: b98c94eed4a9 arm64: mte: Do not warn if the page is alread..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-kernelci
console output: https://syzkaller.appspot.com/x/log.txt?x=1337c258580000
kernel config: https://syzkaller.appspot.com/x/.config?x=158bd6857eb7a550
dashboard link: https://syzkaller.appspot.com/bug?extid=c8c0e7ccabd456541612
compiler: Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
userspace arch: arm64

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/2c82e514449b/disk-b98c94ee.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/a322ed38c368/vmlinux-b98c94ee.xz
kernel image: https://storage.googleapis.com/syzbot-assets/059db7d7114e/Image-b98c94ee.gz.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+c8c0e7...@syzkaller.appspotmail.com

loop5: detected capacity change from 0 to 128
EXT4-fs (loop5): mounted filesystem 76b65be2-f6da-4727-8c75-0525a5b65a09 r/w without journal. Quota mode: none.
Unable to handle kernel NULL pointer dereference at virtual
Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
Mem abort info:
ESR = 0x0000000086000006
EC = 0x21: IABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
FSC = 0x06: level 2 translation fault
user pgtable: 4k pages, 48-bit VAs, pgdp=00000001274b4000
[0000000000000000] pgd=0800000119171403, p4d=0800000119171403, pud=080000010c419403, pmd=0000000000000000
Internal error: Oops: 0000000086000006 [#1] SMP
Modules linked in:
CPU: 1 UID: 0 PID: 9258 Comm: syz.5.429 Not tainted syzkaller #0 PREEMPT
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/30/2025
pstate: 83400805 (Nzcv daif +PAN -UAO +TCO +DIT -SSBS BTYPE=-c)
pc : 0x0
lr : ptp_clock_gettime+0xa4/0xb8 drivers/ptp/ptp_clock.c:118
sp : ffff80009c077c70
x29: ffff80009c077c70 x28: ffff0000fabb8000 x27: fffffffffffffffb
x26: 1fffe0001f577000 x25: ffff80008aedca60 x24: ffff80009c077ce0
x23: dfff800000000000 x22: dfff800000000000 x21: 0000000000000000
x20: ffff0000cc206400 x19: ffff80009c077d00 x18: 0000000000000000
x17: 0000000000000000 x16: ffff800082de95c8 x15: 0000000000000001
x14: 1fffe0001996ac19 x13: 0000000000000000 x12: 0000000000000000
x11: 0000000000080000 x10: 00000000000000eb x9 : ffff8000a5059000
x8 : 0000000000000000 x7 : ffff800080653180 x6 : 0000000000000000
x5 : 0000000000000000 x4 : 0000000000000001 x3 : ffff80008ae046c4
x2 : 0000000000000001 x1 : ffff80009c077d00 x0 : ffff0000cc206400
Call trace:
0x0 (P)
pc_clock_gettime+0x148/0x1a8 kernel/time/posix-clock.c:258
__do_sys_clock_gettime kernel/time/posix-timers.c:1144 [inline]
__se_sys_clock_gettime kernel/time/posix-timers.c:1134 [inline]
__arm64_sys_clock_gettime+0x1b4/0x248 kernel/time/posix-timers.c:1134
__invoke_syscall arch/arm64/kernel/syscall.c:35 [inline]
invoke_syscall+0x98/0x254 arch/arm64/kernel/syscall.c:49
el0_svc_common+0x1e0/0x23c arch/arm64/kernel/syscall.c:132
do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151
el0_svc+0x5c/0x254 arch/arm64/kernel/entry-common.c:746
el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:765
el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596
---[ end trace 0000000000000000 ]---


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzk...@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup

syzbot

unread,
Oct 28, 2025, 4:00:48 AM (11 days ago) Oct 28
to junji...@intel.com, junji...@intel.com, syzkall...@googlegroups.com, linux-...@vger.kernel.org
> #syz test: https://github.com/Junjie650/linux.git ptp-gettime-guard-v1

This crash does not have a reproducer. I cannot test it.

Junjie Cao

unread,
Oct 28, 2025, 9:43:33 AM (11 days ago) Oct 28
to syzbot+c8c0e7...@syzkaller.appspotmail.com, syzkall...@googlegroups.com
From ac7d303ee68cf8b03d2190bb2f40fc5cd7a958de Mon Sep 17 00:00:00 2001
From: Junjie Cao <junji...@intel.com>
Date: Tue, 28 Oct 2025 12:32:16 +0800
Subject: [PATCH] ptp: guard ptp_clock_gettime() if neither gettimex64 nor
gettime64 is provided

Syzbot reports a NULL function pointer call on arm64 when
ptp_clock_gettime() falls back to ->gettime64() and the driver provides
neither ->gettimex64() nor ->gettime64(). This leads to a crash in the
posix clock gettime path.

Return -EOPNOTSUPP when both callbacks are missing, avoiding the crash
and matching the defensive style used in the posix clock layer.

Reported-by: syzbot+c8c0e7...@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=c8c0e7ccabd456541612
Signed-off-by: Junjie Cao <junji...@intel.com>
---
drivers/ptp/ptp_clock.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
index ef020599b771..764bd25220c1 100644
--- a/drivers/ptp/ptp_clock.c
+++ b/drivers/ptp/ptp_clock.c
@@ -110,12 +110,14 @@ static int ptp_clock_settime(struct posix_clock *pc, const struct timespec64 *tp
static int ptp_clock_gettime(struct posix_clock *pc, struct timespec64 *tp)
{
struct ptp_clock *ptp = container_of(pc, struct ptp_clock, clock);
- int err;
+ int err = -EOPNOTSUPP;

if (ptp->info->gettimex64)
- err = ptp->info->gettimex64(ptp->info, tp, NULL);
- else
- err = ptp->info->gettime64(ptp->info, tp);
+ return ptp->info->gettimex64(ptp->info, tp, NULL);
+
+ if (ptp->info->gettime64)
+ return ptp->info->gettime64(ptp->info, tp);
+
return err;
}

--
2.43.0

Junjie Cao

unread,
Oct 28, 2025, 9:43:33 AM (11 days ago) Oct 28
to syzbot+c8c0e7...@syzkaller.appspotmail.com, syzkall...@googlegroups.com

Junjie Cao

unread,
Oct 28, 2025, 9:43:33 AM (11 days ago) Oct 28
to syzbot+c8c0e7...@syzkaller.appspotmail.com, syzkall...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages