* [PATCH] sysctl: Fix duplicate path separator in printed entries
@ 2022-01-07 10:38 Geert Uytterhoeven
2022-01-07 11:29 ` Christian Brauner
2022-01-11 18:04 ` Luis Chamberlain
0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2022-01-07 10:38 UTC (permalink / raw)
To: Luis Chamberlain, Kees Cook, Iurii Zaikin
Cc: linux-kernel, linux-fsdevel, Geert Uytterhoeven
sysctl_print_dir() always terminates the printed path name with a slash,
so printing a slash before the file part causes a duplicate like in
sysctl duplicate entry: /kernel//perf_user_access
Fix this by dropping the extra slash.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
fs/proc/proc_sysctl.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index 5d66faecd4ef06b8..4f6168ec5079fc8f 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -163,7 +163,7 @@ static int insert_entry(struct ctl_table_header *head, struct ctl_table *entry)
else {
pr_err("sysctl duplicate entry: ");
sysctl_print_dir(head->parent);
- pr_cont("/%s\n", entry->procname);
+ pr_cont("%s\n", entry->procname);
return -EEXIST;
}
}
@@ -1020,8 +1020,8 @@ static struct ctl_dir *get_subdir(struct ctl_dir *dir,
if (IS_ERR(subdir)) {
pr_err("sysctl could not get directory: ");
sysctl_print_dir(dir);
- pr_cont("/%*.*s %ld\n",
- namelen, namelen, name, PTR_ERR(subdir));
+ pr_cont("%*.*s %ld\n", namelen, namelen, name,
+ PTR_ERR(subdir));
}
drop_sysctl_table(&dir->header);
if (new)
@@ -1626,7 +1626,7 @@ static void put_links(struct ctl_table_header *header)
else {
pr_err("sysctl link missing during unregister: ");
sysctl_print_dir(parent);
- pr_cont("/%s\n", name);
+ pr_cont("%s\n", name);
}
}
}
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] sysctl: Fix duplicate path separator in printed entries
2022-01-07 10:38 [PATCH] sysctl: Fix duplicate path separator in printed entries Geert Uytterhoeven
@ 2022-01-07 11:29 ` Christian Brauner
2022-01-11 18:04 ` Luis Chamberlain
1 sibling, 0 replies; 3+ messages in thread
From: Christian Brauner @ 2022-01-07 11:29 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Luis Chamberlain, Kees Cook, Iurii Zaikin, linux-kernel, linux-fsdevel
On Fri, Jan 07, 2022 at 11:38:44AM +0100, Geert Uytterhoeven wrote:
> sysctl_print_dir() always terminates the printed path name with a slash,
> so printing a slash before the file part causes a duplicate like in
>
> sysctl duplicate entry: /kernel//perf_user_access
>
> Fix this by dropping the extra slash.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
Seems good,
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] sysctl: Fix duplicate path separator in printed entries
2022-01-07 10:38 [PATCH] sysctl: Fix duplicate path separator in printed entries Geert Uytterhoeven
2022-01-07 11:29 ` Christian Brauner
@ 2022-01-11 18:04 ` Luis Chamberlain
1 sibling, 0 replies; 3+ messages in thread
From: Luis Chamberlain @ 2022-01-11 18:04 UTC (permalink / raw)
To: Geert Uytterhoeven, Andrew Morton
Cc: Kees Cook, Iurii Zaikin, linux-kernel, linux-fsdevel
On Fri, Jan 07, 2022 at 11:38:44AM +0100, Geert Uytterhoeven wrote:
> sysctl_print_dir() always terminates the printed path name with a slash,
> so printing a slash before the file part causes a duplicate like in
>
> sysctl duplicate entry: /kernel//perf_user_access
>
> Fix this by dropping the extra slash.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Luis Chamberlain <mcgrof@kernel.org>
Luis
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-01-11 18:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-07 10:38 [PATCH] sysctl: Fix duplicate path separator in printed entries Geert Uytterhoeven
2022-01-07 11:29 ` Christian Brauner
2022-01-11 18:04 ` Luis Chamberlain
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.