diff options
author | Hao Lee <haolee.swjtu@gmail.com> | 2022-03-24 00:05:20 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2022-03-24 03:00:33 +0100 |
commit | 3a72917ccfbb2eecabefc86aade8acd4a1e85888 (patch) | |
tree | a08cbeb6bcba18c9553b5d517d3146d7e196a814 /fs/proc/internal.h | |
parent | Linux 5.17 (diff) | |
download | linux-3a72917ccfbb2eecabefc86aade8acd4a1e85888.tar.xz linux-3a72917ccfbb2eecabefc86aade8acd4a1e85888.zip |
proc: alloc PATH_MAX bytes for /proc/${pid}/fd/ symlinks
It's not a standard approach that use __get_free_page() to alloc path
buffer directly. We'd better use kmalloc and PATH_MAX.
PAGE_SIZE is different on different archs. An unlinked file
with very long canonical pathname will readlink differently
because "(deleted)" eats into a buffer. --adobriyan
[akpm@linux-foundation.org: remove now-unneeded cast]
Link: https://lkml.kernel.org/r/Ye1fCxyZZ0I5lgOL@localhost.localdomain
Signed-off-by: Hao Lee <haolee.swjtu@gmail.com>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Christian Brauner <christian.brauner@ubuntu.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: James Morris <jamorris@linux.microsoft.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc/internal.h')
0 files changed, 0 insertions, 0 deletions