linux/drivers/ptp
Ahmad Byagowi 6b69f2ef10 ptp: ocp: Fix board ID over-read
The EEPROM board ID is a fixed 13-byte field and is not guaranteed to
contain a NUL terminator. Passing it directly to
devlink_info_version_fixed_put() treats it as a C string and may read
beyond the field.

Format at most OCP_BOARD_ID_LEN bytes into the existing local buffer
before reporting the ID. Use a precision limit because the snprintf()
output size alone does not bound the source string scan.

Fixes: 0cfcdd1ebc ("ptp: ocp: add nvmem interface for accessing eeprom")
Cc: stable@vger.kernel.org
Signed-off-by: Ahmad Byagowi <ahmadexp@gmail.com>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Link: https://patch.msgid.link/20260804210751.48248-1-ahmadexp@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-08-06 09:15:40 -07:00
..
Kconfig ptp: ptp_vmclock: remove dependency on CONFIG_ACPI 2026-02-02 18:06:01 -08:00
Makefile ptp: qoriq: convert to use generic interfaces to set loopback mode 2025-09-09 19:28:52 -07:00
ptp_chardev.c ptp: Switch to ktime_get_snapshot_id() for pre/post timestamps 2026-06-04 11:04:18 +02:00
ptp_clock.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ptp_clockmatrix.c ptp: ptp_clockmatrix: Remove redundant semicolons 2025-08-14 17:35:49 -07:00
ptp_clockmatrix.h ptp: ptp_clockmatrix: Add .getmaxphase ptp_clock_info callback 2023-06-20 09:02:33 +01:00
ptp_dfl_tod.c ptp: add ToD device driver for Intel FPGA cards 2023-03-29 21:25:48 -07:00
ptp_dte.c Replace <linux/mod_devicetable.h> by more specific <linux/device-id/*.h> (c files) 2026-07-03 07:38:17 +02:00
ptp_fc3.c ptp: switch to using FIELD_GET_SIGNED() 2026-05-20 11:18:27 -04:00
ptp_fc3.h ptp: add FemtoClock3 Wireless as ptp hardware clock 2024-01-29 13:00:23 +00:00
ptp_idt82p33.c net: ptp: introduce .supported_extts_flags to ptp_clock_info 2025-04-15 20:20:57 -07:00
ptp_idt82p33.h ptp: idt82p33: Add .getmaxphase ptp_clock_info callback 2023-06-20 09:02:33 +01:00
ptp_ines.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ptp_kvm_arm.c treewide: Remove system_counterval_t.cs, which is never read 2024-02-07 17:05:21 +01:00
ptp_kvm_common.c treewide: Remove system_counterval_t.cs, which is never read 2024-02-07 17:05:21 +01:00
ptp_kvm_x86.c ptp: kvm: x86: Return EOPNOTSUPP instead of ENODEV from kvm_arch_ptp_init() 2024-12-06 17:38:11 -08:00
ptp_mock.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ptp_netc.c ptp: netc: fix potential interrupt storm caused by incorrect unbind order 2026-07-29 17:54:06 -07:00
ptp_ocp.c ptp: ocp: Fix board ID over-read 2026-08-06 09:15:40 -07:00
ptp_pch.c kernel.h: drop hex.h and update all hex.h users 2026-01-20 19:44:19 -08:00
ptp_private.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2025-10-01 10:14:49 +02:00
ptp_qoriq.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ptp_s390.c ptp: ptp_s390: Add missing facility check 2026-07-23 07:02:34 -07:00
ptp_sysfs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ptp_vclock.c ptp: vclock: Switch from RCU to SRCU 2026-06-03 18:58:54 -07:00
ptp_vmclock.c ptp: vmclock: Use hw_cycles from snapshot for precise TSC pairing 2026-06-05 14:25:03 +02:00
ptp_vmw.c ptp: vmw: Drop ptp_vmw_acpi_device 2026-05-14 16:50:09 -07:00