World writeable MUX
Subsystems (3)
Hi Tony,
I saw a few patches floating around regarding world writeable sysfs files and decided to grep around arch/arm/*omap* to try and see if we were safe. Turns out anyone can change MUX entries via the debugfs interface:
static void __init omap_mux_dbg_create_entry(
struct omap_mux_partition *partition, struct dentry *mux_dbg_dir)
{
struct omap_mux_entry *e;
list_for_each_entry(e, &partition->muxmodes, node) {
struct omap_mux *m = &e->mux;
(void)debugfs_create_file(m->muxnames[0], S_IWUGO, mux_dbg_dir,
m, &omap_mux_dbg_signal_fops);
}
}is that really expected ? I guess not, attached there's a small patch to fix that one.
Signature · 1 line
balbi
Quoted 1 line
From
d3e0b6d3ddd82b1f9ab0299105cb8bf29d142ac4Mon Sep 17 00:00:00 2001
From: Felipe Balbi <[email protected]>
Date: Fri, 4 Feb 2011 14:42:16 +0200
Subject: [PATCH] arm: omap2: fix a world writeable debugfs file
Organization: Texas Instruments\n
don't allow anyone to fiddle with the mux settings.
--- arch/arm/mach-omap2/mux.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/mux.c +1 -1
@@ -605,7 +605,7 @@ static void __init omap_mux_dbg_create_entry(list_for_each_entry (e, &partition->muxmodes, node) {struct omap_mux *m = &e->mux; - (void )debugfs_create_file (m->muxnames[0 ],S_IWUGO , mux_dbg_dir, + (void )debugfs_create_file (m->muxnames[0 ],S_IWUSR , mux_dbg_dir, m, &omap_mux_dbg_signal_fops); } }
Signature · 1 line
1.7.4.rc2
Tony Lindgren
maintainerQuoted 21 lines · Felipe Balbi
Hi Tony,
I saw a few patches floating around regarding world writeable sysfs files and decided to grep around
arch/arm/*omap*to try and see if we were safe. Turns out anyone can change MUX entries via the debugfs interface:static void
__initomap_mux_dbg_create_entry(
structomap_mux_partition*partition, struct dentry*mux_dbg_dir){ struct omap_mux_entry *e; list_for_each_entry(e, &partition->muxmodes, node) { struct omap_mux *m = &e->mux; (void)debugfs_create_file(m->muxnames[0], S_IWUGO, mux_dbg_dir, m, &omap_mux_dbg_signal_fops); } }
Quoted 2 lines
is that really expected ? I guess not, attached there's a small patch to fix that one.
Heh, no it should not be like that, thanks will queue as a fix.
Tony