From: Liam R. Howlett Date: Tue, 16 Mar 2021 19:57:44 +0000 (-0400) Subject: binfmt_elf rcu fix X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=05609bed8d8d299d1f7d6ed4a86d0b6281d30e81;p=users%2Fjedix%2Flinux-maple.git binfmt_elf rcu fix Signed-off-by: Liam R. Howlett --- diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index ab1d7f0b48ea1..1a672f5ddcd15 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -1634,6 +1634,7 @@ static int fill_files_note(struct memelfnote *note) name_base = name_curpos = ((char *)data) + names_ofs; remaining = size - names_ofs; count = 0; + rcu_read_lock(); mas_for_each(&mas, vma, ULONG_MAX) { struct file *file; const char *filename; @@ -1663,6 +1664,7 @@ static int fill_files_note(struct memelfnote *note) *start_end_ofs++ = vma->vm_pgoff; count++; } + rcu_read_unlock(); /* Now we know exact count of files, can store it */ data[0] = count;