Incorrect and confusing error message on EACCES

Open Beginner friendly
#492 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 4 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
70/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
c, linux

Research direction

Start by tracing how modinfo handles the failed file access shown in the report and how it formats the “not found” error. Check the handling of EACCES and compare it with the reported strace result. Done means permission failures are reported as permission denied or similar while missing files still report not found; the issue does not name source files or tests.

Written by the indexing model from the issue text.

Description

From Debian bug https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1104199.

When modinfo is unable to access a module due to path permissions it gets EACCES and that should be reported to the user as "permission denied" (or similar). It currently says "not found" which leads the user to believe that it was not there which is not the situation.

# modinfo /var/lib/dkms/nvidia-current/535.216.03/6.12.22-amd64/x86_64/module/nvidia-current-peermem.ko.xz
modinfo: ERROR: Module /var/lib/dkms/nvidia-current/535.216.03/6.12.22-amd64/x86_64/module/nvidia-current-peermem.ko.xz not found.
newfstatat(AT_FDCWD, "/var/lib/dkms/nvidia-current/535.216.03/6.12.22-amd64/x86_64/module/nvidia-current-peermem.ko.xz", 0x7ffc581232c0, 0) = -1 EACCES (Permission denied)

This happens under SE Linux if the file has the wrong label.

Dominant language
C
Stars
116
Forks
70
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from kmod-project/kmod

All issues in kmod-project/kmod

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.