Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit acc1546

Browse files
committed
sysctl: Warn on an empty procname element
Add a pr_err warning in case a ctl_table is registered with a sentinel element containing a NULL procname. Signed-off-by: Joel Granados <j.granados@samsung.com>
1 parent 3717540 commit acc1546

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/proc/proc_sysctl.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1131,6 +1131,8 @@ static int sysctl_check_table(const char *path, struct ctl_table_header *header)
11311131
struct ctl_table *entry;
11321132
int err = 0;
11331133
list_for_each_table_entry(entry, header) {
1134+
if (!entry->procname)
1135+
err |= sysctl_err(path, entry, "procname is null");
11341136
if ((entry->proc_handler == proc_dostring) ||
11351137
(entry->proc_handler == proc_dobool) ||
11361138
(entry->proc_handler == proc_dointvec) ||

0 commit comments

Comments
 (0)