From: Paul Floyd Date: Sun, 29 Sep 2024 08:02:33 +0000 (+0200) Subject: FreeBSD procctl syscall: change arg name in error messages X-Git-Tag: VALGRIND_3_24_0~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a215f02d49423ea78d00f8afbbfb1afcd7583b04;p=thirdparty%2Fvalgrind.git FreeBSD procctl syscall: change arg name in error messages The man page was inconsistent in the use of 'data' or 'arg' for the fourth argument. I chose to use 'arg'. The manpage has now been cleaned up and uses 'data'. So I'm switching to use the same name. --- diff --git a/coregrind/m_syswrap/syswrap-amd64-freebsd.c b/coregrind/m_syswrap/syswrap-amd64-freebsd.c index f28ae4f5f..fb2e677cc 100644 --- a/coregrind/m_syswrap/syswrap-amd64-freebsd.c +++ b/coregrind/m_syswrap/syswrap-amd64-freebsd.c @@ -881,17 +881,13 @@ POST(sys_wait6) } } -// the man page is inconsistent for the last argument -// See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247386 -// will stick to 'arg' for simplicity - // SYS_procctl 544 -// int procctl(idtype_t idtype, id_t id, int cmd, void *arg); +// int procctl(idtype_t idtype, id_t id, int cmd, void *data); PRE(sys_procctl) { PRINT("sys_procctl ( %" FMT_REGWORD "d, %" FMT_REGWORD "d, %" FMT_REGWORD"d, %#" FMT_REGWORD "x )", SARG1, SARG2, SARG3, ARG4); - PRE_REG_READ4(int, "procctl", vki_idtype_t, idtype, vki_id_t, id, int, cmd, void *, arg); + PRE_REG_READ4(int, "procctl", vki_idtype_t, idtype, vki_id_t, id, int, cmd, void *, data); switch (ARG3) { case VKI_PROC_ASLR_CTL: case VKI_PROC_SPROTECT: @@ -901,13 +897,13 @@ PRE(sys_procctl) case VKI_PROC_STACKGAP_CTL: case VKI_PROC_NO_NEW_PRIVS_CTL: case VKI_PROC_WXMAP_CTL: - PRE_MEM_READ("procctl(arg)", ARG4, sizeof(int)); + PRE_MEM_READ("procctl(data)", ARG4, sizeof(int)); break; case VKI_PROC_REAP_STATUS: - PRE_MEM_READ("procctl(arg)", ARG4, sizeof(struct vki_procctl_reaper_status)); + PRE_MEM_READ("procctl(data)", ARG4, sizeof(struct vki_procctl_reaper_status)); break; case VKI_PROC_REAP_GETPIDS: - PRE_MEM_READ("procctl(arg)", ARG4, sizeof(struct vki_procctl_reaper_pids)); + PRE_MEM_READ("procctl(data)", ARG4, sizeof(struct vki_procctl_reaper_pids)); break; case VKI_PROC_REAP_KILL: /* The first three fields are reads @@ -921,8 +917,8 @@ PRE(sys_procctl) * * There is also a pad field */ - PRE_MEM_READ("procctl(arg)", ARG4, sizeof(int) + sizeof(u_int) + sizeof(vki_pid_t)); - PRE_MEM_WRITE("procctl(arg)", ARG4+offsetof(struct vki_procctl_reaper_kill, rk_killed), sizeof(u_int) + sizeof(vki_pid_t)); + PRE_MEM_READ("procctl(data)", ARG4, sizeof(int) + sizeof(u_int) + sizeof(vki_pid_t)); + PRE_MEM_WRITE("procctl(data)", ARG4+offsetof(struct vki_procctl_reaper_kill, rk_killed), sizeof(u_int) + sizeof(vki_pid_t)); break; case VKI_PROC_ASLR_STATUS: case VKI_PROC_PDEATHSIG_STATUS: @@ -931,7 +927,7 @@ PRE(sys_procctl) case VKI_PROC_TRACE_STATUS: case VKI_PROC_NO_NEW_PRIVS_STATUS: case VKI_PROC_WXMAP_STATUS: - PRE_MEM_WRITE("procctl(arg)", ARG4, sizeof(int)); + PRE_MEM_WRITE("procctl(data)", ARG4, sizeof(int)); case VKI_PROC_REAP_ACQUIRE: case VKI_PROC_REAP_RELEASE: default: diff --git a/memcheck/tests/freebsd/scalar.stderr.exp b/memcheck/tests/freebsd/scalar.stderr.exp index 5ea7543b6..6cd6cf2ec 100644 --- a/memcheck/tests/freebsd/scalar.stderr.exp +++ b/memcheck/tests/freebsd/scalar.stderr.exp @@ -4953,10 +4953,10 @@ Syscall param procctl(id) contains uninitialised byte(s) Syscall param procctl(cmd) contains uninitialised byte(s) ... -Syscall param procctl(arg) contains uninitialised byte(s) +Syscall param procctl(data) contains uninitialised byte(s) ... -Syscall param procctl(arg) points to unaddressable byte(s) +Syscall param procctl(data) points to unaddressable byte(s) ... Address 0x........ is not stack'd, malloc'd or (recently) free'd diff --git a/memcheck/tests/freebsd/scalar.stderr.exp-amd64-141 b/memcheck/tests/freebsd/scalar.stderr.exp-amd64-141 index 4d22fdc83..0262328fa 100644 --- a/memcheck/tests/freebsd/scalar.stderr.exp-amd64-141 +++ b/memcheck/tests/freebsd/scalar.stderr.exp-amd64-141 @@ -4866,10 +4866,10 @@ Syscall param procctl(id) contains uninitialised byte(s) Syscall param procctl(cmd) contains uninitialised byte(s) ... -Syscall param procctl(arg) contains uninitialised byte(s) +Syscall param procctl(data) contains uninitialised byte(s) ... -Syscall param procctl(arg) points to unaddressable byte(s) +Syscall param procctl(data) points to unaddressable byte(s) ... Address 0x........ is not stack'd, malloc'd or (recently) free'd diff --git a/memcheck/tests/freebsd/scalar.stderr.exp-arm64 b/memcheck/tests/freebsd/scalar.stderr.exp-arm64 index 78f61f9aa..ff5241eeb 100644 --- a/memcheck/tests/freebsd/scalar.stderr.exp-arm64 +++ b/memcheck/tests/freebsd/scalar.stderr.exp-arm64 @@ -4925,10 +4925,10 @@ Syscall param procctl(id) contains uninitialised byte(s) Syscall param procctl(cmd) contains uninitialised byte(s) ... -Syscall param procctl(arg) contains uninitialised byte(s) +Syscall param procctl(data) contains uninitialised byte(s) ... -Syscall param procctl(arg) points to unaddressable byte(s) +Syscall param procctl(data) points to unaddressable byte(s) ... Address 0x........ is not stack'd, malloc'd or (recently) free'd diff --git a/memcheck/tests/freebsd/scalar.stderr.exp-arm64_2 b/memcheck/tests/freebsd/scalar.stderr.exp-arm64_2 index 5ac5a583f..0110be2d0 100644 --- a/memcheck/tests/freebsd/scalar.stderr.exp-arm64_2 +++ b/memcheck/tests/freebsd/scalar.stderr.exp-arm64_2 @@ -4838,10 +4838,10 @@ Syscall param procctl(id) contains uninitialised byte(s) Syscall param procctl(cmd) contains uninitialised byte(s) ... -Syscall param procctl(arg) contains uninitialised byte(s) +Syscall param procctl(data) contains uninitialised byte(s) ... -Syscall param procctl(arg) points to unaddressable byte(s) +Syscall param procctl(data) points to unaddressable byte(s) ... Address 0x........ is not stack'd, malloc'd or (recently) free'd diff --git a/memcheck/tests/freebsd/scalar.stderr.exp-x86 b/memcheck/tests/freebsd/scalar.stderr.exp-x86 index 106381e11..b8cafee07 100644 --- a/memcheck/tests/freebsd/scalar.stderr.exp-x86 +++ b/memcheck/tests/freebsd/scalar.stderr.exp-x86 @@ -4990,7 +4990,7 @@ Syscall param procctl(id_high) contains uninitialised byte(s) Syscall param procctl(cmd) contains uninitialised byte(s) ... -Syscall param procctl(arg) contains uninitialised byte(s) +Syscall param procctl(data) contains uninitialised byte(s) ... --------------------------------------------------------- @@ -5008,10 +5008,10 @@ Syscall param procctl(id_high) contains uninitialised byte(s) Syscall param procctl(cmd) contains uninitialised byte(s) ... -Syscall param procctl(arg) contains uninitialised byte(s) +Syscall param procctl(data) contains uninitialised byte(s) ... -Syscall param procctl(arg) points to unaddressable byte(s) +Syscall param procctl(data) points to unaddressable byte(s) ... Address 0x........ is not stack'd, malloc'd or (recently) free'd