udmabuf: check_memfd_seals() is racy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

Julian Orth reported at
https://bugzilla.kernel.org/show_bug.cgi?id=219106 that
udmabuf_create() checks for F_SEAL_WRITE in a racy way, so a udmabuf
can end up holding references to pages in a write-sealed memfd, which
theoretically breaks one of the security properties of memfd sealing.
See also the discussion starting at
<https://lore.kernel.org/linux-mm/CAHijbEV6wtTQy01djSfWBJksq4AEoZ=KYUsaKEKNSXbTTSM-Ww@xxxxxxxxxxxxxx/>.

I think one possible correct pattern would be something like:

mapping_map_writable() [with error bailout]
check seals with F_GET_SEALS
udmabuf_pin_folios()
mapping_unmap_writable()



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux