lkml.org 
[lkml]   [2020]   [Jul]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: KASAN: use-after-free Read in userfaultfd_release (2)
On Mon, Jul 13, 2020 at 04:45:12PM +0800, Hillf Danton wrote:

> Bridge the gap between slab free and the fput in task work wrt
> file's private data.

No. This

> @@ -2048,6 +2055,7 @@ SYSCALL_DEFINE1(userfaultfd, int, flags)
>
> fd = get_unused_fd_flags(O_RDONLY | O_CLOEXEC);
> if (fd < 0) {
> + file->private_data = NULL;
> fput(file);
> goto out;
> }
>

is fundamentally wrong; you really shouldn't take over the cleanups
if you ever do fput().

\
 
 \ /
  Last update: 2020-07-20 18:01    [W:1.904 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site