]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
gve: Implement gettimex64 with -EOPNOTSUPP
authorTim Hostetler <thostet@google.com>
Wed, 29 Oct 2025 18:45:39 +0000 (11:45 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 31 Oct 2025 22:55:32 +0000 (15:55 -0700)
gve implemented a ptp_clock for sole use of do_aux_work at this time.
ptp_clock_gettime() and ptp_sys_offset() assume every ptp_clock has
implemented either gettimex64 or gettime64. Stub gettimex64 and return
-EOPNOTSUPP to prevent NULL dereferencing.

Fixes: acd16380523b ("gve: Add initial PTP device support")
Reported-by: syzbot+c8c0e7ccabd456541612@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=c8c0e7ccabd456541612
Signed-off-by: Tim Hostetler <thostet@google.com>
Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
Link: https://patch.msgid.link/20251029184555.3852952-2-joshwash@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/google/gve/gve_ptp.c

index e96247c9d68d290f3d5c333b284d6a09bdbacedb..19ae699d4b18d7137a68b163deff2a75ce91d429 100644 (file)
@@ -26,6 +26,13 @@ int gve_clock_nic_ts_read(struct gve_priv *priv)
        return 0;
 }
 
+static int gve_ptp_gettimex64(struct ptp_clock_info *info,
+                             struct timespec64 *ts,
+                             struct ptp_system_timestamp *sts)
+{
+       return -EOPNOTSUPP;
+}
+
 static long gve_ptp_do_aux_work(struct ptp_clock_info *info)
 {
        const struct gve_ptp *ptp = container_of(info, struct gve_ptp, info);
@@ -47,6 +54,7 @@ out:
 static const struct ptp_clock_info gve_ptp_caps = {
        .owner          = THIS_MODULE,
        .name           = "gve clock",
+       .gettimex64     = gve_ptp_gettimex64,
        .do_aux_work    = gve_ptp_do_aux_work,
 };