There's no such syscall on x86_64. Seems to be triggered when the process tries to check the state of a loadable kernel module: rt_sigprocmask(SIG_SETMASK, [], ~[ILL TRAP BUS FPE KILL SEGV STOP], 8) = 0 open("/sys/module/gpio_mockup/initstate", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory) rt_sigprocmask(SIG_SETMASK, ~[ILL TRAP BUS FPE KILL SEGV STOP], NULL, 8) = 0 gettid() = 6324 read(65530, "Z", 1) = 1 stat("/sys/module/gpio_mockup", 0xffefff220) = -1 ENOENT (No such file or directory) getpid() = 6324 write(65529, "--6324-- WARNING: unhandled sysc"..., 41--6324-- WARNING: unhandled syscall: 313 ) = 41 In order to reproduce: 1. Clone https://github.com/brgl/libgpiod 2. Build the test suite (refer to README) 3. Run the test suite under memcheck (must run tests/.libs/gpiod-test, not the libtool wrapper in tests/)
That is the finit_module which loads a kernel module from a file descriptor.
Right, I checked the wrong file. It's in /usr/include/x86_64-linux-gnu/asm/unistd_64.h on Debian. I'll try to create a wrapper for this syscall.
Sure there is - it's finit_module.
Hmm... it's already there in ./coregrind/m_syswrap/syswrap-amd64-linux.c but it's commented out: 835 // LIN__(__NR_finit_module, sys_ni_syscall), // 313 Does it mean that it just doesn't have a wrapper in valgrind or some other reason?
It means the syscall wrapper needs a careful review w.r.t. kernel sources and ideally also a test case.
Created attachment 105623 [details] add wrapper for finit_module() There was no wrapper - only the basic definitions. I wrote the wrapper and it fixes the issue on my setup. Patch attached.
(In reply to Bartosz Golaszewski from comment #6) Committed, r16403. Thanks for the patch.