lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 27 Sep 2022 02:37:21 +0100
From:   Al Viro <viro@...iv.linux.org.uk>
To:     tomorrow Wang (王德明) <wangdeming@...pur.com>
Cc:     "jgg@...dia.com" <jgg@...dia.com>,
        "pbonzini@...hat.com" <pbonzini@...hat.com>,
        "kvm@...r.kernel.org" <kvm@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] vfio: Use filp instead of fd

On Tue, Sep 27, 2022 at 01:21:50AM +0000, tomorrow Wang (王德明) wrote:
> Hi
> 
> Why kvm_vfio_group_add use file.
>   
>   struct file *filp;
>   .....
>   filp = fget(fd);
> 
>   .....
>   kvg->file = filp;

This is why.  Note that you've slightly misquoted it - it's actually
either "stick into kvg->file" or "fput() it".

>   ......
>   fput(filp);

The reference we are getting here is non-transient one; it will be retained
in shared data structures after we return from function - hell, after we
return to userland.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ