You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(83) |
Oct
(89) |
Nov
(97) |
Dec
(30) |
2024 |
Jan
(25) |
Feb
(73) |
Mar
(76) |
Apr
(122) |
May
(46) |
Jun
(44) |
Jul
(27) |
Aug
(30) |
Sep
(33) |
Oct
(67) |
Nov
(91) |
Dec
(70) |
2025 |
Jan
(44) |
Feb
(36) |
Mar
(85) |
Apr
(100) |
May
(138) |
Jun
(55) |
Jul
(107) |
Aug
(27) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Mark W. <ma...@so...> - 2024-11-26 21:14:29
|
The branch 'VALGRIND_3_24_BRANCH' was created pointing to: 349b57d3a8... Add open_tree, move_mount, fsopen, fsconfig, fsmount, fspic |
From: Mark W. <ma...@so...> - 2024-11-26 20:36:31
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=71875fc1a3d746c0ea1e7b5d648a010b1559dcd9 commit 71875fc1a3d746c0ea1e7b5d648a010b1559dcd9 Author: Mark Wielaard <ma...@kl...> Date: Tue Nov 26 21:32:59 2024 +0100 Add bug 494246 to NEWS Bug 494246 syscall fsopen not wrapped was fixed in commit 4044bcea0. "Add open_tree, move_mount, fsopen, fsconfig, fsmount, fspick linux syswraps" Diff: --- NEWS | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS b/NEWS index e5a7345e17..2651600222 100644 --- a/NEWS +++ b/NEWS @@ -24,6 +24,7 @@ than mailing the developers (or mailing lists) directly -- bugs that are not entered into bugzilla tend to get forgotten about or ignored. 489913 WARNING: unhandled amd64-linux syscall: 444 (landlock_create_ruleset) +494246 syscall fsopen not wrapped 494327 Crash when running Helgrind built with #define TRACE_PTH_FNS 1 494337 All threaded applications cause still holding lock errors 495488 Add FreeBSD getrlimitusage syscall wrapper |
From: Mark W. <ma...@so...> - 2024-11-26 18:21:17
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=4044bcea0427853fc44a3d02a0fc0b2a81935452 commit 4044bcea0427853fc44a3d02a0fc0b2a81935452 Author: Mark Wielaard <ma...@kl...> Date: Tue Nov 26 19:00:34 2024 +0100 Add open_tree, move_mount, fsopen, fsconfig, fsmount, fspick linux syswraps Shared linux syscalls implementing various file system mount tasks. Since linux kernel version 5.2. Check arguments and track file descriptors. https://bugs.kde.org/show_bug.cgi?id=494246 Diff: --- coregrind/m_syswrap/priv_syswrap-linux.h | 8 ++ coregrind/m_syswrap/syswrap-amd64-linux.c | 6 ++ coregrind/m_syswrap/syswrap-arm-linux.c | 7 +- coregrind/m_syswrap/syswrap-arm64-linux.c | 7 +- coregrind/m_syswrap/syswrap-linux.c | 146 +++++++++++++++++++++++++++ coregrind/m_syswrap/syswrap-mips32-linux.c | 7 +- coregrind/m_syswrap/syswrap-mips64-linux.c | 6 ++ coregrind/m_syswrap/syswrap-nanomips-linux.c | 6 ++ coregrind/m_syswrap/syswrap-ppc32-linux.c | 7 +- coregrind/m_syswrap/syswrap-ppc64-linux.c | 7 +- coregrind/m_syswrap/syswrap-s390x-linux.c | 7 +- coregrind/m_syswrap/syswrap-x86-linux.c | 7 +- 12 files changed, 214 insertions(+), 7 deletions(-) diff --git a/coregrind/m_syswrap/priv_syswrap-linux.h b/coregrind/m_syswrap/priv_syswrap-linux.h index 221439a0ec..1bdd9a94ec 100644 --- a/coregrind/m_syswrap/priv_syswrap-linux.h +++ b/coregrind/m_syswrap/priv_syswrap-linux.h @@ -321,6 +321,14 @@ DECL_TEMPLATE(linux, sys_io_uring_setup); DECL_TEMPLATE(linux, sys_io_uring_enter); DECL_TEMPLATE(linux, sys_io_uring_register); +// open_tree and friends (shared linux syscalls) +DECL_TEMPLATE(linux, sys_open_tree); +DECL_TEMPLATE(linux, sys_move_mount); +DECL_TEMPLATE(linux, sys_fsopen); +DECL_TEMPLATE(linux, sys_fsconfig); +DECL_TEMPLATE(linux, sys_fsmount); +DECL_TEMPLATE(linux, sys_fspick); + // Linux-specific (new in Linux 5.3) DECL_TEMPLATE(linux, sys_pidfd_open); diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c index 9488d3090e..bdba41826a 100644 --- a/coregrind/m_syswrap/syswrap-amd64-linux.c +++ b/coregrind/m_syswrap/syswrap-amd64-linux.c @@ -877,6 +877,12 @@ static SyscallTableEntry syscall_table[] = { LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425 LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426 LINXY(__NR_io_uring_register, sys_io_uring_register), // 427 + LINXY(__NR_open_tree, sys_open_tree), // 428 + LINX_(__NR_move_mount, sys_move_mount), // 429 + LINXY(__NR_fsopen, sys_fsopen), // 430 + LINX_(__NR_fsconfig, sys_fsconfig), // 431 + LINXY(__NR_fsmount, sys_fsmount), // 432 + LINXY(__NR_fspick, sys_fspick), // 433 LINXY(__NR_pidfd_open, sys_pidfd_open), // 434 GENX_(__NR_clone3, sys_ni_syscall), // 435 diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c index 5dac60f821..bbe3e81e7c 100644 --- a/coregrind/m_syswrap/syswrap-arm-linux.c +++ b/coregrind/m_syswrap/syswrap-arm-linux.c @@ -1053,7 +1053,12 @@ static SyscallTableEntry syscall_main_table[] = { LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425 LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426 LINXY(__NR_io_uring_register, sys_io_uring_register), // 427 - + LINXY(__NR_open_tree, sys_open_tree), // 428 + LINX_(__NR_move_mount, sys_move_mount), // 429 + LINXY(__NR_fsopen, sys_fsopen), // 430 + LINX_(__NR_fsconfig, sys_fsconfig), // 431 + LINXY(__NR_fsmount, sys_fsmount), // 432 + LINXY(__NR_fspick, sys_fspick), // 433 LINXY(__NR_pidfd_open, sys_pidfd_open), // 434 GENX_(__NR_clone3, sys_ni_syscall), // 435 LINXY(__NR_close_range, sys_close_range), // 436 diff --git a/coregrind/m_syswrap/syswrap-arm64-linux.c b/coregrind/m_syswrap/syswrap-arm64-linux.c index 151ae0640b..23b0b6b51c 100644 --- a/coregrind/m_syswrap/syswrap-arm64-linux.c +++ b/coregrind/m_syswrap/syswrap-arm64-linux.c @@ -830,7 +830,12 @@ static SyscallTableEntry syscall_main_table[] = { LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425 LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426 LINXY(__NR_io_uring_register, sys_io_uring_register), // 427 - + LINXY(__NR_open_tree, sys_open_tree), // 428 + LINX_(__NR_move_mount, sys_move_mount), // 429 + LINXY(__NR_fsopen, sys_fsopen), // 430 + LINX_(__NR_fsconfig, sys_fsconfig), // 431 + LINXY(__NR_fsmount, sys_fsmount), // 432 + LINXY(__NR_fspick, sys_fspick), // 433 LINXY(__NR_pidfd_open, sys_pidfd_open), // 434 GENX_(__NR_clone3, sys_ni_syscall), // 435 LINXY(__NR_close_range, sys_close_range), // 436 diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index 5af84d7399..e01d920e11 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -13840,6 +13840,152 @@ POST(sys_pidfd_getfd) } } +/* int open_tree (int dfd, const char *filename, unsigned int flags) */ +PRE(sys_open_tree) +{ + PRINT("sys_open_tree ( %ld, %#" FMT_REGWORD "x(%s), %ld", + SARG1, ARG2, (HChar*)(Addr)ARG2, SARG3); + PRE_REG_READ3(long, "open_tree", + int, dfd, const char *, filename, int, flags); + PRE_MEM_RASCIIZ( "open_tree(filename)", ARG2); + /* For absolute filenames, dfd is ignored. If dfd is AT_FDCWD, + filename is relative to cwd. When comparing dfd against AT_FDCWD, + be sure only to compare the bottom 32 bits. */ + if (ML_(safe_to_deref)( (void*)(Addr)ARG2, 1 ) + && *(Char *)(Addr)ARG2 != '/' + && ((Int)ARG1) != ((Int)VKI_AT_FDCWD) + && !ML_(fd_allowed)(ARG1, "open_tree", tid, False)) + SET_STATUS_Failure( VKI_EBADF ); +} + +POST(sys_open_tree) +{ + if (!ML_(fd_allowed)(RES, "open_tree", tid, True)) { + VG_(close)(RES); + SET_STATUS_Failure( VKI_EMFILE ); + } else { + if (VG_(clo_track_fds)) + ML_(record_fd_open_with_given_name)(tid, RES, (HChar*)(Addr)ARG2); + } +} + +/* int move_mount (int from_dfd, const char *from_pathname, + int to_dfd, const char *to_pathname, + unsigned int flags) */ +PRE(sys_move_mount) +{ + PRINT("sys_move_mount ( %ld, %#" FMT_REGWORD "x(%s), " + "%ld, %#" FMT_REGWORD "x(%s), %ld", + SARG1, ARG2, (HChar*)(Addr)ARG2, + SARG3, ARG4, (HChar*)(Addr)ARG4, SARG5); + PRE_REG_READ5(long, "mount_move", + int, from_dfd, const char *, from_pathname, + int, to_dfd, const char*, to_pathname, int, flags); + PRE_MEM_RASCIIZ( "mount_move(from_pathname)", ARG2); + /* For absolute filenames, from_dfd is ignored. If from_dfd is AT_FDCWD, + from_pathname is relative to cwd. When comparing from_dfd against + AT_FDCWD, be sure only to compare the bottom 32 bits. */ + if (ML_(safe_to_deref)( (void*)(Addr)ARG2, 1 ) + && *(Char *)(Addr)ARG2 != '/' + && ((Int)ARG1) != ((Int)VKI_AT_FDCWD) + && !ML_(fd_allowed)(ARG1, "mount_move", tid, False)) + SET_STATUS_Failure( VKI_EBADF ); + PRE_MEM_RASCIIZ( "mount_move(from_pathname)", ARG4); + /* For absolute filenames, to_dfd is ignored. If to_dfd is AT_FDCWD, + to_pathname is relative to cwd. When comparing to_dfd against + AT_FDCWD, be sure only to compare the bottom 32 bits. */ + if (ML_(safe_to_deref)( (void*)(Addr)ARG4, 1 ) + && *(Char *)(Addr)ARG4 != '/' + && ((Int)ARG4) != ((Int)VKI_AT_FDCWD) + && !ML_(fd_allowed)(ARG3, "mount_move", tid, False)) + SET_STATUS_Failure( VKI_EBADF ); +} + +/* int fsopen (const char *fs_name, unsigned int flags) */ +PRE(sys_fsopen) +{ + PRINT("sys_fsopen ( %#" FMT_REGWORD "x(%s), %ld", + ARG1, (HChar*)(Addr)ARG1, SARG2); + PRE_REG_READ2(long, "fsopen", const char *, fs_name, int, flags); + PRE_MEM_RASCIIZ( "fsopen(filename)", ARG1); +} + +POST(sys_fsopen) +{ + if (!ML_(fd_allowed)(RES, "fsopen", tid, True)) { + VG_(close)(RES); + SET_STATUS_Failure( VKI_EMFILE ); + } else { + if (VG_(clo_track_fds)) + ML_(record_fd_open_with_given_name)(tid, RES, (HChar*)(Addr)ARG1); + } +} + +/* int fsmount (int fd, unsigned int flags, unsigned int ms_flags) */ +PRE(sys_fsmount) +{ + PRINT("sys_fsmount ( %ld, %ld, %ld", SARG1, SARG2, SARG3); + PRE_REG_READ3(long, "fsmount", int, fd, int, flags, int, ms_flags); + if (!ML_(fd_allowed)(ARG1, "fsmount", tid, False)) + SET_STATUS_Failure( VKI_EBADF ); +} + +POST(sys_fsmount) +{ + if (!ML_(fd_allowed)(RES, "fsmount", tid, True)) { + VG_(close)(RES); + SET_STATUS_Failure( VKI_EMFILE ); + } else { + if (VG_(clo_track_fds)) + ML_(record_fd_open_nameless)(tid, RES); + } +} + +/* int fsconfig (int fd, unsigned int cmd, const char *key, + const void *value, int aux) */ +PRE(sys_fsconfig) +{ + PRINT("sys_fsconfig ( %ld, %ld, %#" FMT_REGWORD "x(%s), " + "%#" FMT_REGWORD "x, %ld )", + SARG1, SARG2, ARG3, (HChar*)(Addr)ARG3, ARG4, SARG6); + PRE_REG_READ5(long, "fsconfig", int, fd, int, cmd, + const char *, key, const void *, value, int, aux); + if (ARG3) + PRE_MEM_RASCIIZ( "fsconfig(key)", ARG3); + if (!ML_(fd_allowed)(ARG1, "fsconfig", tid, False)) + SET_STATUS_Failure( VKI_EBADF ); + /* XXX we could also check the value based on the cmd FSCONFIG_... */ +} + +/* int fspick (int dfd, const char *path, unsigned int flags) */ +PRE(sys_fspick) +{ + PRINT("sys_fspick ( %ld, %#" FMT_REGWORD "x(%s), %ld", + SARG1, ARG2, (HChar*)(Addr)ARG2, SARG3); + PRE_REG_READ3(long, "fspick", + int, dfd, const char *, filename, int, flags); + PRE_MEM_RASCIIZ( "fspick(path)", ARG2); + /* For absolute filenames, dfd is ignored. If dfd is AT_FDCWD, + path is relative to cwd. When comparing dfd against AT_FDCWD, + be sure only to compare the bottom 32 bits. */ + if (ML_(safe_to_deref)( (void*)(Addr)ARG2, 1 ) + && *(Char *)(Addr)ARG2 != '/' + && ((Int)ARG1) != ((Int)VKI_AT_FDCWD) + && !ML_(fd_allowed)(ARG1, "fspick", tid, False)) + SET_STATUS_Failure( VKI_EBADF ); +} + +POST(sys_fspick) +{ + if (!ML_(fd_allowed)(RES, "fspick", tid, True)) { + VG_(close)(RES); + SET_STATUS_Failure( VKI_EMFILE ); + } else { + if (VG_(clo_track_fds)) + ML_(record_fd_open_with_given_name)(tid, RES, (HChar*)(Addr)ARG2); + } +} + #undef PRE #undef POST diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c index 757b637ba9..39ba911aa5 100644 --- a/coregrind/m_syswrap/syswrap-mips32-linux.c +++ b/coregrind/m_syswrap/syswrap-mips32-linux.c @@ -1137,7 +1137,12 @@ static SyscallTableEntry syscall_main_table[] = { LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425 LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426 LINXY(__NR_io_uring_register, sys_io_uring_register), // 427 - + LINXY(__NR_open_tree, sys_open_tree), // 428 + LINX_(__NR_move_mount, sys_move_mount), // 429 + LINXY(__NR_fsopen, sys_fsopen), // 430 + LINX_(__NR_fsconfig, sys_fsconfig), // 431 + LINXY(__NR_fsmount, sys_fsmount), // 432 + LINXY(__NR_fspick, sys_fspick), // 433 LINXY(__NR_pidfd_open, sys_pidfd_open), // 434 GENX_(__NR_clone3, sys_ni_syscall), // 435 LINXY(__NR_close_range, sys_close_range), // 436 diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c index f0c5f7e04f..d603924c55 100644 --- a/coregrind/m_syswrap/syswrap-mips64-linux.c +++ b/coregrind/m_syswrap/syswrap-mips64-linux.c @@ -818,6 +818,12 @@ static SyscallTableEntry syscall_main_table[] = { LINXY (__NR_io_uring_setup, sys_io_uring_setup), LINXY (__NR_io_uring_enter, sys_io_uring_enter), LINXY (__NR_io_uring_register, sys_io_uring_register), + LINXY (__NR_open_tree, sys_open_tree), + LINX_ (__NR_move_mount, sys_move_mount), + LINXY (__NR_fsopen, sys_fsopen), + LINX_ (__NR_fsconfig, sys_fsconfig), + LINXY (__NR_fsmount, sys_fsmount), + LINXY (__NR_fspick, sys_fspick), LINXY (__NR_pidfd_open, sys_pidfd_open), GENX_ (__NR_clone3, sys_ni_syscall), LINXY (__NR_close_range, sys_close_range), diff --git a/coregrind/m_syswrap/syswrap-nanomips-linux.c b/coregrind/m_syswrap/syswrap-nanomips-linux.c index f466aca147..853495e981 100644 --- a/coregrind/m_syswrap/syswrap-nanomips-linux.c +++ b/coregrind/m_syswrap/syswrap-nanomips-linux.c @@ -824,6 +824,12 @@ static SyscallTableEntry syscall_main_table[] = { LINXY (__NR_io_uring_setup, sys_io_uring_setup), LINXY (__NR_io_uring_enter, sys_io_uring_enter), LINXY (__NR_io_uring_register, sys_io_uring_register), + LINXY (__NR_open_tree, sys_open_tree), + LINX_ (__NR_move_mount, sys_move_mount), + LINXY (__NR_fsopen, sys_fsopen), + LINX_ (__NR_fsconfig, sys_fsconfig), + LINXY (__NR_fsmount, sys_fsmount), + LINXY (__NR_fspick, sys_fspick), LINXY (__NR_pidfd_open, sys_pidfd_open), GENX_ (__NR_clone3, sys_ni_syscall), LINXY (__NR_close_range, sys_close_range), diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c index 634f288ce0..24d8eb2131 100644 --- a/coregrind/m_syswrap/syswrap-ppc32-linux.c +++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c @@ -1059,7 +1059,12 @@ static SyscallTableEntry syscall_table[] = { LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425 LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426 LINXY(__NR_io_uring_register, sys_io_uring_register), // 427 - + LINXY(__NR_open_tree, sys_open_tree), // 428 + LINX_(__NR_move_mount, sys_move_mount), // 429 + LINXY(__NR_fsopen, sys_fsopen), // 430 + LINX_(__NR_fsconfig, sys_fsconfig), // 431 + LINXY(__NR_fsmount, sys_fsmount), // 432 + LINXY(__NR_fspick, sys_fspick), // 433 LINXY(__NR_pidfd_open, sys_pidfd_open), // 434 GENX_(__NR_clone3, sys_ni_syscall), // 435 LINXY(__NR_close_range, sys_close_range), // 436 diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c index 2c2def330a..2a3ed8b924 100644 --- a/coregrind/m_syswrap/syswrap-ppc64-linux.c +++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c @@ -1025,7 +1025,12 @@ static SyscallTableEntry syscall_table[] = { LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425 LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426 LINXY(__NR_io_uring_register, sys_io_uring_register), // 427 - + LINXY(__NR_open_tree, sys_open_tree), // 428 + LINX_(__NR_move_mount, sys_move_mount), // 429 + LINXY(__NR_fsopen, sys_fsopen), // 430 + LINX_(__NR_fsconfig, sys_fsconfig), // 431 + LINXY(__NR_fsmount, sys_fsmount), // 432 + LINXY(__NR_fspick, sys_fspick), // 433 LINXY(__NR_pidfd_open, sys_pidfd_open), // 434 GENX_(__NR_clone3, sys_ni_syscall), // 435 LINXY(__NR_close_range, sys_close_range), // 436 diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c index ca571f0f1a..893306bbda 100644 --- a/coregrind/m_syswrap/syswrap-s390x-linux.c +++ b/coregrind/m_syswrap/syswrap-s390x-linux.c @@ -865,7 +865,12 @@ static SyscallTableEntry syscall_table[] = { LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425 LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426 LINXY(__NR_io_uring_register, sys_io_uring_register), // 427 - + LINXY(__NR_open_tree, sys_open_tree), // 428 + LINX_(__NR_move_mount, sys_move_mount), // 429 + LINXY(__NR_fsopen, sys_fsopen), // 430 + LINX_(__NR_fsconfig, sys_fsconfig), // 431 + LINXY(__NR_fsmount, sys_fsmount), // 432 + LINXY(__NR_fspick, sys_fspick), // 433 LINXY(__NR_pidfd_open, sys_pidfd_open), // 434 GENX_(__NR_clone3, sys_ni_syscall), // 435 LINXY(__NR_close_range, sys_close_range), // 436 diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c index a23743743a..50384817db 100644 --- a/coregrind/m_syswrap/syswrap-x86-linux.c +++ b/coregrind/m_syswrap/syswrap-x86-linux.c @@ -1646,7 +1646,12 @@ static SyscallTableEntry syscall_table[] = { LINXY(__NR_io_uring_setup, sys_io_uring_setup), // 425 LINXY(__NR_io_uring_enter, sys_io_uring_enter), // 426 LINXY(__NR_io_uring_register, sys_io_uring_register),// 427 - + LINXY(__NR_open_tree, sys_open_tree), // 428 + LINX_(__NR_move_mount, sys_move_mount), // 429 + LINXY(__NR_fsopen, sys_fsopen), // 430 + LINX_(__NR_fsconfig, sys_fsconfig), // 431 + LINXY(__NR_fsmount, sys_fsmount), // 432 + LINXY(__NR_fspick, sys_fspick), // 433 LINXY(__NR_pidfd_open, sys_pidfd_open), // 434 GENX_(__NR_clone3, sys_ni_syscall), // 435 LINXY(__NR_close_range, sys_close_range), // 436 |
From: Paul F. <pa...@so...> - 2024-11-26 07:09:28
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=910519674ad97c98a9140ece3119e321774233d0 commit 910519674ad97c98a9140ece3119e321774233d0 Author: Paul Floyd <pj...@wa...> Date: Tue Nov 26 08:08:37 2024 +0100 Manual: C23 is now officially released Diff: --- docs/xml/manual-core.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/xml/manual-core.xml b/docs/xml/manual-core.xml index 8ee5ba0168..da7e811768 100644 --- a/docs/xml/manual-core.xml +++ b/docs/xml/manual-core.xml @@ -1793,9 +1793,9 @@ that can report errors, e.g. Memcheck, but not Cachegrind.</para> <option><![CDATA[--realloc-zero-bytes-frees=yes|no [default: yes for glibc no otherwise] ]]></option> </term> <listitem> - <para>The behaviour of <computeroutput>realloc()</computeroutput> is - implementation defined (in C17, in C23 it is likely to become - undefined). Valgrind tries to work in the same way as the + <para>The behaviour of <computeroutput>realloc()</computeroutput> with a size + of zero is implementation defined in C17 and undefined in C23. + Valgrind tries to work in the same way as the underlying system and C runtime library that it was configured and built on. However, if you use a different C runtime library then this default may be wrong. If the value is <option>yes</option> then <varname>realloc</varname> will |
From: Paul F. <pa...@so...> - 2024-11-25 20:28:48
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=c812e7fb5727ce09cad17ab0a6cb5e0464f2a24e commit c812e7fb5727ce09cad17ab0a6cb5e0464f2a24e Author: Paul Floyd <pj...@wa...> Date: Mon Nov 25 21:27:56 2024 +0100 Remove standard headers from zstddeclib.c Not needed and safer without them. Diff: --- coregrind/m_debuginfo/zstddeclib.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/coregrind/m_debuginfo/zstddeclib.c b/coregrind/m_debuginfo/zstddeclib.c index 5b1f3c2fbd..405125c6c2 100644 --- a/coregrind/m_debuginfo/zstddeclib.c +++ b/coregrind/m_debuginfo/zstddeclib.c @@ -112,10 +112,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "pub_core_mallocfree.h" #include "pub_core_libcbase.h" -#include <limits.h> -#include <stddef.h> -#include <string.h> - # define ZSTD_memcpy(d,s,l) VG_(memcpy)((d),(s),(l)) # define ZSTD_memmove(d,s,l) VG_(memmove)((d),(s),(l)) # define ZSTD_memset(p,v,l) VG_(memset)((p),(v),(l)) |
From: Paul F. <pj...@wa...> - 2024-11-25 18:43:52
|
On 22/11/2024 19:24, Bart Van Assche wrote: > On 11/21/24 11:01 PM, Paul Floyd via Valgrind-developers wrote: >> Anyone else have an opinion on this? > > I prefer disabling the unused-result warning rather than adding #pragma > directives. #pragma directives clutter the code. There are other tools > that can catch unused result value issues, e.g. Coverity. > I've added the flag and removed the pragmas. A+ Paul |
From: Mark W. <ma...@kl...> - 2024-11-25 17:50:54
|
Hi Florian, On Mon, 2024-11-25 at 11:32 +0100, Florian Krohm wrote: > On 07.11.24 11:37, Florian Krohm wrote: > > is there a way to access the svn repository before it was converted to git ? > > I'd be interested in a few branches I was working on at the time but did not > > finish the work. Those branches did not make it into git. Mythic Beasts used to run svn.valgrind.org for us but it seems to got shut down after the git conversion. https://bugs.kde.org/show_bug.cgi?id=387825 Unfortunately I don't know of any backups. Sorry, Mark |
From: Carl L. <ce...@li...> - 2024-11-25 15:58:25
|
Mark: Thanks for working on this and getting it fixed. Carl On 11/23/24 12:31 PM, Mark Wielaard wrote: > Hi Carl, Hi Paul, > > On Tue, Oct 29, 2024 at 08:07:52AM -0700, Carl Love via Valgrind-developers wrote: >> On 10/29/24 12:38 AM, Paul Floyd via Valgrind-developers wrote: >>> On 28-10-24 19:52, Carl Love via Valgrind-developers wrote: >>>> PowerPC testing on Power 8, I am seeing 4 additional stderr >>>> failures versus Valgrind 3.23.0.RC2 >>>> none/tests/fdleak_cmsg_supp (stderr) New for >>>> Valgrind-3.24.0.RC1 >>>> none/tests/fdleak_cmsg_xml (stderr) New for >>>> Valgrind-3.24.0.RC1 >>>> none/tests/fdleak_ipv4_xml (stderr) New for >>>> Valgrind-3.24.0.RC1 >>>> none/tests/socket_close_xml (stderr) New >>>> for Valgrind-3.24.0.RC1 >>> It's probably not too serious. The fdleak feature tends to output >>> messages that are highly system dependent and need plenty of >>> filtering in order to have stable regtest results. >> Thanks for the feedback. The tests were run on various lab machines >> at IBM. I will note that the nightly regression runs on the GCC >> pool machines gcc110 and gcc112 do not have the same failures. > I could finally replicate these issues on a Power9, Fedora 40 setup. > The issue is that in some cases the "main" frame is missing. I haven't > been able to figure out why though. We did see this before with some > other (fdleak) tests. Which were worked around in commit 04d30049bf9b > "Filter away "main" differences in filter_fdleak" > > So for now I have added a few more new exp files (and two new supps). > > commit e6960c2e41b103ab8d393cbe13dc6473fb89bffc > Author: Mark Wielaard <ma...@kl...> > Date: Sat Nov 23 21:28:13 2024 +0100 > > Add exp and supp patterns for missing main frame for ppc64le > > In some cases on ppc64le we are missing the main frame. > Add alternative .exp-ppc64le variants for socket_close_xml, > fdleak_cmsg_xml and fdleak_ipv4_xml. And extra suppressions > without a main frame for fdleak_cmsg_supp. > > See also commit 04d30049b "Filter away "main" differences in filter_fdleak" > > With that commit I get a clean make regtest: > > == 768 tests, 0 stderr failures, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures == > > But I also filed: > https://bugs.kde.org/show_bug.cgi?id=496620 > Main frame missing in various (fdleak) tests (ppc64le) > > Cheers, > > Mark > > > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers |
From: Florian K. <fl...@ei...> - 2024-11-25 10:46:07
|
ping. On 07.11.24 11:37, Florian Krohm wrote: > Greetings, > > is there a way to access the svn repository before it was converted to git ? > I'd be interested in a few branches I was working on at the time but did not > finish the work. Those branches did not make it into git. > > Thanks > Florian |
From: Paul F. <pj...@wa...> - 2024-11-25 06:34:34
|
On 24-11-24 18:28, Paul Floyd via Valgrind-developers wrote: > We could have the subset of non __ prefixed ones always defined for all > platforms. I hadn't thought through the question of declarations. In the case of compilers optimizing a struct assignment to memcpy there's no need for the compiler to see the prototype since it is implicit. In the case of third party code we do need to see a prototype. Also whilst almost all libc functions have drop-in VG_() replacements 'malloc' doesn't because VG_(malloc) takes an extra string tag for the first argument. I need to think about this a bit more. A+ Paul |
From: Mark W. <ma...@so...> - 2024-11-25 01:50:33
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=b1453546fe7396e7d4b4b2fc8ec7e64b71d18611 commit b1453546fe7396e7d4b4b2fc8ec7e64b71d18611 Author: Peter Seiderer <ps....@gm...> Date: Mon Jul 8 11:05:47 2024 +0200 Add support for landlock_create_ruleset (444), landlock_add_rule (445) and landlock_restrict_self (446) syscalls - add support for landlock_create_ruleset (444) syscall - add support for landlock_add_rule (445) syscall - add support for landlock_restrict_self (446) syscall https://bugs.kde.org/show_bug.cgi?id=489913 Signed-off-by: Peter Seiderer <ps....@gm...> Diff: --- NEWS | 1 + coregrind/m_syswrap/priv_syswrap-linux.h | 5 +++ coregrind/m_syswrap/syswrap-amd64-linux.c | 4 +++ coregrind/m_syswrap/syswrap-arm-linux.c | 4 +++ coregrind/m_syswrap/syswrap-arm64-linux.c | 4 +++ coregrind/m_syswrap/syswrap-linux.c | 48 ++++++++++++++++++++++++++++ coregrind/m_syswrap/syswrap-mips32-linux.c | 4 +++ coregrind/m_syswrap/syswrap-mips64-linux.c | 5 ++- coregrind/m_syswrap/syswrap-nanomips-linux.c | 3 ++ coregrind/m_syswrap/syswrap-ppc32-linux.c | 4 +++ coregrind/m_syswrap/syswrap-ppc64-linux.c | 4 +++ coregrind/m_syswrap/syswrap-s390x-linux.c | 4 +++ coregrind/m_syswrap/syswrap-x86-linux.c | 4 +++ include/Makefile.am | 3 +- include/pub_tool_vki.h | 1 + include/vki/vki-linux-landlock.h | 37 +++++++++++++++++++++ include/vki/vki-scnums-shared-linux.h | 4 +++ 17 files changed, 137 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index ad5fa1a417..e5a7345e17 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,7 @@ bugzilla (https://bugs.kde.org/enter_bug.cgi?product=valgrind) rather than mailing the developers (or mailing lists) directly -- bugs that are not entered into bugzilla tend to get forgotten about or ignored. +489913 WARNING: unhandled amd64-linux syscall: 444 (landlock_create_ruleset) 494327 Crash when running Helgrind built with #define TRACE_PTH_FNS 1 494337 All threaded applications cause still holding lock errors 495488 Add FreeBSD getrlimitusage syscall wrapper diff --git a/coregrind/m_syswrap/priv_syswrap-linux.h b/coregrind/m_syswrap/priv_syswrap-linux.h index d50cdcc981..221439a0ec 100644 --- a/coregrind/m_syswrap/priv_syswrap-linux.h +++ b/coregrind/m_syswrap/priv_syswrap-linux.h @@ -328,6 +328,11 @@ DECL_TEMPLATE(linux, sys_pidfd_open); DECL_TEMPLATE(linux, sys_close_range); DECL_TEMPLATE(linux, sys_openat2); +// Linux-specific (new in Linux 5.13) +DECL_TEMPLATE(linux, sys_landlock_create_ruleset) +DECL_TEMPLATE(linux, sys_landlock_add_rule) +DECL_TEMPLATE(linux, sys_landlock_restrict_self) + // Linux-specific (new in Linux 5.14) DECL_TEMPLATE(linux, sys_memfd_secret); diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c index 2230baf772..9488d3090e 100644 --- a/coregrind/m_syswrap/syswrap-amd64-linux.c +++ b/coregrind/m_syswrap/syswrap-amd64-linux.c @@ -887,6 +887,10 @@ static SyscallTableEntry syscall_table[] = { LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 + LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444 + LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445 + LINX_(__NR_landlock_restrict_self, sys_landlock_restrict_self), // 446 + LINXY(__NR_memfd_secret, sys_memfd_secret), // 447 LINX_(__NR_fchmodat2, sys_fchmodat2), // 452 diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c index c8c23a9282..5dac60f821 100644 --- a/coregrind/m_syswrap/syswrap-arm-linux.c +++ b/coregrind/m_syswrap/syswrap-arm-linux.c @@ -1063,6 +1063,10 @@ static SyscallTableEntry syscall_main_table[] = { LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 + LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444 + LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445 + LINX_(__NR_landlock_restrict_self, sys_landlock_restrict_self), // 446 + LINX_(__NR_fchmodat2, sys_fchmodat2), // 452 }; diff --git a/coregrind/m_syswrap/syswrap-arm64-linux.c b/coregrind/m_syswrap/syswrap-arm64-linux.c index 05e0e421fa..151ae0640b 100644 --- a/coregrind/m_syswrap/syswrap-arm64-linux.c +++ b/coregrind/m_syswrap/syswrap-arm64-linux.c @@ -840,6 +840,10 @@ static SyscallTableEntry syscall_main_table[] = { LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 + LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444 + LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445 + LINX_(__NR_landlock_restrict_self, sys_landlock_restrict_self), // 446 + LINXY(__NR_memfd_secret, sys_memfd_secret), // 447 LINX_(__NR_fchmodat2, sys_fchmodat2), // 452 diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index 775fae75b2..5af84d7399 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -4163,6 +4163,54 @@ POST(sys_memfd_create) } } +PRE(sys_landlock_create_ruleset) +{ + PRINT("sys_landlock_create_ruleset ( %#" FMT_REGWORD "x, %lu, %lu )", + ARG1, ARG2, ARG3); + PRE_REG_READ3(long, "landlock_create_ruleset", + const struct vki_landlock_ruleset_attr*, attr, + vki_size_t, size, vki_uint32_t, flags); + PRE_MEM_READ( "landlock_create_ruleset(value)", ARG1, ARG2 ); + + /* XXX Alternatively we could always fail with EOPNOTSUPP + since the rules might interfere with valgrind itself. */ +} + +POST(sys_landlock_create_ruleset) +{ + /* Returns either the abi version or a file descriptor. */ + if (ARG3 != VKI_LANDLOCK_CREATE_RULESET_VERSION) { + if (!ML_(fd_allowed)(RES, "landlock_create_ruleset", tid, True)) { + VG_(close)(RES); + SET_STATUS_Failure( VKI_EMFILE ); + } else { + if (VG_(clo_track_fds)) + ML_(record_fd_open_nameless)(tid, RES); + } + } +} + +PRE(sys_landlock_add_rule) +{ + PRINT("sys_landlock_add_rule ( %ld, %lu, %#" FMT_REGWORD "x, %lu )", + SARG1, ARG2, ARG3, ARG4); + PRE_REG_READ4(long, "landlock_add_rule", + int, ruleset_fd, enum vki_landlock_rule_type, rule_type, + const void*, rule_attr, vki_uint32_t, flags); + if (!ML_(fd_allowed)(ARG1, "landlock_add_rule", tid, False)) + SET_STATUS_Failure(VKI_EBADF); + /* XXX Depending on rule_type we should also check the given rule_attr. */ +} + +PRE(sys_landlock_restrict_self) +{ + PRINT("sys_landlock_restrict_self ( %ld, %lu )", SARG1, ARG2); + PRE_REG_READ2(long, "landlock_create_ruleset", + int, ruleset_fd, vki_uint32_t, flags); + if (!ML_(fd_allowed)(ARG1, "landlock_restrict_self", tid, False)) + SET_STATUS_Failure(VKI_EBADF); +} + PRE(sys_memfd_secret) { PRINT("sys_memfd_secret ( %#" FMT_REGWORD "x )", ARG1); diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c index 4213442136..757b637ba9 100644 --- a/coregrind/m_syswrap/syswrap-mips32-linux.c +++ b/coregrind/m_syswrap/syswrap-mips32-linux.c @@ -1147,6 +1147,10 @@ static SyscallTableEntry syscall_main_table[] = { LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 + LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444 + LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445 + LINX_(__NR_landlock_restrict_self, sys_landlock_restrict_self), // 446 + LINX_(__NR_fchmodat2, sys_fchmodat2), // 452 }; diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c index e9bb5c54c5..f0c5f7e04f 100644 --- a/coregrind/m_syswrap/syswrap-mips64-linux.c +++ b/coregrind/m_syswrap/syswrap-mips64-linux.c @@ -824,7 +824,10 @@ static SyscallTableEntry syscall_main_table[] = { LINXY (__NR_openat2, sys_openat2), LINXY (__NR_pidfd_getfd, sys_pidfd_getfd), LINX_ (__NR_faccessat2, sys_faccessat2), - LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), + LINXY (__NR_epoll_pwait2, sys_epoll_pwait2), + LINXY (__NR_landlock_create_ruleset, sys_landlock_create_ruleset), + LINX_ (__NR_landlock_add_rule, sys_landlock_add_rule), + LINX_ (__NR_landlock_restrict_self, sys_landlock_restrict_self), LINX_ (__NR_fchmodat2, sys_fchmodat2), }; diff --git a/coregrind/m_syswrap/syswrap-nanomips-linux.c b/coregrind/m_syswrap/syswrap-nanomips-linux.c index 36a5c0ca00..f466aca147 100644 --- a/coregrind/m_syswrap/syswrap-nanomips-linux.c +++ b/coregrind/m_syswrap/syswrap-nanomips-linux.c @@ -831,6 +831,9 @@ static SyscallTableEntry syscall_main_table[] = { LINXY(__NR_pidfd_getfd, sys_pidfd_getfd), LINX_ (__NR_faccessat2, sys_faccessat2), LINXY (__NR_epoll_pwait2, sys_epoll_pwait2), + LINXY (__NR_landlock_create_ruleset,sys_landlock_create_ruleset), + LINX_ (__NR_landlock_add_rule, sys_landlock_add_rule), + LINX_ (__NR_landlock_restrict_self, sys_landlock_restrict_self), LINX_ (__NR_fchmodat2, sys_fchmodat2), }; diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c index f7a90c7530..634f288ce0 100644 --- a/coregrind/m_syswrap/syswrap-ppc32-linux.c +++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c @@ -1069,6 +1069,10 @@ static SyscallTableEntry syscall_table[] = { LINXY (__NR_epoll_pwait2, sys_epoll_pwait2), // 441 + LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444 + LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445 + LINX_(__NR_landlock_restrict_self, sys_landlock_restrict_self), // 446 + LINX_ (__NR_fchmodat2, sys_fchmodat2), // 452 }; diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c index 8de95624fa..2c2def330a 100644 --- a/coregrind/m_syswrap/syswrap-ppc64-linux.c +++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c @@ -1035,6 +1035,10 @@ static SyscallTableEntry syscall_table[] = { LINXY (__NR_epoll_pwait2, sys_epoll_pwait2), // 441 + LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444 + LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445 + LINX_(__NR_landlock_restrict_self, sys_landlock_restrict_self), // 446 + LINX_ (__NR_fchmodat2, sys_fchmodat2), // 452 }; diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c index 8a1be8cbef..ca571f0f1a 100644 --- a/coregrind/m_syswrap/syswrap-s390x-linux.c +++ b/coregrind/m_syswrap/syswrap-s390x-linux.c @@ -875,6 +875,10 @@ static SyscallTableEntry syscall_table[] = { LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 + LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444 + LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445 + LINX_(__NR_landlock_restrict_self, sys_landlock_restrict_self), // 446 + LINXY(__NR_memfd_secret, sys_memfd_secret), // 447 LINX_ (__NR_fchmodat2, sys_fchmodat2), // 452 diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c index 31243a0db3..a23743743a 100644 --- a/coregrind/m_syswrap/syswrap-x86-linux.c +++ b/coregrind/m_syswrap/syswrap-x86-linux.c @@ -1656,6 +1656,10 @@ static SyscallTableEntry syscall_table[] = { LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 + LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444 + LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445 + LINX_(__NR_landlock_restrict_self, sys_landlock_restrict_self), // 446 + LINXY(__NR_memfd_secret, sys_memfd_secret), // 447 LINX_(__NR_fchmodat2, sys_fchmodat2), // 452 diff --git a/include/Makefile.am b/include/Makefile.am index 8012d73749..5d5162a46e 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -107,4 +107,5 @@ nobase_pkginclude_HEADERS = \ vki/vki-xen-xsm.h \ vki/vki-xen-x86.h \ vki/vki-linux-drm.h \ - vki/vki-linux-io_uring.h + vki/vki-linux-io_uring.h \ + vki/vki-linux-landlock.h diff --git a/include/pub_tool_vki.h b/include/pub_tool_vki.h index 24f99cc09f..7b6e71e11e 100644 --- a/include/pub_tool_vki.h +++ b/include/pub_tool_vki.h @@ -47,6 +47,7 @@ # include "vki/vki-linux.h" # include "vki/vki-linux-drm.h" # include "vki/vki-linux-io_uring.h" +# include "vki/vki-linux-landlock.h" #elif defined(VGO_darwin) # include "vki/vki-darwin.h" #elif defined(VGO_solaris) diff --git a/include/vki/vki-linux-landlock.h b/include/vki/vki-linux-landlock.h new file mode 100644 index 0000000000..e549ae93ef --- /dev/null +++ b/include/vki/vki-linux-landlock.h @@ -0,0 +1,37 @@ +/* + This file is part of Valgrind, a dynamic binary instrumentation framework. + + Copyright (C) 2024 Peter Seiderer <ps....@gm...> + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see <http://www.gnu.org/licenses/>. + + The GNU General Public License is contained in the file COPYING. +*/ +#ifndef __VKI_LANDLOCK_H +#define __VKI_LANDLOCK_H + +// Derived from linux-6.9.7/include/uapi/linux/landlock.h +struct vki_landlock_ruleset_attr { + __vki_u64 handled_access_fs; + __vki_u64 handled_access_net; +}; + +enum vki_landlock_rule_type { + VKI_LANDLOCK_RULE_PATH_BENEATH = 1, + VKI_LANDLOCK_RULE_NET_PORT, +}; + +#define VKI_LANDLOCK_CREATE_RULESET_VERSION 1 + +#endif diff --git a/include/vki/vki-scnums-shared-linux.h b/include/vki/vki-scnums-shared-linux.h index 068a2cd12b..20346ca716 100644 --- a/include/vki/vki-scnums-shared-linux.h +++ b/include/vki/vki-scnums-shared-linux.h @@ -48,6 +48,10 @@ #define __NR_epoll_pwait2 441 +#define __NR_landlock_create_ruleset 444 +#define __NR_landlock_add_rule 445 +#define __NR_landlock_restrict_self 446 + #define __NR_memfd_secret 447 #define __NR_fchmodat2 452 |
From: Paul F. <pj...@wa...> - 2024-11-24 17:28:25
|
On 24-11-24 12:39, Mark Wielaard wrote: > Hi Paul, > Longer term I am wondering if we shouldn't just define these standard > str/mem library calls directly outselves by simply calling the > VG_(...) variant. We are building -freestanding. So can simply define > these function symbols ourselves. Then all code can just use the > standard library names for these str/mem functions. And the compiler > is free to optimize them when possible. Hi Mark We do already for several of them due to these kinds of optimizations. These are in m_main.c Solaris has memcpy FreeBSD has memcpy memmove and memset Darwin has __memcpy_chk __memset_chk __bzero bzero memcpy and memset Linux has memcpy memmove memset abort raise and a load of __aeabi stuff on arm. We could have the subset of non __ prefixed ones always defined for all platforms. A+ Paul |
From: Mark W. <ma...@so...> - 2024-11-24 12:41:15
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=579b8a18e025b0398695763953563af0e8384f16 commit 579b8a18e025b0398695763953563af0e8384f16 Author: Mark Wielaard <ma...@kl...> Date: Sun Nov 24 13:28:14 2024 +0100 coregrind/m_gdbserver/server.h: define memcpy and memset to VG_ variants Then use memset/memcpy in the coregrind/m_gdbserver code instead of the VG_ variants. Diff: --- coregrind/m_gdbserver/inferiors.c | 2 +- coregrind/m_gdbserver/remote-utils.c | 2 +- coregrind/m_gdbserver/server.c | 2 +- coregrind/m_gdbserver/server.h | 3 +++ 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/coregrind/m_gdbserver/inferiors.c b/coregrind/m_gdbserver/inferiors.c index 82d8e4af6d..fbf7d2359c 100644 --- a/coregrind/m_gdbserver/inferiors.c +++ b/coregrind/m_gdbserver/inferiors.c @@ -100,7 +100,7 @@ void add_thread (unsigned long thread_id, void *target_data, unsigned int gdb_id struct thread_info *new_thread = (struct thread_info *) malloc (sizeof (*new_thread)); - VG_(memset) (new_thread, 0, sizeof (*new_thread)); + memset (new_thread, 0, sizeof (*new_thread)); new_thread->entry.id = thread_id; diff --git a/coregrind/m_gdbserver/remote-utils.c b/coregrind/m_gdbserver/remote-utils.c index 8dfc768d49..2daf543831 100644 --- a/coregrind/m_gdbserver/remote-utils.c +++ b/coregrind/m_gdbserver/remote-utils.c @@ -1137,7 +1137,7 @@ void prepare_resume_reply (char *buf, char status, unsigned char sig) CORE_ADDR addr; int i; - VG_(memcpy) (buf, "watch:", 6); + memcpy (buf, "watch:", 6); buf += 6; addr = valgrind_stopped_data_address (); diff --git a/coregrind/m_gdbserver/server.c b/coregrind/m_gdbserver/server.c index 8ca4de20f6..19a360c7a7 100644 --- a/coregrind/m_gdbserver/server.c +++ b/coregrind/m_gdbserver/server.c @@ -1066,7 +1066,7 @@ void handle_query (char *arg_own_buf, int *new_packet_len_p) n = -1; else { n = strlen(name) - ofs; - VG_(memcpy) (data, name, n); + memcpy (data, name, n); } if (n < 0) diff --git a/coregrind/m_gdbserver/server.h b/coregrind/m_gdbserver/server.h index 06d15fa8c0..d6dc8d692a 100644 --- a/coregrind/m_gdbserver/server.h +++ b/coregrind/m_gdbserver/server.h @@ -162,6 +162,9 @@ extern Int *syscalls_to_catch; VG_(strtoull16) ((s),(r)) \ : VG_(strtoull10) ((s),(r))) +#define memcpy(_dd,_ss,_sz) VG_(memcpy)((_dd),(_ss),(_sz)) +#define memset(_ss,_cc,_sz) VG_(memset)((_ss),(_cc),(_sz)) + #define malloc(sz) VG_(malloc) ("gdbsrv", sz) #define calloc(n,sz) VG_(calloc) ("gdbsrv", n, sz) #define realloc(p,size) VG_(realloc) ("gdbsrv", p, size) |
From: Mark W. <ma...@kl...> - 2024-11-24 11:40:07
|
Hi Paul, On Sun, Nov 24, 2024 at 07:37:29AM +0000, Paul Floyd wrote: > https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=6fda9e5dbe01cfbf596f3809d321323405b9a57f > > commit 6fda9e5dbe01cfbf596f3809d321323405b9a57f > Author: Paul Floyd <pj...@wa...> > Date: Sun Nov 24 08:36:32 2024 +0100 > > Solaris and Illumos: fix build due to use of memset in zstd code. By using VG_(memset). This works on most other setups since the compiler will see the second argument (zero) and last argument (length given by sizeof) are constant and so the call is transformed into a __builtin_memset and completely inlined. But theoretically (and on Solaris/Illumos) this could result in library call. I had the same issue recently and solved it similarly: commit d7db69fbf482149e18ed1977df41fe320f5cbef2 Author: Mark Wielaard <ma...@kl...> Date: Thu Nov 14 12:25:27 2024 +0100 coregrind/m_gdbserver/remote-utils.c (prepare_resume_reply): Use memcpy Where I also used VG_(memset). But I now think that might not have been the best fix. Both that gdbserver code, and this zstd code come from somewhere else, which does use the standard library calls. So resyncing that source code with newer upstream versions becomes a little harder. The solution for some other imported code (the demangler) is in coregrind/m_demangle/vg_libciface.h which contains a #define memset(_ss,_cc,_sz) VG_(memset)((_ss),(_cc),(_sz)) Which seems a nicer way to keep the code as similar as our upstreams as possible. I'll make a similar change for the m_gdbserver code. And it seems a good idea for this zstd code too. Longer term I am wondering if we shouldn't just define these standard str/mem library calls directly outselves by simply calling the VG_(...) variant. We are building -freestanding. So can simply define these function symbols ourselves. Then all code can just use the standard library names for these str/mem functions. And the compiler is free to optimize them when possible. Cheers, Mark |
From: Mark W. <ma...@kl...> - 2024-11-24 11:13:49
|
Hi Paul, On Sun, Nov 24, 2024 at 07:12:19AM +0000, Paul Floyd wrote: > https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=7241959ebb88a588eebe5a9fd35d1642db71474b > > commit 7241959ebb88a588eebe5a9fd35d1642db71474b > Author: Paul Floyd <pj...@wa...> > Date: Sun Nov 24 08:10:51 2024 +0100 > > Add additional exp-ppc64le files to EXTRA_DIST Sorry. I had seen this, made the similar change, then forgot to add it to the commit... doh. Thanks, Mark |
From: Paul F. <pa...@so...> - 2024-11-24 07:37:40
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=6fda9e5dbe01cfbf596f3809d321323405b9a57f commit 6fda9e5dbe01cfbf596f3809d321323405b9a57f Author: Paul Floyd <pj...@wa...> Date: Sun Nov 24 08:36:32 2024 +0100 Solaris and Illumos: fix build due to use of memset in zstd code. Diff: --- coregrind/m_debuginfo/zstddeclib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/coregrind/m_debuginfo/zstddeclib.c b/coregrind/m_debuginfo/zstddeclib.c index 086f1e4406..5b1f3c2fbd 100644 --- a/coregrind/m_debuginfo/zstddeclib.c +++ b/coregrind/m_debuginfo/zstddeclib.c @@ -10417,7 +10417,7 @@ XXH_PUBLIC_API void XXH32_copyState(XXH32_state_t* dstState, const XXH32_state_t XXH_PUBLIC_API XXH_errorcode XXH32_reset(XXH32_state_t* statePtr, XXH32_hash_t seed) { XXH_ASSERT(statePtr != NULL); - memset(statePtr, 0, sizeof(*statePtr)); + VG_(memset)(statePtr, 0, sizeof(*statePtr)); statePtr->v[0] = seed + XXH_PRIME32_1 + XXH_PRIME32_2; statePtr->v[1] = seed + XXH_PRIME32_2; statePtr->v[2] = seed + 0; @@ -10863,7 +10863,7 @@ XXH_PUBLIC_API void XXH64_copyState(XXH_NOESCAPE XXH64_state_t* dstState, const XXH_PUBLIC_API XXH_errorcode XXH64_reset(XXH_NOESCAPE XXH64_state_t* statePtr, XXH64_hash_t seed) { XXH_ASSERT(statePtr != NULL); - memset(statePtr, 0, sizeof(*statePtr)); + VG_(memset)(statePtr, 0, sizeof(*statePtr)); statePtr->v[0] = seed + XXH_PRIME64_1 + XXH_PRIME64_2; statePtr->v[1] = seed + XXH_PRIME64_2; statePtr->v[2] = seed + 0; @@ -13456,7 +13456,7 @@ XXH3_reset_internal(XXH3_state_t* statePtr, XXH_ASSERT(offsetof(XXH3_state_t, nbStripesPerBlock) > initStart); XXH_ASSERT(statePtr != NULL); /* set members from bufferedSize to nbStripesPerBlock (excluded) to 0 */ - memset((char*)statePtr + initStart, 0, initLength); + VG_(memset)((char*)statePtr + initStart, 0, initLength); statePtr->acc[0] = XXH_PRIME32_3; statePtr->acc[1] = XXH_PRIME64_1; statePtr->acc[2] = XXH_PRIME64_2; |
From: Paul F. <pa...@so...> - 2024-11-24 07:12:30
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=7241959ebb88a588eebe5a9fd35d1642db71474b commit 7241959ebb88a588eebe5a9fd35d1642db71474b Author: Paul Floyd <pj...@wa...> Date: Sun Nov 24 08:10:51 2024 +0100 Add additional exp-ppc64le files to EXTRA_DIST Diff: --- none/tests/Makefile.am | 3 +++ 1 file changed, 3 insertions(+) diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 59be79e579..53a6e1f6bc 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -135,6 +135,7 @@ EXTRA_DIST = \ faultstatus.vgtest faultstatus.stderr.exp faultstatus.stderr.exp-s390x \ fcntl_setown.vgtest fcntl_setown.stdout.exp fcntl_setown.stderr.exp \ fdleak_cmsg.stderr.exp fdleak_cmsg.vgtest \ + fdleak_cmsg_xml.stderr.exp-ppc64le \ fdleak_cmsg_xml.stderr.exp fdleak_cmsg_xml.vgtest \ fdleak_cmsg_supp.stderr.exp fdleak_cmsg_supp.supp \ fdleak_cmsg_supp.vgtest \ @@ -149,6 +150,7 @@ EXTRA_DIST = \ fdleak_fcntl.stderr.exp fdleak_fcntl.vgtest \ fdleak_fcntl_xml.stderr.exp fdleak_fcntl_xml.vgtest \ fdleak_ipv4.stderr.exp fdleak_ipv4.stdout.exp fdleak_ipv4.vgtest \ + fdleak_ipv4_xml.stderr.exp-ppc64le \ fdleak_ipv4_xml.stderr.exp fdleak_ipv4_xml.stdout.exp \ fdleak_ipv4_xml.vgtest fdleak_ipv4_xml.stderr.exp-nomain \ fdleak_open.stderr.exp fdleak_open.vgtest \ @@ -248,6 +250,7 @@ EXTRA_DIST = \ process_vm_readv_writev.stderr.exp process_vm_readv_writev.vgtest \ sigprocmask.stderr.exp sigprocmask.vgtest \ socket_close.stderr.exp socket_close.vgtest \ + socket_close_xml.stderr.exp-ppc64le \ socket_close_xml.stderr.exp socket_close_xml.vgtest \ file_dclose.stderr.exp file_dclose.vgtest \ file_dclose_xml.stderr.exp file_dclose_xml.vgtest \ |
From: Mark W. <ma...@so...> - 2024-11-23 22:16:41
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=8f6cef269b91739f6a2e7f3b4b1e0a429db3e748 commit 8f6cef269b91739f6a2e7f3b4b1e0a429db3e748 Author: Mark Wielaard <ma...@kl...> Date: Sat Nov 23 22:59:21 2024 +0100 none/tests/bug234814.c: sa_handler take an int as argument GCC15 will turn this warning into an error: bug234814.c: In function 'main': bug234814.c:20:18: error: assignment to '__sighandler_t' {aka 'void (*)(int)'} from incompatible pointer type 'void (*)(void)' [-Wincompatible-pointer-types] 20 | sa.sa_handler = mysigbus; | ^ Diff: --- none/tests/bug234814.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/none/tests/bug234814.c b/none/tests/bug234814.c index 16b561fde6..11e0f67791 100644 --- a/none/tests/bug234814.c +++ b/none/tests/bug234814.c @@ -9,7 +9,7 @@ const char kSigbus[] = "I caught the SIGBUS signal!\n"; int GLOB = 3; -void mysigbus() { +void mysigbus(int signum) { write(1, kSigbus, sizeof(kSigbus)-1); GLOB--; return; |
From: Mark W. <ma...@so...> - 2024-11-23 22:16:41
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=907b985725805f1537396a6d76539bf490cc6c7e commit 907b985725805f1537396a6d76539bf490cc6c7e Author: Mark Wielaard <ma...@kl...> Date: Sat Nov 23 22:48:03 2024 +0100 drd/tests/swapcontext.c: Rename typedef struct thread_local to threadlocal Since C23 thread_local is a keyword (thread storage duration). swapcontext.c:23:16: error: expected '{' before 'thread_local' 23 | typedef struct thread_local { | ^~~~~~~~~~~~ swapcontext.c:23:16: warning: 'thread_local' is not at beginning of declaration [-Wold-style-declaration] swapcontext.c:23:16: error: 'thread_local' used with 'typedef' swapcontext.c:26:3: warning: data definition has no type or storage class 26 | } thread_local_t; | ^~~~~~~~~~~~~~ Diff: --- drd/tests/swapcontext.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drd/tests/swapcontext.c b/drd/tests/swapcontext.c index 2cb969a5ea..ec191968ca 100644 --- a/drd/tests/swapcontext.c +++ b/drd/tests/swapcontext.c @@ -20,7 +20,7 @@ #define STACKSIZE (PTHREAD_STACK_MIN + 4096) -typedef struct thread_local { +typedef struct threadlocal { ucontext_t uc[3]; size_t nrsw; } thread_local_t; |
From: Mark W. <ma...@so...> - 2024-11-23 22:16:40
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=932bf2c027579c8d933b57ed80bb5842b390bdb3 commit 932bf2c027579c8d933b57ed80bb5842b390bdb3 Author: Mark Wielaard <ma...@kl...> Date: Sat Nov 23 22:37:14 2024 +0100 helgrind/tests/tc17_sembar.c: Remove bool typedef Since C23 bool is a keyword. Also bool wasn't actually used. tc17_sembar.c:45:14: error: both 'long' and '_Bool' in declaration specifiers 45 | typedef long bool; | ^~~~ tc17_sembar.c:45:1: warning: useless type name in empty declaration 45 | typedef long bool; | ^~~~~~~ Diff: --- helgrind/tests/tc17_sembar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helgrind/tests/tc17_sembar.c b/helgrind/tests/tc17_sembar.c index 36412a07e2..ee40160b08 100644 --- a/helgrind/tests/tc17_sembar.c +++ b/helgrind/tests/tc17_sembar.c @@ -42,7 +42,7 @@ typedef struct sem_t* xxx; } gomp_barrier_t; -typedef long bool; + void gomp_barrier_init (gomp_barrier_t *bar, unsigned count) |
From: Mark W. <ma...@kl...> - 2024-11-23 20:31:51
|
Hi Carl, Hi Paul, On Tue, Oct 29, 2024 at 08:07:52AM -0700, Carl Love via Valgrind-developers wrote: > On 10/29/24 12:38 AM, Paul Floyd via Valgrind-developers wrote: > >On 28-10-24 19:52, Carl Love via Valgrind-developers wrote: > >>PowerPC testing on Power 8, I am seeing 4 additional stderr > >>failures versus Valgrind 3.23.0.RC2 > > > >>none/tests/fdleak_cmsg_supp (stderr) New for > >>Valgrind-3.24.0.RC1 > >>none/tests/fdleak_cmsg_xml (stderr) New for > >>Valgrind-3.24.0.RC1 > >>none/tests/fdleak_ipv4_xml (stderr) New for > >>Valgrind-3.24.0.RC1 > >>none/tests/socket_close_xml (stderr) New > >>for Valgrind-3.24.0.RC1 > > > >It's probably not too serious. The fdleak feature tends to output > >messages that are highly system dependent and need plenty of > >filtering in order to have stable regtest results. > > Thanks for the feedback. The tests were run on various lab machines > at IBM. I will note that the nightly regression runs on the GCC > pool machines gcc110 and gcc112 do not have the same failures. I could finally replicate these issues on a Power9, Fedora 40 setup. The issue is that in some cases the "main" frame is missing. I haven't been able to figure out why though. We did see this before with some other (fdleak) tests. Which were worked around in commit 04d30049bf9b "Filter away "main" differences in filter_fdleak" So for now I have added a few more new exp files (and two new supps). commit e6960c2e41b103ab8d393cbe13dc6473fb89bffc Author: Mark Wielaard <ma...@kl...> Date: Sat Nov 23 21:28:13 2024 +0100 Add exp and supp patterns for missing main frame for ppc64le In some cases on ppc64le we are missing the main frame. Add alternative .exp-ppc64le variants for socket_close_xml, fdleak_cmsg_xml and fdleak_ipv4_xml. And extra suppressions without a main frame for fdleak_cmsg_supp. See also commit 04d30049b "Filter away "main" differences in filter_fdleak" With that commit I get a clean make regtest: == 768 tests, 0 stderr failures, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures == But I also filed: https://bugs.kde.org/show_bug.cgi?id=496620 Main frame missing in various (fdleak) tests (ppc64le) Cheers, Mark |
From: Mark W. <ma...@so...> - 2024-11-23 20:29:10
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=e6960c2e41b103ab8d393cbe13dc6473fb89bffc commit e6960c2e41b103ab8d393cbe13dc6473fb89bffc Author: Mark Wielaard <ma...@kl...> Date: Sat Nov 23 21:28:13 2024 +0100 Add exp and supp patterns for missing main frame for ppc64le In some cases on ppc64le we are missing the main frame. Add alternative .exp-ppc64le variants for socket_close_xml, fdleak_cmsg_xml and fdleak_ipv4_xml. And extra suppressions without a main frame for fdleak_cmsg_supp. See also commit 04d30049b "Filter away "main" differences in filter_fdleak" Diff: --- none/tests/fdleak_cmsg_supp.supp | 14 +++ none/tests/fdleak_cmsg_xml.stderr.exp-ppc64le | 147 +++++++++++++++++++++++++ none/tests/fdleak_ipv4_xml.stderr.exp-ppc64le | 139 +++++++++++++++++++++++ none/tests/socket_close_xml.stderr.exp-ppc64le | 98 +++++++++++++++++ 4 files changed, 398 insertions(+) diff --git a/none/tests/fdleak_cmsg_supp.supp b/none/tests/fdleak_cmsg_supp.supp index f78d5a2d0a..a169fd888b 100644 --- a/none/tests/fdleak_cmsg_supp.supp +++ b/none/tests/fdleak_cmsg_supp.supp @@ -12,6 +12,13 @@ fun:server fun:main } +{ + sup2-ppc64le + CoreError:FdNotClosed + fun:socket + fun:server + #fun:main +} { sup3 CoreError:FdNotClosed @@ -42,6 +49,13 @@ fun:client fun:main } +{ + sup6-ppc64le + CoreError:FdNotClosed + fun:socket + fun:client + #fun:main +} { sup7 CoreError:FdNotClosed diff --git a/none/tests/fdleak_cmsg_xml.stderr.exp-ppc64le b/none/tests/fdleak_cmsg_xml.stderr.exp-ppc64le new file mode 100644 index 0000000000..6294094eb9 --- /dev/null +++ b/none/tests/fdleak_cmsg_xml.stderr.exp-ppc64le @@ -0,0 +1,147 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>5</protocolversion> +<protocoltool>none</protocoltool> + +<preamble> + <line>Nulgrind, the minimal Valgrind tool</line> + <line>Copyright...</line> + <line>Using Valgrind...</line> + <line>Command: ./fdleak_cmsg</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>none</tool> + +<args> + <vargv> + <exe>...</exe> + <arg>--command-line-only=yes</arg> + <arg>--memcheck:leak-check=no</arg> + <arg>--tool=none</arg> + <arg>--track-fds=all</arg> + <arg>--xml=yes</arg> + <arg>--xml-fd=2</arg> + <arg>--child-silent-after-fork=yes</arg> + </vargv> + <argv> + <exe>...</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>5</fd> + <path>...</path> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>client</fn> + <dir>...</dir> + <file>fdleak_cmsg.c</file> + <line>133</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_cmsg.c</file> + <line>174</line> + </frame> + </stack> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>4</fd> + <path>...</path> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>client</fn> + <dir>...</dir> + <file>fdleak_cmsg.c</file> + <line>133</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_cmsg.c</file> + <line>174</line> + </frame> + </stack> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>3</fd> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>client</fn> + <dir>...</dir> + <file>fdleak_cmsg.c</file> + <line>112</line> + </frame> + </stack> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>2</fd> + <path>...</path> + <what>...</what> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>1</fd> + <path>...</path> + <what>...</what> +</error> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>0</fd> + <path>...</path> + <what>...</what> +</error> + + +</valgrindoutput> + diff --git a/none/tests/fdleak_ipv4_xml.stderr.exp-ppc64le b/none/tests/fdleak_ipv4_xml.stderr.exp-ppc64le new file mode 100644 index 0000000000..df413b6289 --- /dev/null +++ b/none/tests/fdleak_ipv4_xml.stderr.exp-ppc64le @@ -0,0 +1,139 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>5</protocolversion> +<protocoltool>none</protocoltool> + +<preamble> + <line>Nulgrind, the minimal Valgrind tool</line> + <line>Copyright...</line> + <line>Using Valgrind...</line> + <line>Command: ./fdleak_ipv4</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>none</tool> + +<args> + <vargv> + <exe>...</exe> + <arg>--command-line-only=yes</arg> + <arg>--memcheck:leak-check=no</arg> + <arg>--tool=none</arg> + <arg>--track-fds=yes</arg> + <arg>--xml=yes</arg> + <arg>--xml-fd=2</arg> + <arg>--child-silent-after-fork=yes</arg> + </vargv> + <argv> + <exe>...</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdBadClose</kind> + <fd>4</fd> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>client</fn> + <dir>...</dir> + <file>fdleak_ipv4.c</file> + <line>70</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_ipv4.c</file> + <line>90</line> + </frame> + </stack> + <auxwhat>Previously closed</auxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>client</fn> + <dir>...</dir> + <file>fdleak_ipv4.c</file> + <line>69</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_ipv4.c</file> + <line>90</line> + </frame> + </stack> + <auxwhat>Originally opened</auxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>client</fn> + <dir>...</dir> + <file>fdleak_ipv4.c</file> + <line>68</line> + </frame> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>fdleak_ipv4.c</file> + <line>90</line> + </frame> + </stack> +</error> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdNotClosed</kind> + <fd>3</fd> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>client</fn> + <dir>...</dir> + <file>fdleak_ipv4.c</file> + <line>51</line> + </frame> + </stack> +</error> + +<errorcounts> + <pair> + <count>1</count> + <unique>0x........</unique> + </pair> +</errorcounts> + +<suppcounts> +</suppcounts> + +</valgrindoutput> + diff --git a/none/tests/socket_close_xml.stderr.exp-ppc64le b/none/tests/socket_close_xml.stderr.exp-ppc64le new file mode 100644 index 0000000000..2f2bc9831e --- /dev/null +++ b/none/tests/socket_close_xml.stderr.exp-ppc64le @@ -0,0 +1,98 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>5</protocolversion> +<protocoltool>none</protocoltool> + +<preamble> + <line>Nulgrind, the minimal Valgrind tool</line> + <line>Copyright...</line> + <line>Using Valgrind...</line> + <line>Command: ./socket_close</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>none</tool> + +<args> + <vargv> + <exe>...</exe> + <arg>--command-line-only=yes</arg> + <arg>--memcheck:leak-check=no</arg> + <arg>--tool=none</arg> + <arg>-q</arg> + <arg>--track-fds=yes</arg> + <arg>--xml=yes</arg> + <arg>--xml-fd=2</arg> + </vargv> + <argv> + <exe>...</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + +Open socket 3 +close socket_fd 3 +and close the socket again 3 +<error> + <unique>0x........</unique> + <tid>...</tid> + <kind>FdBadClose</kind> + <fd>3</fd> + <what>...</what> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>socket_close.c</file> + <line>40</line> + </frame> + </stack> + <auxwhat>Previously closed</auxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>main</fn> + <dir>...</dir> + <file>socket_close.c</file> + <line>36</line> + </frame> + </stack> + <auxwhat>Originally opened</auxwhat> + <stack> + <frame> + <ip>0x........</ip> + <obj>...</obj> + <fn>open_socket</fn> + <dir>...</dir> + <file>socket_close.c</file> + <line>17</line> + </frame> + </stack> +</error> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + +<errorcounts> + <pair> + <count>1</count> + <unique>0x........</unique> + </pair> +</errorcounts> + + +</valgrindoutput> + |
From: Paul F. <pa...@so...> - 2024-11-23 17:05:41
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=75ca7437c97a703b7a729d8694743ddde3762713 commit 75ca7437c97a703b7a729d8694743ddde3762713 Author: Ryan Mack <rm...@up...> Date: Sat Nov 23 18:02:21 2024 +0100 Bug 496571 - False positive for null key passed to bpf_map_get_next_key syscall. No regtest added because BPF requires privileges. See the bugzilla item for example usage. Diff: --- NEWS | 1 + coregrind/m_syswrap/syswrap-linux.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index eb853a0bd3..ad5fa1a417 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 494327 Crash when running Helgrind built with #define TRACE_PTH_FNS 1 494337 All threaded applications cause still holding lock errors 495488 Add FreeBSD getrlimitusage syscall wrapper +496571 False positive for null key passed to bpf_map_get_next_key syscall. To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index 177712117c..775fae75b2 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -12993,7 +12993,11 @@ PRE(sys_bpf) } /* Get size of key for this map. */ if (bpf_map_get_sizes(attr->map_fd, &key_size, &value_size)) { - PRE_MEM_READ("bpf(attr->key)", attr->key, key_size); + /* see https://bugs.kde.org/show_bug.cgi?id=496571 */ + /* Key is null when getting first entry in map. */ + if (attr->key) { + PRE_MEM_READ("bpf(attr->key)", attr->key, key_size); + } PRE_MEM_WRITE("bpf(attr->next_key)", attr->next_key, key_size); } } |
From: Paul F. <pa...@so...> - 2024-11-23 08:16:25
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=bc0571549e426b5b71387fe3ab01fe0c4a4af4b3 commit bc0571549e426b5b71387fe3ab01fe0c4a4af4b3 Author: Paul Floyd <pj...@wa...> Date: Sat Nov 23 08:14:15 2024 +0100 Turn off unused result warnings Diff: --- Makefile.all.am | 1 + helgrind/hg_intercepts.c | 20 ++++---------------- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/Makefile.all.am b/Makefile.all.am index dcea2690eb..e221198d6c 100755 --- a/Makefile.all.am +++ b/Makefile.all.am @@ -104,6 +104,7 @@ AM_CFLAGS_BASE = \ -Wpointer-arith \ -Wstrict-prototypes \ -Wmissing-declarations \ + -Wno-unused-result \ @FLAG_W_CAST_ALIGN@ \ @FLAG_W_CAST_QUAL@ \ @FLAG_W_WRITE_STRINGS@ \ diff --git a/helgrind/hg_intercepts.c b/helgrind/hg_intercepts.c index ac2449e609..950d71b83c 100644 --- a/helgrind/hg_intercepts.c +++ b/helgrind/hg_intercepts.c @@ -978,10 +978,7 @@ static int mutex_lock_WRK(pthread_mutex_t *mutex) if (TRACE_PTH_FNS) { char buf[30]; snprintf(buf, 30, "<< pthread_mxlock %p", mutex); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-result" - write(STDERR_FILENO, buf, strlen(buf)); -#pragma GCC diagnostic pop + (void)write(STDERR_FILENO, buf, strlen(buf)); fsync(STDERR_FILENO); } @@ -1017,10 +1014,7 @@ HG_MUTEX_LOCK_OUT: if (TRACE_PTH_FNS) { char buf[30]; snprintf(buf, 30, " :: mxlock -> %d >>\n", ret); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-result"1251 - write(STDERR_FILENO, buf, strlen(buf)); -#pragma GCC diagnostic pop + (void)write(STDERR_FILENO, buf, strlen(buf)); } return ret; } @@ -1248,10 +1242,7 @@ static int mutex_unlock_WRK(pthread_mutex_t *mutex) if (TRACE_PTH_FNS) { char buf[30]; snprintf(buf, 30, "<< pthread_mxunlk %p", mutex); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-result" - write(STDERR_FILENO, buf, strlen(buf)); -#pragma GCC diagnostic pop + (void)write(STDERR_FILENO, buf, strlen(buf)); fsync(STDERR_FILENO); } @@ -1270,10 +1261,7 @@ static int mutex_unlock_WRK(pthread_mutex_t *mutex) if (TRACE_PTH_FNS) { char buf[30]; snprintf(buf, 30, " :: mxunlk -> %d >>\n", ret); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-result" - write(STDERR_FILENO, buf, strlen(buf)); -#pragma GCC diagnostic pop + (void)write(STDERR_FILENO, buf, strlen(buf)); } return ret; } |
From: Paul F. <pa...@so...> - 2024-11-23 07:14:10
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=74ae5afa8650a1af7251d0c50757d1335a4ce0b9 commit 74ae5afa8650a1af7251d0c50757d1335a4ce0b9 Author: Paul Floyd <pj...@wa...> Date: Sat Nov 23 08:13:05 2024 +0100 FreeBSD: fix a few warnings when building with GCC Diff: --- coregrind/m_sigframe/sigframe-amd64-freebsd.c | 2 +- coregrind/m_sigframe/sigframe-x86-freebsd.c | 2 +- coregrind/m_syswrap/syswrap-x86-freebsd.c | 8 ++++---- coregrind/pub_core_trampoline.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/coregrind/m_sigframe/sigframe-amd64-freebsd.c b/coregrind/m_sigframe/sigframe-amd64-freebsd.c index f7ee95d3fc..1377c2baeb 100644 --- a/coregrind/m_sigframe/sigframe-amd64-freebsd.c +++ b/coregrind/m_sigframe/sigframe-amd64-freebsd.c @@ -258,7 +258,7 @@ static Addr build_sigframe(ThreadState *tst, VG_TRACK( pre_mem_write, Vg_CoreSignal, tst->tid, "signal handler frame", rsp, offsetof(struct sigframe, vg) ); - frame->retaddr = (Addr)&VG_(amd64_freebsd_SUBST_FOR_sigreturn); + frame->retaddr = (Addr)VG_(amd64_freebsd_SUBST_FOR_sigreturn); if (siguc) { trapno = siguc->uc_mcontext.trapno; diff --git a/coregrind/m_sigframe/sigframe-x86-freebsd.c b/coregrind/m_sigframe/sigframe-x86-freebsd.c index eaa4df264a..f631ad6f95 100644 --- a/coregrind/m_sigframe/sigframe-x86-freebsd.c +++ b/coregrind/m_sigframe/sigframe-x86-freebsd.c @@ -289,7 +289,7 @@ static Addr build_sigframe(ThreadState *tst, esp, offsetof(struct sigframe, vg) ); frame->sigNo = sigNo; - frame->retaddr = (Addr)&VG_(x86_freebsd_SUBST_FOR_sigreturn); + frame->retaddr = (Addr)VG_(x86_freebsd_SUBST_FOR_sigreturn); if ((flags & VKI_SA_SIGINFO) == 0) frame->psigInfo = (Addr)siginfo->si_code; else diff --git a/coregrind/m_syswrap/syswrap-x86-freebsd.c b/coregrind/m_syswrap/syswrap-x86-freebsd.c index 102a7a0779..0ad3dda264 100644 --- a/coregrind/m_syswrap/syswrap-x86-freebsd.c +++ b/coregrind/m_syswrap/syswrap-x86-freebsd.c @@ -402,12 +402,12 @@ static void deallocate_LGDTs_for_thread ( VexGuestX86State* vex ) } if (vex->guest_LDT != (HWord)NULL) { - free_LDT_or_GDT( (VexGuestX86SegDescr*)vex->guest_LDT ); + free_LDT_or_GDT( (VexGuestX86SegDescr*)(HWord)vex->guest_LDT ); vex->guest_LDT = (HWord)NULL; } if (vex->guest_GDT != (HWord)NULL) { - free_LDT_or_GDT( (VexGuestX86SegDescr*)vex->guest_GDT ); + free_LDT_or_GDT( (VexGuestX86SegDescr*)(HWord)vex->guest_GDT ); vex->guest_GDT = (HWord)NULL; } } @@ -420,7 +420,7 @@ static SysRes sys_set_thread_area ( ThreadId tid, Int *idxptr, void *base) vg_assert(8 == sizeof(VexGuestX86SegDescr)); vg_assert(sizeof(HWord) == sizeof(VexGuestX86SegDescr*)); - gdt = (VexGuestX86SegDescr*)VG_(threads)[tid].arch.vex.guest_GDT; + gdt = (VexGuestX86SegDescr*)(HWord)VG_(threads)[tid].arch.vex.guest_GDT; /* If the thread doesn't have a GDT, allocate it now. */ if (!gdt) { @@ -463,7 +463,7 @@ static SysRes sys_get_thread_area ( ThreadId tid, Int idx, void ** basep ) vg_assert(sizeof(HWord) == sizeof(VexGuestX86SegDescr*)); vg_assert(8 == sizeof(VexGuestX86SegDescr)); - gdt = (VexGuestX86SegDescr*)VG_(threads)[tid].arch.vex.guest_GDT; + gdt = (VexGuestX86SegDescr*)(HWord)VG_(threads)[tid].arch.vex.guest_GDT; /* If the thread doesn't have a GDT, allocate it now. */ if (!gdt) { diff --git a/coregrind/pub_core_trampoline.h b/coregrind/pub_core_trampoline.h index d0bd6b8597..f92b6ab450 100644 --- a/coregrind/pub_core_trampoline.h +++ b/coregrind/pub_core_trampoline.h @@ -57,11 +57,11 @@ extern Addr VG_(trampoline_stuff_start); extern Addr VG_(trampoline_stuff_end); #if defined(VGP_x86_freebsd) -extern void VG_(x86_freebsd_SUBST_FOR_sigreturn); +extern void VG_(x86_freebsd_SUBST_FOR_sigreturn)(void); #endif #if defined(VGP_amd64_freebsd) -extern void VG_(amd64_freebsd_SUBST_FOR_sigreturn); +extern void VG_(amd64_freebsd_SUBST_FOR_sigreturn)(void); #endif #if defined(VGP_arm64_freebsd) |