[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250516090837.GF1898636@horms.kernel.org>
Date: Fri, 16 May 2025 10:08:37 +0100
From: Simon Horman <horms@...nel.org>
To: Sagi Maimon <maimon.sagi@...il.com>
Cc: jonathan.lemon@...il.com, vadim.fedorenko@...ux.dev,
richardcochran@...il.com, andrew+netdev@...n.ch,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, linux-kernel@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH v5] ptp: ocp: Limit signal/freq counts in summary output
functions
On Wed, May 14, 2025 at 10:35:41AM +0300, Sagi Maimon wrote:
> The debugfs summary output could access uninitialized elements in
> the freq_in[] and signal_out[] arrays, causing NULL pointer
> dereferences and triggering a kernel Oops (page_fault_oops).
> This patch adds u8 fields (nr_freq_in, nr_signal_out) to track the
> number of initialized elements, with a maximum of 4 per array.
> The summary output functions are updated to respect these limits,
> preventing out-of-bounds access and ensuring safe array handling.
>
> Signed-off-by: Sagi Maimon <maimon.sagi@...il.com>
> ---
> Addressed comments from Vadim Fedorenko:
> - https://www.spinics.net/lists/kernel/msg5683022.html
> Addressed comments from Jakub Kicinski:
> - https://www.spinics.net/lists/netdev/msg1091131.html
> Changes since v4:
> - remove fix from signal/freq show/store routines.
Reviewed-by: Simon Horman <horms@...nel.org>
Powered by blists - more mailing lists