On Tue, 13 Jan 2026 15:48:20 +0530 [email protected] wrote: > From: Madhuker Mythri <[email protected]> > > When multiple threads issue RNDIS command requests (such as device > info queries and link status checks) simultaneously, command failures > can occur due to concurrent access to shared resources in the RNDIS > execution path. > > Add a spinlock to serialize RNDIS command execution and prevent > data corruption. > > Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device") > Cc: [email protected] > > Signed-off-by: Madhuker Mythri <[email protected]> > ---
As Long (and AI review) observed this patch needs more work. There are two issues: 1. The introduced spin lock only protects query, it does not protect around cases where a query races with some thing else calling rndis_set. Lock should go inside hn_rndis_execute(). 2. The lock is held while spinning, and it could take several seconds to complete, holding spinlock that long burns CPU and any other thread trying to do operation would queue up and block. Maybe a pthread_mutex (which sleeps) or use trylock in the query path and return EBUSY?

