Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(possible) bug: pledging (v1.9) non-cosmo '/usr/bin/ls' (9.5) on linux displays permission errors and lists files #1314

Open
davidhaley opened this issue Oct 10, 2024 · 0 comments
Labels
low severity Used to report low severity bugs (e.g. cosmetic issues, non critical UI glitches)

Comments

@davidhaley
Copy link

davidhaley commented Oct 10, 2024

What happened?

Hello,

This may or may not be a bug, depending on whether or not pledging non-cosmopolitan binaries (i.e. /usr/bin/ls) is supported. The cosmopolitan ls works as expected.


I was testing out pledge with ls and I noticed the following.

./pledge -v r:$HOME/Downloads/bin -p 'stdio rpath' ls -lah displays permission errors and lists files.

./pledge -k -v r:$HOME/Downloads/bin -p 'stdio rpath' ls -lah fails with a 'Bad system call' (-k flag) (it kills on EPERM, which makes sense)

The permissions in the directory are r-x, and contain the cosmopolitan binaries. The output of both commands with --ftrace look identical (other than additional output including the permission errors and list of files)


Additional info:

The coredump with -k shows:

Program terminated with signal SIGSYS, Bad system call.
#0  ... in tcgetattr () from /usr/lib/libc.so.6

Adding tty to the pledge list, and rerunning, produces a coredump with:

Program terminated with signal SIGSYS, Bad system call.
#0  ... in listxattr () from /usr/lib/libc.so.6

Finally, adding fattr to the pledge list still produces the bad system call error when listxattr is called.


Version

Cosompolitan Pledge v1.9

/usr/bin/ls --version
ls (GNU coreutils) 9.5

What operating system are you seeing the problem on?

Linux

Relevant log output

https://gist.github.com/davidhaley/c48cb5fbf6967305ad82eec343bbc506
@davidhaley davidhaley added the low severity Used to report low severity bugs (e.g. cosmetic issues, non critical UI glitches) label Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
low severity Used to report low severity bugs (e.g. cosmetic issues, non critical UI glitches)
Projects
None yet
Development

No branches or pull requests

1 participant