Skip to content

Commit 6ab753b

Browse files
tdh911kuba-moo
authored andcommitted
gve: Implement gettimex64 with -EOPNOTSUPP
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: acd1638 ("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>
1 parent 284987a commit 6ab753b

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

drivers/net/ethernet/google/gve/gve_ptp.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ int gve_clock_nic_ts_read(struct gve_priv *priv)
2626
return 0;
2727
}
2828

29+
static int gve_ptp_gettimex64(struct ptp_clock_info *info,
30+
struct timespec64 *ts,
31+
struct ptp_system_timestamp *sts)
32+
{
33+
return -EOPNOTSUPP;
34+
}
35+
2936
static long gve_ptp_do_aux_work(struct ptp_clock_info *info)
3037
{
3138
const struct gve_ptp *ptp = container_of(info, struct gve_ptp, info);
@@ -47,6 +54,7 @@ static long gve_ptp_do_aux_work(struct ptp_clock_info *info)
4754
static const struct ptp_clock_info gve_ptp_caps = {
4855
.owner = THIS_MODULE,
4956
.name = "gve clock",
57+
.gettimex64 = gve_ptp_gettimex64,
5058
.do_aux_work = gve_ptp_do_aux_work,
5159
};
5260

0 commit comments

Comments
 (0)