]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
binfmt_elf rcu fix
authorLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 16 Mar 2021 19:57:44 +0000 (15:57 -0400)
committerLiam R. Howlett <Liam.Howlett@Oracle.com>
Tue, 16 Mar 2021 19:57:44 +0000 (15:57 -0400)
Signed-off-by: Liam R. Howlett <Liam.Howlett@Oracle.com>
fs/binfmt_elf.c

index ab1d7f0b48ea1802b74f9c18de76bd68302104fc..1a672f5ddcd1501d659070c7f79f432e00401cda 100644 (file)
@@ -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;