0

I am running a program on kali Linux. The program uses Openssl and some other networking libraries. When I try to run the program I get the output below:

Failed to open /sys/kernel/debug/ieee80211/phy6/ath9k_htc/inject_noack for writing
Failed to open /sys/kernel/debug/ieee80211/phy14/ath9k_htc/inject_noack for writing
Testing ACK generation...
Failed to open /sys/kernel/debug/ieee80211/phy6/ath9k_htc/macaddr for writing
Failed to open /sys/kernel/debug/ieee80211/phy6/ath9k_htc/bssidmask for writing

When I realized this error, I checked and Failed to open /sys/kernel/debug/ieee80211/phy6 folder existed but it was all empty. I tried to run chmod 777 to make the rest usable, even with root privileges.

So these folders are only used for logging the debug info? If so maybe I can comment out in the program where it uses this directory?

Why does /sys/kernel/debug/ieee80211/phy6/ phy1,phy14,phy15,phy16 are empty. And if these folders are for logging debug info, I don't understand why developers tried hard to use a folder which can't even be reached without kernel rights.

And even with root privileges, I can't create a directory under these folders. What is the solution, is it common for programs to use these debug folders which can't even be opened/edited with root?

┌──(root㉿kali)-[/sys/kernel/debug/ieee80211/phy14]
└─# chmod 777 /sys/kernel/debug/ieee80211/phy6/                                                                                                                                                                                            

┌──(root㉿kali)-[/sys/kernel/debug/ieee80211/phy14]
└─# mkdir ath9k_htc          

UPDATE:

With chmod I get

┌──(root㉿kali)-[/sys/kernel]
└─# sudo chmod 777 -R debug
chmod: changing permissions of 'debug/tracing': Operation not permitted

kernel version:

┌──(root㉿kali)-[/sys/kernel]
└─# uname -r                                                                                                                                                                                                                               
6.5.0-kali3-amd64

I get this error when following the installation:

┌──(root㉿kali)-[/home/kali/Desktop]
└─# cd drivers && make defconfig-ath9k-debug                                                                                                                                                                                               
/--------------
| Your kernel headers are incomplete/not installed.
| Please install kernel headers, including a .config
| file or use the KLIB/KLIB_BUILD make variables to
| set the kernel to build against, e.g.
|   make KLIB=/lib/modules/3.1.7/
| to compile/install for the installed kernel 3.1.7
| (that isn't currently running.)
\--
make: *** [Makefile:41: defconfig-ath9k-debug] Error 1
1
  • 1
    Note that everything under /sys are virtual directories and files provided via the kernel (just like the stuff under /proc). Ordinary filesystem permissions may not apply to everything.
    – Kusalananda
    Commented Feb 27 at 13:46

1 Answer 1

1

So these folders are only used for logging the debug info? If so maybe I can comment out in the program where it uses this directory?

No, these aren't actual folders with actual files in them. They are just a kernel API: reading and/or writing to these files causes specific things to happen in the kernel; and: what operations are possible on these files and directories are up to kernel to define. So, your chmod seems to have no effect, because there's nothing there.

8
  • 1
    what? no. You don't "install" an API. An API is exactly what the name says: the idea of an interface. Your kernel provides you with this API. The API is there: It is these directories and files in them. The operations you are trying to do on it just aren't meaningful on them, so they don't work. You can't mkdir ath9k and hope that this magically implements the debugging mode for the ath9k driver. You would actually need to write kernel code that implements that, and your hardware actually needs to have the functionality. I don't think either is happening. Commented Feb 27 at 14:17
  • so, do the others have the same kernel and same hardware as you? Commented Feb 27 at 14:26
  • 1
    @umarkaa and that github page lists exactly 5 devices this has been shown to work with. You haven't given us any information about your hardware, do you even have one of the supported devices? It seems to only support kernels up to 5.3, is your kernel that old?>
    – terdon
    Commented Feb 27 at 14:27
  • I have 3 Alfa awus 036nh adapters.. so i have the correct ones, hmm, how do i check the kernel version? and if it is not the correct one, how do i downgrade ?
    – umarkaa
    Commented Feb 27 at 14:29
  • with according to what @MarcusMüller said, if i downgrade the kernel the api JUST appears ?
    – umarkaa
    Commented Feb 27 at 14:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .