Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'gve-fix-null-dereferencing-with-ptp-clock'

Tim Hostetler says:

====================
gve: Fix NULL dereferencing with PTP clock

This patch series fixes NULL dereferences that are possible with gve's
PTP clock due to not stubbing certain ptp_clock_info callbacks.
====================

Link: https://patch.msgid.link/20251029184555.3852952-1-joshwash@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+15
+15
drivers/net/ethernet/google/gve/gve_ptp.c
··· 26 26 return 0; 27 27 } 28 28 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 + 36 + static int gve_ptp_settime64(struct ptp_clock_info *info, 37 + const struct timespec64 *ts) 38 + { 39 + return -EOPNOTSUPP; 40 + } 41 + 29 42 static long gve_ptp_do_aux_work(struct ptp_clock_info *info) 30 43 { 31 44 const struct gve_ptp *ptp = container_of(info, struct gve_ptp, info); ··· 60 47 static const struct ptp_clock_info gve_ptp_caps = { 61 48 .owner = THIS_MODULE, 62 49 .name = "gve clock", 50 + .gettimex64 = gve_ptp_gettimex64, 51 + .settime64 = gve_ptp_settime64, 63 52 .do_aux_work = gve_ptp_do_aux_work, 64 53 }; 65 54