[PATCH 4/4] bus/pci/bsd: Fix device existence check
    Burakov, Anatoly 
    anatoly.burakov at intel.com
       
    Thu May  8 13:27:57 CEST 2025
    
    
  
On 5/6/2025 7:40 PM, Jake Freeland wrote:
> Use open(2) instead of access(2) to check for the existence of the target
> device. This avoids a possible race condition where the the device file is
> removed after a successful call to access(2) but before open(2).
> 
> This also fixes any potential bugs associated with passing open(2)-style
> flags into access(2). i.e. access(2) does not formally support the O_RDWR
> flag.
> 
> Signed-off-by: Jake Freeland <jfree at FreeBSD.org>
> ---
It's odd that static analysis didn't flag this, as that's the kind of 
thing it would normally complain about.
Acked-by: Anatoly Burakov <anatoly.burakov at intel.com>
-- 
Thanks,
Anatoly
    
    
More information about the dev
mailing list