<<<test_start>>> tag=setdomainname01_valgrind_memory_leak_check stime=1474195205 cmdline=" valgrind -q --leak-check=full --trace-children=yes setdomainname01" contacts="" analysis=exit <<<test_output>>> --24445-- WARNING: unhandled amd64-linux syscall: 171 --24445-- You may be able to write your own handler. --24445-- Read the file README_MISSING_SYSCALL_OR_IOCTL. --24445-- Nevertheless we consider this a bug. Please report --24445-- it at http://valgrind.org/support/bug_reports.html. --24445-- WARNING: unhandled amd64-linux syscall: 171 --24445-- You may be able to write your own handler. --24445-- Read the file README_MISSING_SYSCALL_OR_IOCTL. --24445-- Nevertheless we consider this a bug. Please report --24445-- it at http://valgrind.org/support/bug_reports.html. setdomainname01 1 TFAIL : setdomainname01.c:104: setdomainname() Failed, errno = 38 : Function not implemented setdomainname01 0 TWARN : setdomainname01.c:146: setdomainname() failed while restoring domainname to "(none)" <<<execution_status>>> initiation_status="ok" duration=0 termination_type=exited termination_id=5 corefile=no cutime=60 cstime=1 <<<test_end>>> Reproducible: Always
Can we close it? IIRC it was merged into valgrind.
I see no sign that this has been added.
This has only been implemented for MIPS (but it doesn't do any checks on the supplied name)
Created attachment 185069 [details] proposed patch
Comment on attachment 185069 [details] proposed patch The len argument specifies the number of bytes in name. (Thus, name does not require a terminating null byte.) So don't you want to check the name here: +PRE(sys_setdomainname) +{ + PRINT ("sys_setdomainname ( %#" FMT_REGWORD "x, %ld )", ARG1, SARG2); + PRE_REG_READ2 (long, "setdomainname", const void *, name, int, len); +} PRE_MEM_READ("setdomainname.name", ARG1, ARG2); ?
Created attachment 185102 [details] updated patch Oh, thanks for pointing that out. Please check the updated patch.
Made this one small tweak: - PRE_MEM_READ("setdomainname.name", ARG1, ARG2); + PRE_MEM_READ("setdomainname(name)", ARG1, ARG2); Was my fault/suggestion, but the variant with "syscall_name(param_name)" is more consistent with other code. Pushed as: commit 2604bb753a9ff461550e0d4d0c1ebd3ab6488d6d Author: Martin Cermak <mcermak@redhat.com> Date: Fri Sep 19 09:31:39 2025 +0200 Wrap the setdomainname syscall The setdomainname() call sets the domain name to the value given in the character array name. The len argument specifies the number of bytes in name. (Thus, name does not require a terminating null byte.) Declare a setdomainname wrapper in priv_syswrap-linux.h and hook it for {amd64,arm,arm64,mips64,ppc32,ppc64,riscv64,s390x,x86}-linux using LINX_ with PRE handler in syswrap-linux.c https://bugs.kde.org/show_bug.cgi?id=369030