kernel-hacking-2024-linux-s.../init
Jeff Layton a608ca21f5 vfs: allocate page instead of names_cache buffer in mount_block_root
First, it's incorrect to call putname() after __getname_gfp() since the
bare __getname_gfp() call skips the auditing code, while putname()
doesn't.

mount_block_root allocates a PATH_MAX buffer via __getname_gfp, and then
calls get_fs_names to fill the buffer. That function can call
get_filesystem_list which assumes that that buffer is a full page in
size. On arches where PAGE_SIZE != 4k, then this could potentially
overrun.

In practice, it's hard to imagine the list of filesystem names even
approaching 4k, but it's best to be safe. Just allocate a page for this
purpose instead.

With this, we can also remove the __getname_gfp() definition since there
are no more callers.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2012-10-12 00:32:03 -04:00
..
calibrate.c
do_mounts.c vfs: allocate page instead of names_cache buffer in mount_block_root 2012-10-12 00:32:03 -04:00
do_mounts.h
do_mounts_initrd.c init: disable sparse checking of the mount.o source files 2012-05-31 17:49:27 -07:00
do_mounts_md.c init: disable sparse checking of the mount.o source files 2012-05-31 17:49:27 -07:00
do_mounts_rd.c init: disable sparse checking of the mount.o source files 2012-05-31 17:49:27 -07:00
init_task.c
initramfs.c init: disable sparse checking of the mount.o source files 2012-05-31 17:49:27 -07:00
Kconfig Kconfig: clean up the "#if defined(arch)" list for exception-trace sysctl entry 2012-10-09 16:22:14 +09:00
main.c prio_tree: remove 2012-10-09 16:22:40 +09:00
Makefile
noinitramfs.c
version.c