Re: [PATCH net-next] net: pktgen: return bool from __pktgen_NN_threads()

From: Chengfeng Ye

Date: Sun Sep 27 2026 - 10:07:23 EST


On Thu, Aug 27, 2026 at 4:16 PM Paolo Abeni <pabeni@xxxxxxxxxx> wrote:
>
> On 8/25/26 8:53 PM, Chengfeng Ye wrote:
> > Callers of __pktgen_NN_threads() only check whether a pktgen_dev was
> > found. After the RCU lookup they never dereference the returned
> > pointer, so returning it past rcu_read_unlock() is confusing.
> >
> > Return bool instead and keep the pktgen_dev pointer local to the
> > RCU critical section.
> >
> > Suggested-by: Paolo Abeni <pabeni@xxxxxxxxxx>
> > Signed-off-by: Chengfeng Ye <nicoyip.dev@xxxxxxxxx>
> ## Form letter - net-next-closed
>
> net-next pull request for v7.3 has already been merged, and therefore
> the net-next tree is closed for new drivers, features, code refactoring
> and optimizations. We are currently accepting bug fixes only.
>
> Please repost when net-next reopens after Aug 31st.
>
> RFC patches sent for review only are obviously welcome at any time.
>
> See:
> https://www.kernel.org/doc/html/next/process/maintainer-netdev.html#development-cycle
> --
> pw-bot: defer
> pv-bot: closed
>

Hi Paolo,

Sorry for the late reply. I have reposted the boolean-return cleanup
as v2, rebased directly onto net-next.
https://lore.kernel.org/r/20260927135406.3969970-1-nicoyip.dev@xxxxxxxxx/

The original UAF fix still applies cleanly to net and has Eric’s
Reviewed-by. Could it be picked up from the existing submission, or
would you prefer a resend?
https://lore.kernel.org/r/20260824152331.216494-1-nicoyip.dev@xxxxxxxxx/

Best regards,
Chengfeng