[Bug 1896281] Re: glibc 2.32 leaks errno in sched_rr_get_interval fallback
Balint Reczey
1896281 at bugs.launchpad.net
Mon Nov 2 20:44:44 UTC 2020
** Changed in: glibc (Ubuntu)
Importance: Medium => Low
** Changed in: glibc (Ubuntu Groovy)
Importance: Medium => Low
** Changed in: glibc (Ubuntu)
Status: New => Invalid
** Changed in: glibc (Ubuntu Groovy)
Status: New => Invalid
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to glibc in Ubuntu.
https://bugs.launchpad.net/bugs/1896281
Title:
glibc 2.32 leaks errno in sched_rr_get_interval fallback
Status in GLibC:
Invalid
Status in glibc package in Ubuntu:
Invalid
Status in unhide package in Ubuntu:
Fix Released
Status in glibc source package in Groovy:
Invalid
Status in unhide source package in Groovy:
Fix Released
Bug description:
root at autopkgtest-lxd-rygyvj:/tmp/autopkgtest.Pui0CD/build.uqw/src# strace ./a.out
execve("./a.out", ["./a.out"], 0xfff2c8a0 /* 12 vars */) = 0
brk(NULL) = 0x1942000
uname({sysname="Linux", nodename="autopkgtest-lxd-rygyvj", ...}) = 0
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=24113, ...}) = 0
mmap2(NULL, 24113, PROT_READ, MAP_PRIVATE, 3, 0) = 0xf78ec000
close(3) = 0
openat(AT_FDCWD, "/lib/arm-linux-gnueabihf/libc.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\t\261\1\0004\0\0\0"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=988544, ...}) = 0
mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf78ea000
mmap2(NULL, 1054788, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xf77c6000
mprotect(0xf78b3000, 61440, PROT_NONE) = 0
mmap2(0xf78c2000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xec000) = 0xf78c2000
mmap2(0xf78c6000, 6212, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xf78c6000
close(3) = 0
set_tls(0xf78eac90) = 0
mprotect(0xf78c2000, 8192, PROT_READ) = 0
mprotect(0x81b000, 4096, PROT_READ) = 0
mprotect(0xf78f2000, 4096, PROT_READ) = 0
munmap(0xf78ec000, 24113) = 0
sched_rr_get_interval_time64(1, 0xfff88678) = -1 ENOSYS (Function not implemented)
sched_rr_get_interval(1, {tv_sec=0, tv_nsec=0}) = 0
dup(2) = 3
fcntl64(3, F_GETFL) = 0x402 (flags O_RDWR|O_APPEND)
brk(NULL) = 0x1942000
brk(0x1963000) = 0x1963000
fstat64(3, {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x3), ...}) = 0
write(3, "error: Function not implemented\n", 32error: Function not implemented
) = 32
close(3) = 0
exit_group(0) = ?
+++ exited with 0 +++
root at autopkgtest-lxd-rygyvj:/tmp/autopkgtest.Pui0CD/build.uqw/src# cat test.c
#include <stdio.h>
#include <errno.h>
#include <sched.h>
int main() {
struct timespec tp;
errno = 0;
sched_rr_get_interval(1, &tp);
perror("error");
return 0;
}
When sched_rr_get_interval_time64 is not implemented glibc falls back
to sched_rr_get_interval syscall but does not clear errno.
This breaks 'unhide quick' and a few other unhide commands giving
false positives as a result.
The problem is observed only on armhf testbeds.
To manage notifications about this bug go to:
https://bugs.launchpad.net/glibc/+bug/1896281/+subscriptions
More information about the foundations-bugs
mailing list