Skip to content

Commit 329d050

Browse files
tdh911kuba-moo
authored andcommitted
gve: Implement settime64 with -EOPNOTSUPP
ptp_clock_settime() assumes every ptp_clock has implemented settime64(). Stub it with -EOPNOTSUPP to prevent a NULL dereference. Fixes: acd1638 ("gve: Add initial PTP device support") Reported-by: syzbot+a546141ca6d53b90aba3@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=a546141ca6d53b90aba3 Signed-off-by: Tim Hostetler <thostet@google.com> Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com> Signed-off-by: Joshua Washington <joshwash@google.com> Link: https://patch.msgid.link/20251029184555.3852952-3-joshwash@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 6ab753b commit 329d050

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ static int gve_ptp_gettimex64(struct ptp_clock_info *info,
3333
return -EOPNOTSUPP;
3434
}
3535

36+
static int gve_ptp_settime64(struct ptp_clock_info *info,
37+
const struct timespec64 *ts)
38+
{
39+
return -EOPNOTSUPP;
40+
}
41+
3642
static long gve_ptp_do_aux_work(struct ptp_clock_info *info)
3743
{
3844
const struct gve_ptp *ptp = container_of(info, struct gve_ptp, info);
@@ -55,6 +61,7 @@ static const struct ptp_clock_info gve_ptp_caps = {
5561
.owner = THIS_MODULE,
5662
.name = "gve clock",
5763
.gettimex64 = gve_ptp_gettimex64,
64+
.settime64 = gve_ptp_settime64,
5865
.do_aux_work = gve_ptp_do_aux_work,
5966
};
6067

0 commit comments

Comments
 (0)