Skip to content

Commit

Permalink
Merge tag 'sysctl-6.12-rc1' of git://git.kernel.org/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/sysctl/sysctl

Pull sysctl update from Joel Granados:

 - Avoid evaluating non-mount ctl_tables as a sysctl_mount_point by
   removing the unlikely (but possible) chance that the permanently
   empty ctl_table array shares its address with another ctl_table

 - Update Joel Granados' contact info in MAINTAINERS

* tag 'sysctl-6.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/sysctl/sysctl:
  MAINTAINERS: update email for Joel Granados
  sysctl: avoid spurious permanent empty tables
  • Loading branch information
torvalds committed Sep 24, 2024
2 parents 97d8894 + 732b47d commit 172d513
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,7 @@ Jiri Slaby <[email protected]> <[email protected]>
Jisheng Zhang <[email protected]> <[email protected]>
Jisheng Zhang <[email protected]> <[email protected]>
Jishnu Prakash <[email protected]> <[email protected]>
Joel Granados <[email protected]> <[email protected]>
Johan Hovold <[email protected]> <[email protected]>
Johan Hovold <[email protected]> <[email protected]>
John Crispin <[email protected]> <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -18507,7 +18507,7 @@ F: tools/testing/selftests/proc/
PROC SYSCTL
M: Luis Chamberlain <[email protected]>
M: Kees Cook <[email protected]>
M: Joel Granados <j.granados@samsung.com>
M: Joel Granados <joel.granados@kernel.org>
L: [email protected]
L: [email protected]
S: Maintained
Expand Down
11 changes: 8 additions & 3 deletions fs/proc/proc_sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@ static const struct inode_operations proc_sys_inode_operations;
static const struct file_operations proc_sys_dir_file_operations;
static const struct inode_operations proc_sys_dir_operations;

/* Support for permanently empty directories */
static struct ctl_table sysctl_mount_point[] = { };
/*
* Support for permanently empty directories.
* Must be non-empty to avoid sharing an address with other tables.
*/
static struct ctl_table sysctl_mount_point[] = {
{ }
};

/**
* register_sysctl_mount_point() - registers a sysctl mount point
Expand All @@ -42,7 +47,7 @@ static struct ctl_table sysctl_mount_point[] = { };
*/
struct ctl_table_header *register_sysctl_mount_point(const char *path)
{
return register_sysctl(path, sysctl_mount_point);
return register_sysctl_sz(path, sysctl_mount_point, 0);
}
EXPORT_SYMBOL(register_sysctl_mount_point);

Expand Down

0 comments on commit 172d513

Please sign in to comment.