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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 11 Nov 2013 15:17:04 +0000
From:	Al Viro <viro@...IV.linux.org.uk>
To:	Thomas Hellstrom <thellstrom@...are.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC RESEND] dma-buf/fs Add
 get_[file|dma_buf]_unless_doomed

On Mon, Nov 11, 2013 at 12:57:47AM -0800, Thomas Hellstrom wrote:
> Resending since it appears this RFC never got to the dri-devel lkml lists.
> 
> In this context, a "doomed" object is an object whose refcount has reached
> zero, but that has not yet been freed.
> 
> To avoid mutual refcounting vmwgfx need to have a non-refcounted pointer to
> a dma-buf in a lookup structure. The pointer is removed in the dma-buf
> destructor. To allow lookup-structure private locks we need
> get_dma_buf_unless_doomed(). This common refcounting scenario is described
> with examples in detail in the kref documentaion.
> The solution with local locks is under kref_get_unless_zero().
> See also kobject_get_unless_zero() and its commit message.
> Since dma-bufs are using the attached file for refcounting,
> get_dma_buf_unless_doomed maps directly to a get_file_unless_doomed.

NAK for struct file.  This kind of stuff is for implementing primitives,
not as a public API.  BTW, as for dmabuf...  dma_buf_fd() calling conventions
are seriously misguided - we are trying to transfer the reference we hold
into something (in this case - descriptor table), so the failure exit
should be dropping the reference, not leaving that to caller.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ