提交 d484e833 编写于 作者: R Randy Dunlap 提交者: Yongqiang Liu

init/main.c: return 1 from handled __setup() functions

stable inclusion
from stable-4.19.238
commit c7daf1b4ad809692d5c26f33c02ed8a031066548
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5X41F
CVE: NA

--------------------------------

[ Upstream commit f9a40b08 ]

initcall_blacklist() should return 1 to indicate that it handled its
cmdline arguments.

set_debug_rodata() should return 1 to indicate that it handled its
cmdline arguments.  Print a warning if the option string is invalid.

This prevents these strings from being added to the 'init' program's
environment as they are not init arguments/parameters.

Link: https://lkml.kernel.org/r/20220221050901.23985-1-rdunlap@infradead.orgSigned-off-by: NRandy Dunlap <rdunlap@infradead.org>
Reported-by: NIgor Zhbanov <i.zhbanov@omprussia.ru>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NLin Yujun <linyujun809@huawei.com>
Reviewed-by: NZhang Jianhua <chris.zjh@huawei.com>
Signed-off-by: NYongqiang Liu <liuyongqiang13@huawei.com>
上级 47477ca7
...@@ -774,7 +774,7 @@ static int __init initcall_blacklist(char *str) ...@@ -774,7 +774,7 @@ static int __init initcall_blacklist(char *str)
} }
} while (str_entry); } while (str_entry);
return 0; return 1;
} }
static bool __init_or_module initcall_blacklisted(initcall_t fn) static bool __init_or_module initcall_blacklisted(initcall_t fn)
...@@ -1027,7 +1027,9 @@ static noinline void __init kernel_init_freeable(void); ...@@ -1027,7 +1027,9 @@ static noinline void __init kernel_init_freeable(void);
bool rodata_enabled __ro_after_init = true; bool rodata_enabled __ro_after_init = true;
static int __init set_debug_rodata(char *str) static int __init set_debug_rodata(char *str)
{ {
return strtobool(str, &rodata_enabled); if (strtobool(str, &rodata_enabled))
pr_warn("Invalid option string for rodata: '%s'\n", str);
return 1;
} }
__setup("rodata=", set_debug_rodata); __setup("rodata=", set_debug_rodata);
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册