By increasing the default size limit from 64 MB to INT_MAX, commit
44e9eb5a7621 ("dma-buf/udmabuf: Disable the size limit by default")
has left open the possibility that an unpriviledged user-space
process can pin an unlimited amount of memory through udmabuf.
Syzbot was able to trigger a warning trace by trying to pin a large
amount of memory through udmabuf.

Fix this issue by first preventing the warning trace from showing
up in the log and then add mlock accounting to udmabuf to prevent
unpriviledged users from pinning an unlimited amount of memory
through udmabuf.

-----------------------------

Patchset overview:

Patch 1: Fix for syzbot warning trace issue
Patch 2: Add mlock accounting to udmabuf

Cc: Gerd Hoffmann <[email protected]>
Cc: "Christian König" <[email protected]>
Cc: Robert Mader <[email protected]>
Cc: Xaver Hugl <[email protected]>

Vivek Kasireddy (2):
  udmabuf: Do not warn when pages/folios array allocation fails
  udmabuf: Add mlock accounting for udmabuf pages/folios

 drivers/dma-buf/udmabuf.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

-- 
2.53.0

Reply via email to