"function not implemented" occured when running ls
Can anyone help me with this output. "ls: cannot access <folder/file/*>: Function not implemented", the output did shown after apt uprade not sure what package it did

Solution:Jump to solution
Strace logs all the syscalls a program is making.
So old
ls
tried to use the statx()
syscall.
Introduced in Kernel version 4.11.0
https://man7.org/linux/man-pages/man2/statx.2.html...57 Replies
can you send me a screenshot after running this?
Also what version of the
coreutils
package do you have installed?
You can check with either ls --version
or pkg info coreutils
Screenshot isn't gonna be too useful.
strace
logs are very noisy.
That'll go off the screen almost immediately.
We'd want a full text log if you wanna go with that approach for debugging.
So something like strace -o ls_strace.log ls
And then upload ls_strace.log
here.that also works

Im concerned about my system, i guess it's just user space
Might other user replicate this :fishpog:
You see how it says 9.7-3 in
pkg info
but 9.5 in ls --version
?
You're running an outdated package version.Ill upgrade all
See if the issue persists with 9.7
Still is

Can you get a log with 9.7 as well?
I'd like to see if there's anything different and if it still has the same issue
As in, byte for byte identical.

:worksonmymachine:
Which shouldn't be the case...
Yes, goodluck. Happy bugging
There's a
getrandom()
call at the start of the process, it is statistically impossible that that returned the same output, byte for byte.
I think you just sent two copies of the same log on accident.hmm
can someone send the strace output for the old ls before the update?
..
Oh... I might have been stupid.
Yep okay.
I downloaded the original
lstrace.txt
and then lstrace(1).txt
from the second one.
Which is the same file...
Now they're actually different after I grabbed the second log.ohh, what did you find?
This is what I was expecting.

Well nothing yet, but I actually have both logs now.
The 9.7 one actually exits with code 1, which I would have expected.
hmm
lemme try do my own research
Regards, ls did run after upgrade
These are only in
lstrace.txt
, not lstrace(1).txt
Out of curiosity...
What Kernel version is your phone running?
You can use uname -r
to check.what does
statx
syscall do?4.9.227-perf-22853213 vendor based
i've never heard of that before except the
stat
variantBingo.
Fk
Solution
Strace logs all the syscalls a program is making.
So old
ls
tried to use the statx()
syscall.
Introduced in Kernel version 4.11.0
https://man7.org/linux/man-pages/man2/statx.2.htmlah just as i expected
i guess the latest ls doesn't use that syscall, no?
I recall this from a Zig package issue.
I'm guessing they have a fallback for older kernels.
so i guess it's not really a problem anymore
since somewhere in the code, there's an if macro that guards the use of statx
:allok:
I'm actually gonna try to look at the source code for this.
Aaaaaaaaahh kernels fneksksncnsalzk
GitHub
coreutils/src/ls.c at v9.8 · coreutils/coreutils
upstream mirror. Contribute to coreutils/coreutils development by creating an account on GitHub.
(This is 9,8 but it hasn't changed)
GitHub
ls: use statx instead of stat when available · coreutils/coreutils...
statx allows ls to indicate interest in only certain inode metadata.
This is potentially a win on networked/clustered/distributed
file systems. In cases where we&#39;d have to do a full, heavyw...
they did add a simple guard for
STATX_INO
i guess the build script had hiccups that caused it to build with statx support?Eh who knows.
just a software bug ig
yep
Sorry, 4.11 not 4.19.
:eyeping:
Nvm
Well let's rate this.
What's the severity here?
A CVSS 4 score is calculate from the following factors:
- Exploitability
- Attack Vector (network, adjascent, local, physical)
- Attack Complexity (low, high)
- Attach Requirements (none, present)
- Privilege level (none, low, high)
- User Interaction (none, passive, active)
- Vulnerable Systems Impact
- Confidentiality (High, Low, None)
- Integrity (High, Low, None)
- Availability (High, Low, None)
- Ongoing Impact
- Same as above, but after patch.
Calculator:
-# https://nvd.nist.gov/vuln-metrics/cvss/v4-calculator
I get a 5.1 out of this if we wanna call it low availability impact for affected systems.
Or 0.0 if we aren't even that charitble to it.

2.1 if we wanna construe "can run commands" as an attack requirement.
If it is, shi
Eh you can assign any bug a score if you wanna be pedantic.
5.1 CVSS doesn't mean it's actually a big deal.
It just user space, i checked my system bin and got a ls
I dunno
Im no dev
Mobile
statx()
is an unprivileged syscall.
If it's not implemented it just can't return the information it's supposed to.What even statx is
It's "2038 safe" reimplementation of the
stat()
syscall.
It returns a bunch of information about the file descriptor it's called with.
The direct equivalent on the shell is the stat
command.x is extra? Like info?
Extra stat
extended
Oh my bad
Yes extended
Man7 org said return a long listed information about the file
F it