-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
None
-
None
-
3
-
9223372036854775807
In lustre/utils/l_getsepol.c, every error path calls errlog() and then does rc = -errno.
But errlog() calls isatty(STDIN_FILENO). When the kernel runs l_getsepol through
call_usermodehelper(), stdin is not a tty. So isatty() returns 0 and sets errno to
ENOTTY, and the real error is lost. Every failure is then reported as -ENOTTY (-25).
openlog(), vsyslog() and closelog() can also change errno.
Fix: save errno at the start of errlog() and restore it before returning.
Also in errlog(): the same va_list is passed to vsyslog() and then to vfprintf(). Reusing
a va_list after it has been consumed is undefined behavior. Use va_copy() for the second
call. This only matters when l_getsepol is run by hand from a terminal.
Found while debugging LU-20119.
- is related to
-
LU-20119 RHEL/Rocky 10.1 selinux-policy drops kernel_generic_helper_t, breaking all Lustre
-
- Resolved
-