[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250507200112.GL3339421@horms.kernel.org>
Date: Wed, 7 May 2025 21:01:12 +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 v1] ptp: ocp: Limit SMA/signal/freq counts in show/store
functions
On Wed, May 07, 2025 at 08:46:30PM +0100, Simon Horman wrote:
> On Tue, May 06, 2025 at 11:06:47AM +0300, Sagi Maimon wrote:
> > The sysfs show/store operations could access uninitialized elements in
> > the freq_in[], signal_out[], and sma[] arrays, leading to NULL pointer
> > dereferences. This patch introduces u8 fields (nr_freq_in, nr_signal_out,
> > nr_sma) to track the actual number of initialized elements, capping the
> > maximum at 4 for each array. The affected show/store 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>
>
> Hi Sagi,
>
> With this patch applied GCC 14.2.0 reports:
Sorry, I forgot to mention that this is an allmodconfig W=1 build
on x86_64.
...
Powered by blists - more mailing lists