ath9k: remove permissions from debugfs files
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> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
parent
31670070ff
commit
9d49e861a5
|
@ -500,31 +500,31 @@ int ath9k_init_debug(struct ath_softc *sc)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
sc->debug.debugfs_debug = debugfs_create_file("debug",
|
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)
|
if (!sc->debug.debugfs_debug)
|
||||||
goto err;
|
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);
|
sc->debug.debugfs_phy, sc, &fops_dma);
|
||||||
if (!sc->debug.debugfs_dma)
|
if (!sc->debug.debugfs_dma)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
sc->debug.debugfs_interrupt = debugfs_create_file("interrupt",
|
sc->debug.debugfs_interrupt = debugfs_create_file("interrupt",
|
||||||
S_IRUGO,
|
S_IRUSR,
|
||||||
sc->debug.debugfs_phy,
|
sc->debug.debugfs_phy,
|
||||||
sc, &fops_interrupt);
|
sc, &fops_interrupt);
|
||||||
if (!sc->debug.debugfs_interrupt)
|
if (!sc->debug.debugfs_interrupt)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
sc->debug.debugfs_rcstat = debugfs_create_file("rcstat",
|
sc->debug.debugfs_rcstat = debugfs_create_file("rcstat",
|
||||||
S_IRUGO,
|
S_IRUSR,
|
||||||
sc->debug.debugfs_phy,
|
sc->debug.debugfs_phy,
|
||||||
sc, &fops_rcstat);
|
sc, &fops_rcstat);
|
||||||
if (!sc->debug.debugfs_rcstat)
|
if (!sc->debug.debugfs_rcstat)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
||||||
sc->debug.debugfs_wiphy = debugfs_create_file(
|
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);
|
&fops_wiphy);
|
||||||
if (!sc->debug.debugfs_wiphy)
|
if (!sc->debug.debugfs_wiphy)
|
||||||
goto err;
|
goto err;
|
||||||
|
|
Loading…
Reference in New Issue