diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 72f2b373221ed99278a944be8ccef03e12ce9d7a..921d291c2aee35de166724785680c5c2227a6577 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -1830,6 +1830,13 @@ static const char *sysctl_find_alias(char *param) return NULL; } +bool sysctl_is_alias(char *param) +{ + const char *alias = sysctl_find_alias(param); + + return alias != NULL; +} + /* Set sysctl value passed on kernel command line. */ static int process_sysctl_arg(char *param, char *val, const char *unused, void *arg) diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 780690dc08cda2ccff91d49d5f9ee6088ee8f84a..a207c7ed41bd255b8570544ab1a561d2cb97162b 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -238,6 +238,7 @@ extern void __register_sysctl_init(const char *path, struct ctl_table *table, extern struct ctl_table_header *register_sysctl_mount_point(const char *path); void do_sysctl_args(void); +bool sysctl_is_alias(char *param); int do_proc_douintvec(struct ctl_table *table, int write, void *buffer, size_t *lenp, loff_t *ppos, int (*conv)(unsigned long *lvalp, @@ -301,6 +302,11 @@ static inline void setup_sysctl_set(struct ctl_table_set *p, static inline void do_sysctl_args(void) { } + +static inline bool sysctl_is_alias(char *param) +{ + return false; +} #endif /* CONFIG_SYSCTL */ int sysctl_max_threads(struct ctl_table *table, int write, void *buffer, diff --git a/init/main.c b/init/main.c index fe378351e8a95f3f832e8cbe54e807a5760e9164..87a52bdb41d67177b4a691f01b397d69a5b06413 100644 --- a/init/main.c +++ b/init/main.c @@ -533,6 +533,10 @@ static int __init unknown_bootoption(char *param, char *val, { size_t len = strlen(param); + /* Handle params aliased to sysctls */ + if (sysctl_is_alias(param)) + return 0; + repair_env_string(param, val); /* Handle obsolete-style parameters */