forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sysctl: Improve the sysctl sanity checks
- Stop validating subdirectories now that we only register leaf tables - Cleanup and improve the duplicate filename check. * Run the duplicate filename check under the sysctl_lock to guarantee we never add duplicate names. * Reduce the duplicate filename check to nearly O(M*N) where M is the number of entries in tthe table we are registering and N is the number of entries in the directory before we got there. - Move the duplicate filename check into it's own function and call it directtly from __register_sysctl_table - Kill the config option as the sanity checks are now cheap enough the config option is unnecessary. The original reason for the config option was because we had a huge table used to verify the proc filename to binary sysctl mapping. That table has now evolved into the binary_sysctl translation layer and is no longer part of the sysctl_check code. - Tighten up the permission checks. Guarnateeing that files only have read or write permissions. - Removed redudant check for parents having a procname as now everything has a procname. - Generalize the backtrace logic so that we print a backtrace from any failure of __register_sysctl_table that was not caused by a memmory allocation failure. The backtrace allows us to track down who erroneously registered a sysctl table. Bechmark before (CONFIG_SYSCTL_CHECK=y): make-dummies 0 999 -> 12s rmmod dummy -> 0.08s Bechmark before (CONFIG_SYSCTL_CHECK=n): make-dummies 0 999 -> 0.7s rmmod dummy -> 0.06s make-dummies 0 99999 -> 1m13s rmmod dummy -> 0.38s Benchmark after: make-dummies 0 999 -> 0.65s rmmod dummy -> 0.055s make-dummies 0 9999 -> 1m10s rmmod dummy -> 0.39s The sysctl sanity checks now impose no measurable cost. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
- v3.4-rc5
- v3.4-rc4
- v3.4-rc3
- v3.4-rc2
- v3.4-rc1
- rpi-old-20120615-dma
- rpi-old-20120609-dma
- rpi-old-20120520-gpio
- rpi-old-20120514-mbox
- rpi-old-20120514-fb
- rpi-old-20120513-watchdog
- rpi-old-20120512-clock
- rpi-old-20120511-irq
- rpi-obsolete-3.4
- rpi-minimal-20120512
- rpi-3.5-20120620
- rpi-3.5-20120620-linear
- rpi-3.5-20120615
- rpi-3.5-20120615-linear
- rpi-3.5-20120611
- rpi-3.5-20120611-linear
- rpi-3.5-20120610
- rpi-3.5-20120610-linear
- rpi-3.5-20120609-1713
- rpi-3.5-20120609-1713-linear
- rpi-3.5-20120609-1150
- rpi-3.5-20120609-1150-linear
- rpi-3.5-20120609-1148
- rpi-3.5-20120609-1148-linear
- rpi-3.5-20120603
- rpi-3.5-20120529-2242
- rpi-3.5-20120529-2242-linear
- rpi-3.4-20120529-2229
- rpi-3.4-20120529-2229-linear
- rpi-3.4-20120521-0105
- rpi-3.4-20120421-0105
Showing
2 changed files
with
86 additions
and
144 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters