Re: [PATCH v4] net/mlx5: Fix OOB access and stack information leak in PTP event handling

From: Carolina Jubran

Date: Sun Apr 12 2026 - 10:31:35 EST



On 12/04/2026 3:04, Prathamesh Deshpande wrote:
In mlx5_pps_event(), several critical issues were identified:

1. The 'pin' index from the hardware event was used without bounds
checking to index 'pin_config' and 'pps_info->start'. Check against
MAX_PIN_NUM to prevent out-of-bounds access.
2. 'ptp_event' was not zero-initialized, potentially leaking stack
memory through the union.
3. A NULL 'pin_config' could be dereferenced if initialization failed.
4. 'clock->ptp' could be NULL if ptp_clock_register() failed.

Fixes: 7c39afb394c7 ("net/mlx5: PTP code migration to driver core section")
Suggested-by: Carolina Jubran <cjubran@xxxxxxxxxx>
Signed-off-by: Prathamesh Deshpande <prathameshdeshpande7@xxxxxxxxx>
Reviewed-by: Carolina Jubran <cjubran@xxxxxxxxxx>