* [PATCH 1/2] ath5k: remove permissions from debugfs files
@ 2009-06-28 21:25 Jiri Slaby
2009-06-28 21:25 ` [PATCH 2/2] ath9k: " Jiri Slaby
0 siblings, 1 reply; 2+ messages in thread
From: Jiri Slaby @ 2009-06-28 21:25 UTC (permalink / raw)
To: linville; +Cc: ath5k-devel, ath9k-devel, linux-wireless, linux-kernel,
Jiri Slaby
Don't allow users to open debugfs files, because it can cause oopses.
When a user opens some file, driver unlinks it and frees the
corresponding structure, we will dereference freed memory.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
drivers/net/wireless/ath/ath5k/debug.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/debug.c b/drivers/net/wireless/ath/ath5k/debug.c
index 4904a07..747508c 100644
--- a/drivers/net/wireless/ath/ath5k/debug.c
+++ b/drivers/net/wireless/ath/ath5k/debug.c
@@ -380,13 +380,15 @@ ath5k_debug_init_device(struct ath5k_softc *sc)
sc->debug.debugfs_phydir = debugfs_create_dir(wiphy_name(sc->hw->wiphy),
ath5k_global_debugfs);
- sc->debug.debugfs_debug = debugfs_create_file("debug", S_IWUSR | S_IRUGO,
+ sc->debug.debugfs_debug = debugfs_create_file("debug",
+ S_IWUSR | S_IRUSR,
sc->debug.debugfs_phydir, sc, &fops_debug);
- sc->debug.debugfs_registers = debugfs_create_file("registers", S_IRUGO,
+ sc->debug.debugfs_registers = debugfs_create_file("registers", S_IRUSR,
sc->debug.debugfs_phydir, sc, &fops_registers);
- sc->debug.debugfs_beacon = debugfs_create_file("beacon", S_IWUSR | S_IRUGO,
+ sc->debug.debugfs_beacon = debugfs_create_file("beacon",
+ S_IWUSR | S_IRUSR,
sc->debug.debugfs_phydir, sc, &fops_beacon);
sc->debug.debugfs_reset = debugfs_create_file("reset", S_IWUSR,
--
1.6.3.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* [PATCH 2/2] ath9k: remove permissions from debugfs files
2009-06-28 21:25 [PATCH 1/2] ath5k: remove permissions from debugfs files Jiri Slaby
@ 2009-06-28 21:25 ` Jiri Slaby
0 siblings, 0 replies; 2+ messages in thread
From: Jiri Slaby @ 2009-06-28 21:25 UTC (permalink / raw)
To: linville; +Cc: ath5k-devel, ath9k-devel, linux-wireless, linux-kernel,
Jiri Slaby
Don't allow users to open debugfs files, because it can cause oopses.
When a user opens some file, driver unlinks it and frees the
corresponding structure, we will dereference freed memory.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
---
drivers/net/wireless/ath/ath9k/debug.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
index 6d20725..9f99f00 100644
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
@@ -500,31 +500,31 @@ int ath9k_init_debug(struct ath_softc *sc)
goto err;
sc->debug.debugfs_debug = debugfs_create_file("debug",
- S_IRUGO | S_IWUSR, sc->debug.debugfs_phy, sc, &fops_debug);
+ S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, sc, &fops_debug);
if (!sc->debug.debugfs_debug)
goto err;
- sc->debug.debugfs_dma = debugfs_create_file("dma", S_IRUGO,
+ sc->debug.debugfs_dma = debugfs_create_file("dma", S_IRUSR,
sc->debug.debugfs_phy, sc, &fops_dma);
if (!sc->debug.debugfs_dma)
goto err;
sc->debug.debugfs_interrupt = debugfs_create_file("interrupt",
- S_IRUGO,
+ S_IRUSR,
sc->debug.debugfs_phy,
sc, &fops_interrupt);
if (!sc->debug.debugfs_interrupt)
goto err;
sc->debug.debugfs_rcstat = debugfs_create_file("rcstat",
- S_IRUGO,
+ S_IRUSR,
sc->debug.debugfs_phy,
sc, &fops_rcstat);
if (!sc->debug.debugfs_rcstat)
goto err;
sc->debug.debugfs_wiphy = debugfs_create_file(
- "wiphy", S_IRUGO | S_IWUSR, sc->debug.debugfs_phy, sc,
+ "wiphy", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, sc,
&fops_wiphy);
if (!sc->debug.debugfs_wiphy)
goto err;
--
1.6.3.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-06-28 21:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-28 21:25 [PATCH 1/2] ath5k: remove permissions from debugfs files Jiri Slaby
2009-06-28 21:25 ` [PATCH 2/2] ath9k: " Jiri Slaby
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox