Commit 329d050b authored by Tim Hostetler's avatar Tim Hostetler Committed by Jakub Kicinski
Browse files

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: acd16380 ("gve: Add initial PTP device support")
Reported-by: default avatar <syzbot+a546141ca6d53b90aba3@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=a546141ca6d53b90aba3


Signed-off-by: default avatarTim Hostetler <thostet@google.com>
Reviewed-by: default avatarKuniyuki Iwashima <kuniyu@google.com>
Signed-off-by: default avatarJoshua Washington <joshwash@google.com>
Link: https://patch.msgid.link/20251029184555.3852952-3-joshwash@google.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 6ab753b5
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -33,6 +33,12 @@ static int gve_ptp_gettimex64(struct ptp_clock_info *info,
	return -EOPNOTSUPP;
}

static int gve_ptp_settime64(struct ptp_clock_info *info,
			     const struct timespec64 *ts)
{
	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);
@@ -55,6 +61,7 @@ static const struct ptp_clock_info gve_ptp_caps = {
	.owner          = THIS_MODULE,
	.name		= "gve clock",
	.gettimex64	= gve_ptp_gettimex64,
	.settime64	= gve_ptp_settime64,
	.do_aux_work	= gve_ptp_do_aux_work,
};