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: Yonggang L. <luo...@gm...> - 2024-12-07 21:45:16
|
Signed-off-by: Yonggang Luo <luo...@gm...> --- include/valgrind.h.in | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/include/valgrind.h.in b/include/valgrind.h.in index bc18f40f7..157b9559d 100644 --- a/include/valgrind.h.in +++ b/include/valgrind.h.in @@ -412,7 +412,7 @@ valgrind_do_client_request_expr(uintptr_t _zzq_default, uintptr_t _zzq_request, typedef struct { - unsigned long int nraddr; /* where's the code? */ + unsigned long long int nraddr; /* where's the code? */ } OrigFn; @@ -424,14 +424,14 @@ typedef _zzq_default, _zzq_request, \ _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \ __extension__ \ - ({ volatile unsigned long int _zzq_args[6]; \ - volatile unsigned long int _zzq_result; \ - _zzq_args[0] = (unsigned long int)(_zzq_request); \ - _zzq_args[1] = (unsigned long int)(_zzq_arg1); \ - _zzq_args[2] = (unsigned long int)(_zzq_arg2); \ - _zzq_args[3] = (unsigned long int)(_zzq_arg3); \ - _zzq_args[4] = (unsigned long int)(_zzq_arg4); \ - _zzq_args[5] = (unsigned long int)(_zzq_arg5); \ + ({ volatile unsigned long long int _zzq_args[6]; \ + volatile unsigned long long int _zzq_result; \ + _zzq_args[0] = (unsigned long long int)(_zzq_request); \ + _zzq_args[1] = (unsigned long long int)(_zzq_arg1); \ + _zzq_args[2] = (unsigned long long int)(_zzq_arg2); \ + _zzq_args[3] = (unsigned long long int)(_zzq_arg3); \ + _zzq_args[4] = (unsigned long long int)(_zzq_arg4); \ + _zzq_args[5] = (unsigned long long int)(_zzq_arg5); \ __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \ /* %RDX = client_request ( %RAX ) */ \ "xchgq %%rbx,%%rbx" \ @@ -444,7 +444,7 @@ typedef #define VALGRIND_GET_NR_CONTEXT(_zzq_rlval) \ { volatile OrigFn* _zzq_orig = &(_zzq_rlval); \ - volatile unsigned long int __addr; \ + volatile unsigned long long int __addr; \ __asm__ volatile(__SPECIAL_INSTRUCTION_PREAMBLE \ /* %RAX = guest_NRADDR */ \ "xchgq %%rcx,%%rcx" \ @@ -468,7 +468,10 @@ typedef ); \ } while (0) -#endif /* PLAT_amd64_linux || PLAT_amd64_darwin || PLAT_amd64_solaris */ +#endif /* defined(PLAT_amd64_linux) || defined(PLAT_amd64_darwin) \ + || defined(PLAT_amd64_solaris) \ + || defined(PLAT_amd64_freebsd) \ + || (defined(PLAT_amd64_win64) && defined(__GNUC__)) */ /* ------------------------- amd64-Win64 ------------------------- */ -- 2.46.0.windows.1 |
From: Florian K. <fl...@ei...> - 2024-12-07 21:23:08
|
Here is an updated patch which also removes .post.out files. Also, turns out, that .diff files can have a suffix as derived from the .exp file that was used in the comparison. Those get removed now as well. diff --git a/Makefile.am b/Makefile.am index b3e5be5f4..bace4a499 100644 --- a/Makefile.am +++ b/Makefile.am @@ -139,6 +139,16 @@ clean-local: rm -rf $(inplacedir) include/vgversion.h find . -name '*.vgtest.log' -print0 | xargs -r -0 rm find . -name '*.vgtest.trs' -print0 | xargs -r -0 rm + find . -name '*.stdout.out' -print0 | xargs -r -0 rm + find . -name '*.stderr.out' -print0 | xargs -r -0 rm + find . -name '*.stdoutB.out' -print0 | xargs -r -0 rm + find . -name '*.stderrB.out' -print0 | xargs -r -0 rm + find . -name '*.post.out' -print0 | xargs -r -0 rm + find . -name '*.stdout.diff*' -print0 | xargs -r -0 rm + find . -name '*.stderr.diff*' -print0 | xargs -r -0 rm + find . -name '*.stdoutB.diff*' -print0 | xargs -r -0 rm + find . -name '*.stderrB.diff*' -print0 | xargs -r -0 rm + find . -name '*.post.diff*' -print0 | xargs -r -0 rm find . -name test-suite.log -print0 | xargs -r -0 rm rm -f test-suite-overall.log On 02.12.24 22:00, Florian Krohm wrote: > The patch below removes artefacts from failing regression tests. > Specifically, "make distclean" and "make maintainer-clean" removes them. > Previously they were not removed which was a surprise. > post_regtest_checks does not appear to create any files that ought to be cleaned > up. > Thanks to Paul for pointing me to the file to change. > > Florian > > > diff --git a/Makefile.am b/Makefile.am > index b3e5be5f4..b584cb34b 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -139,6 +139,14 @@ clean-local: > rm -rf $(inplacedir) include/vgversion.h > find . -name '*.vgtest.log' -print0 | xargs -r -0 rm > find . -name '*.vgtest.trs' -print0 | xargs -r -0 rm > + find . -name '*.stdout.out' -print0 | xargs -r -0 rm > + find . -name '*.stderr.out' -print0 | xargs -r -0 rm > + find . -name '*.stdoutB.out' -print0 | xargs -r -0 rm > + find . -name '*.stderrB.out' -print0 | xargs -r -0 rm > + find . -name '*.stdout.diff' -print0 | xargs -r -0 rm > + find . -name '*.stderr.diff' -print0 | xargs -r -0 rm > + find . -name '*.stdoutB.diff' -print0 | xargs -r -0 rm > + find . -name '*.stderrB.diff' -print0 | xargs -r -0 rm > find . -name test-suite.log -print0 | xargs -r -0 rm > rm -f test-suite-overall.log > |
From: Paul F. <pa...@so...> - 2024-12-06 20:25:47
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=c5552fe28b8d89ed5a92cc736fa00d7e336a3f2c commit c5552fe28b8d89ed5a92cc736fa00d7e336a3f2c Author: Paul Floyd <pj...@wa...> Date: Fri Dec 6 21:24:50 2024 +0100 regtest: fix a warning building none/tests/nestedfns on some platforms Diff: --- none/tests/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 53a6e1f6bc..fa0128d3a8 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -335,6 +335,7 @@ endif if HAVE_NESTED_FUNCTIONS check_PROGRAMS += nestedfns + nestedfns_LDFLAGS = -Wl,-z,noexecstack endif # This doesn't appear to be compilable on Darwin. |
From: Andreas A. <ar...@so...> - 2024-12-04 16:07:15
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=bdd2e5cd04f63f6fb58f15ee2781f013f1a042f2 commit bdd2e5cd04f63f6fb58f15ee2781f013f1a042f2 Author: Andreas Arnez <ar...@li...> Date: Wed Dec 4 16:53:17 2024 +0100 s390x: Update instruction list with arch15 insns Recent commits in Binutils added arch15 instructions to s390-opc.txt. Since then, the script s390-check-opcodes.pl complains about many insns that are not known to Valgrind. Update Valgrind's instruction list to be in synch with Binutils again. Add the new instructions to s390-opcodes.csv and declare them as "not implemented". Diff: --- VEX/priv/guest_s390_toIR.c | 28 +++++++++++++++++ auxprogs/s390-check-opcodes.pl | 55 +++++++++++++++++--------------- docs/internals/s390-opcodes.csv | 70 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 127 insertions(+), 26 deletions(-) diff --git a/VEX/priv/guest_s390_toIR.c b/VEX/priv/guest_s390_toIR.c index b6e8e5997e..6da5996452 100644 --- a/VEX/priv/guest_s390_toIR.c +++ b/VEX/priv/guest_s390_toIR.c @@ -20675,6 +20675,10 @@ s390_decode_4byte_and_irgen(const UChar *bytes) RRF4_r1(ovl), RRF4_r2(ovl)); goto ok; case 0xb967: s390_format_RRF_R0RR2(s390_irgen_NXGRK, RRF4_r3(ovl), RRF4_r1(ovl), RRF4_r2(ovl)); goto ok; + case 0xb968: /* CLZG */ goto unimplemented; + case 0xb969: /* CTZG */ goto unimplemented; + case 0xb96c: /* BEXTG */ goto unimplemented; + case 0xb96d: /* BDEPG */ goto unimplemented; case 0xb972: s390_format_RRF_U0RR(s390_irgen_CRT, RRF2_m3(ovl), RRF2_r1(ovl), RRF2_r2(ovl), S390_XMNM_CAB); goto ok; @@ -21279,6 +21283,16 @@ s390_decode_6byte_and_irgen(const UChar *bytes) RXY_x2(ovl), RXY_b2(ovl), RXY_dl2(ovl), RXY_dh2(ovl)); goto ok; + case 0xe30000000060ULL: /* LXAB */ goto unimplemented; + case 0xe30000000061ULL: /* LLXAB */ goto unimplemented; + case 0xe30000000062ULL: /* LXAH */ goto unimplemented; + case 0xe30000000063ULL: /* LLXAH */ goto unimplemented; + case 0xe30000000064ULL: /* LXAF */ goto unimplemented; + case 0xe30000000065ULL: /* LLXAF */ goto unimplemented; + case 0xe30000000066ULL: /* LXAG */ goto unimplemented; + case 0xe30000000067ULL: /* LLXAG */ goto unimplemented; + case 0xe30000000068ULL: /* LXAQ */ goto unimplemented; + case 0xe30000000069ULL: /* LLXAQ */ goto unimplemented; case 0xe30000000070ULL: s390_format_RXY_RRRD(s390_irgen_STHY, RXY_r1(ovl), RXY_x2(ovl), RXY_b2(ovl), RXY_dl2(ovl), @@ -21536,6 +21550,8 @@ s390_decode_6byte_and_irgen(const UChar *bytes) VRS_d2(ovl), VRS_rxb(ovl)); goto ok; case 0xe60000000049ULL: /* VLIP */ goto unimplemented; + case 0xe6000000004aULL: /* VCVDQ */ goto unimplemented; + case 0xe6000000004eULL: /* VCVBQ */ goto unimplemented; case 0xe60000000050ULL: /* VCVB */ goto unimplemented; case 0xe60000000051ULL: /* VCLZDP */ goto unimplemented; case 0xe60000000052ULL: /* VCVBG */ goto unimplemented; @@ -21580,6 +21596,7 @@ s390_decode_6byte_and_irgen(const UChar *bytes) case 0xe6000000007cULL: /* VSCSHP */ goto unimplemented; case 0xe6000000007dULL: /* VCSPH */ goto unimplemented; case 0xe6000000007eULL: /* VSDP */ goto unimplemented; + case 0xe6000000007fULL: /* VTZ */ goto unimplemented; case 0xe70000000000ULL: s390_format_VRX_VRRDM(s390_irgen_VLEB, VRX_v1(ovl), VRX_x2(ovl), VRX_b2(ovl), VRX_d2(ovl), VRX_m3(ovl), @@ -21720,6 +21737,7 @@ s390_decode_6byte_and_irgen(const UChar *bytes) case 0xe70000000053ULL: s390_format_VRR_VVM(s390_irgen_VCLZ, VRR_v1(ovl), VRR_v2(ovl), VRR_m4(ovl), VRR_rxb(ovl)); goto ok; + case 0xe70000000054ULL: /* VGEM */ goto unimplemented; case 0xe70000000056ULL: s390_format_VRR_VV(s390_irgen_VLR, VRR_v1(ovl), VRR_v2(ovl), VRR_rxb(ovl)); goto ok; case 0xe7000000005cULL: s390_format_VRR_VVMM(s390_irgen_VISTR, VRR_v1(ovl), @@ -21836,6 +21854,8 @@ s390_decode_6byte_and_irgen(const UChar *bytes) VRId_v2(ovl), VRId_v3(ovl), VRId_i4(ovl), VRId_rxb(ovl)); goto ok; + case 0xe70000000088ULL: /* VEVAL */ goto unimplemented; + case 0xe70000000089ULL: /* VBLEND */ goto unimplemented; case 0xe7000000008aULL: s390_format_VRR_VVVVMM(s390_irgen_VSTRC, VRRd_v1(ovl), VRRd_v2(ovl), VRRd_v3(ovl), VRRd_v4(ovl), VRRd_m5(ovl), @@ -21930,6 +21950,10 @@ s390_decode_6byte_and_irgen(const UChar *bytes) VRRd_v2(ovl), VRRd_v3(ovl), VRRd_v4(ovl), VRRd_m5(ovl), VRRd_rxb(ovl)); goto ok; + case 0xe700000000b0ULL: /* VDL */ goto unimplemented; + case 0xe700000000b1ULL: /* VRL */ goto unimplemented; + case 0xe700000000b2ULL: /* VD */ goto unimplemented; + case 0xe700000000b3ULL: /* VR */ goto unimplemented; case 0xe700000000b4ULL: s390_format_VRR_VVVM(s390_irgen_VGFM, VRR_v1(ovl), VRR_v2(ovl), VRR_r3(ovl), VRR_m4(ovl), VRR_rxb(ovl)); goto ok; @@ -22136,6 +22160,7 @@ s390_decode_6byte_and_irgen(const UChar *bytes) RSY_r3(ovl), RSY_b2(ovl), RSY_dl2(ovl), RSY_dh2(ovl)); goto ok; + case 0xeb0000000016ULL: /* PFCR */ goto unimplemented; case 0xeb000000001cULL: s390_format_RSY_RRRD(s390_irgen_RLLG, RSY_r1(ovl), RSY_r3(ovl), RSY_b2(ovl), RSY_dl2(ovl), @@ -22772,6 +22797,9 @@ s390_decode_6byte_and_irgen(const UChar *bytes) case 0xc802ULL: /* CSST */ goto unimplemented; case 0xc804ULL: /* LPD */ goto unimplemented; case 0xc805ULL: /* LPDG */ goto unimplemented; + case 0xc806ULL: /* CAL */ goto unimplemented; + case 0xc807ULL: /* CALG */ goto unimplemented; + case 0xc80fULL: /* CALGF */ goto unimplemented; case 0xcc06ULL: s390_format_RIL_RP(s390_irgen_BRCTH, RIL_r1(ovl), RIL_i2(ovl)); goto ok; case 0xcc08ULL: s390_format_RIL_RI(s390_irgen_AIH, RIL_r1(ovl), diff --git a/auxprogs/s390-check-opcodes.pl b/auxprogs/s390-check-opcodes.pl index 52325beaa1..474bb3a7e8 100755 --- a/auxprogs/s390-check-opcodes.pl +++ b/auxprogs/s390-check-opcodes.pl @@ -46,24 +46,24 @@ my %toir_implemented = (); my %toir_decoded = (); my %toir_format = (); my %known_arch = map {($_ => 1)} - qw(g5 z900 z990 z9-109 z9-ec z10 z196 zEC12 z13 arch12 arch13 arch14); + qw(g5 z900 z990 z9-109 z9-ec z10 z196 zEC12 z13 arch12 arch13 arch14 arch15); # Patterns for identifying certain extended mnemonics that shall be # skipped in "s390-opc.txt" and "s390-opcodes.csv". -my @extended_mnemonics = ( - "bi", # extended mnemonic for bic +my @extended_mnemonics = ( # Base mnemonic(s) + "bi", # bic 'brul?', - 'jc', # brc + 'jc', # brc 'jasl?', 'jct[gh]?', 'jg?nop', 'jxleg?', 'jxhg?', 'l[de]rv', - 'lfi', # iilf - 'llg[fh]i', # llilf, llill - 'notg?r', # nork, nogrk + 'lfi', # iilf + 'llg[fh]i', # llilf, llill + 'notg?r', # nork, nogrk 'risbgn?z', 'risb[hl]gz', 'r[onx]sbgt', @@ -72,17 +72,19 @@ my @extended_mnemonics = ( "vacc[bhfgq]", "vacccq", "vacq", - "vavgl*[bhfg]", + "vavgl?[bhfgq]", # vavg, vavgl + "vblend[bhfgq]", # vblend "vcdl*gb", 'vcfp[sl]', '[vw]cel?fb', 'vc[sl]fp', '[vw]cl?feb', - "vceq[bhfg]s*", - "vchl*[bhfg]s*", + "vceq[bhfgq]s?", # vceq + "vchl?[bhfgq]s?", # vch, vchl "vcl*gdb", - "vc[lt]z[bhfg]", - "vecl*[bhfg]", + "vc[lt]z[bhfgq]", # vclz, vctz + "vdl?[fgq]", # vd, vdl + "vecl?[bhfgq]", # vec, vecl "verim[bhfg]", "verllv*[bhfg]", "veslv*[bhfg]", @@ -111,12 +113,13 @@ my @extended_mnemonics = ( "vfpso[sd]b", "vfsq*[sd]b", "vftci[sd]b", + "vgem[bfghq]", # vgem "vgfma*[bhfg]", "vgm[bhfg]", "vistr[bhfg]s*", 'vlbr[hfgq]', 'vlbrrep[hfg]', - "vlc[bhfg]", + "vlc[bhfgq]", # vlc "[vw]ldeb", "[vw]ledb", 'vler[hfg]', @@ -124,15 +127,15 @@ my @extended_mnemonics = ( 'vllebrz[hfge]', "vllez[bhfg]", "vllezlf", - "vlp[bhfg]", + "vlp[bhfgq]", # vlp "vlrep[bhfg]", "vlvg[bhfg]", - "vmal?[eoh][bhfg]", - "vmal(b|hw|f)", - "vml(b|hw|f)", - "vml?(o|e)[bhf]", - "vml?h[bhf]", - "vm[nx]l*[bhfg]", + "vmal?[eoh][bhfgq]", # vmae, vmale, vmao, vmalo, vmah, vmalh + "vmal(b|hw|f|g|q)", # vmal + "vml(b|hw|f|g|q)", # vml + "vml?(o|e)[bhfg]", # vmo, vme + "vml?h[bhfgq]", # vmh, vmlh + "vm[nx]l*[bhfgq]", # vmn, vmnl, vmx, vmxl "vmr[lh][bhfg]", "vmslg", "vnot", @@ -140,22 +143,22 @@ my @extended_mnemonics = ( "vpkl*[bhfg]", "vpkl*s*[bhfg]s*", "vpopct[bhfg]", + "vrl?[fgq]", # vr, vrl "vrepi*[bhgf]", "vs[bhfgq]", "vsbcbiq", "vsbiq", "vscbi[bhfgq]", - "vsch[sdx]p", # vschp (short/long/extended) + "vsch[sdx]p", # vschp "vseg[bfh]", 'vstbr[hfgq]', 'vster[hfg]', "vstrcz*[bhf]s*", 'vstrsz?[bhf]', "vsum(b|gh|gf|h|qf|qg)", - "vuplh[bhf]", - "vuph[bhf]", - "vupl(b|hw|f)", - "vupll[bhf]", + "vupl?h[bhfg]", # vuph, vuplh + "vupl(b|hw|f|g)", # vupl + "vupll[bhfg]", # vupll "wcdl*gb", "wcl*gdb", "wfa[sdx]b", @@ -172,7 +175,7 @@ my @extended_mnemonics = ( "wftci[sdx]b", "wfsq*[sdx]b", "vl(ed|de)", - "prno" # alternate mnemonic for ppno + "prno" # ppno ); # Compile excluded mnemonics into one regular expression to optimize diff --git a/docs/internals/s390-opcodes.csv b/docs/internals/s390-opcodes.csv index 2b6fae36db..75baaf15ad 100644 --- a/docs/internals/s390-opcodes.csv +++ b/docs/internals/s390-opcodes.csv @@ -1765,3 +1765,73 @@ lpswey,"load PSW extended",N/A,"privileged instruction" lbear,"load bear",N/A,"privileged instruction" stbear,"store bear",N/A,"privileged instruction" qpaci,"query processor activity counter information",N/A,"privileged instruction" +bdepg,"bit deposit","not implemented",arch15 +bextg,"bit extract","not implemented",arch15 +cal,"compare and load 32","not implemented",arch15 +calg,"compare and load 64","not implemented",arch15 +calgf,"compare and load 64<32","not implemented",arch15 +clzg,"count leading zeros","not implemented",arch15 +ctzg,"count trailing zeros","not implemented",arch15 +llxab,"load logical indexed address (shift left 0)","not implemented",arch15 +llxah,"load logical indexed address (shift left 1)","not implemented",arch15 +llxaf,"load logical indexed address (shift left 2)","not implemented",arch15 +llxag,"load logical indexed address (shift left 3)","not implemented",arch15 +llxaq,"load logical indexed address (shift left 4)","not implemented",arch15 +lxab,"load indexed address (shift left 0)","not implemented",arch15 +lxah,"load indexed address (shift left 1)","not implemented",arch15 +lxaf,"load indexed address (shift left 2)","not implemented",arch15 +lxag,"load indexed address (shift left 3)","not implemented",arch15 +lxaq,"load indexed address (shift left 4)","not implemented",arch15 +pfcr,"perform functions with concurrent results","not implemented",arch15 +vblend,"vector blend","not implemented",arch15 +vcvbq,"vector convert to binary 128 bit","not implemented",arch15 +vcvdq,"vector convert to decimal 128 bit","not implemented",arch15 +vd,"vector divide","not implemented",arch15 +vdl,"vector divide logical","not implemented",arch15 +veval,"vector evaluate","not implemented",arch15 +vgem,"vector generate element masks","not implemented",arch15 +vr,"vector remainder","not implemented",arch15 +vrl,"vector remainder logical","not implemented",arch15 +vtz,"vector test zoned","not implemented",arch15 +vavgq,"vector average quadword","not implemented",arch15 +vavglq,"vector average logical quadword","not implemented",arch15 +vecq,"vector element compare quadword","not implemented",arch15 +veclq,"vector element compare logical quadword","not implemented",arch15 +vceqq,"vector compare equal quadword","not implemented",arch15 +vceqqs,"vector compare equal quadword","not implemented",arch15 +vchq,"vector compare high quadword","not implemented",arch15 +vchqs,"vector compare high quadword","not implemented",arch15 +vchlq,"vector compare high logical quadword","not implemented",arch15 +vchlqs,"vector compare high logical quadword","not implemented",arch15 +vclzq,"vector count leading zeros quadword","not implemented",arch15 +vctzq,"vector count trailing zeros quadword","not implemented",arch15 +vlcq,"vector load complement quadword","not implemented",arch15 +vlpq,"vector load positive quadword","not implemented",arch15 +vmxq,"vector maximum quadword","not implemented",arch15 +vmxlq,"vector maximum logical quadword","not implemented",arch15 +vmnq,"vector minimum quadword","not implemented",arch15 +vmnlq,"vector minimum logical quadword","not implemented",arch15 +vmalg,"vector multiply and add low doubleword","not implemented",arch15 +vmalq,"vector multiply and add low quadword","not implemented",arch15 +vmahg,"vector multiply and add high doubleword","not implemented",arch15 +vmahq,"vector multiply and add high quadword","not implemented",arch15 +vmalhg,"vector multiply and add logical high doubleword","not implemented",arch15 +vmalhq,"vector multiply and add logical high quadword","not implemented",arch15 +vmaeg,"vector multiply and add even doubleword","not implemented",arch15 +vmaleg,"vector multiply and add logical even doubleword","not implemented",arch15 +vmaog,"vector multiply and add odd doubleword","not implemented",arch15 +vmalog,"vector multiply and add logical odd doubleword","not implemented",arch15 +vmhg,"vector multiply high doubleword","not implemented",arch15 +vmhq,"vector multiply high quadword","not implemented",arch15 +vmlhg,"vector multiply logical high doubleword","not implemented",arch15 +vmlhq,"vector multiply logical high quadword","not implemented",arch15 +vmlg,"vector multiply low doubleword","not implemented",arch15 +vmlq,"vector multiply low quadword","not implemented",arch15 +vmeg,"vector multiply even doubleword","not implemented",arch15 +vmleg,"vector multiply logical even doubleword","not implemented",arch15 +vmog,"vector multiply odd doubleword","not implemented",arch15 +vmlog,"vector multiply logical odd doubleword","not implemented",arch15 +vuphg,"vector unpack high doubleword","not implemented",arch15 +vuplhg,"vector unpack logical high doubleword","not implemented",arch15 +vuplg,"vector unpack low doubleword","not implemented",arch15 +vupllg,"vector unpack logical low doubleword","not implemented",arch15 |
From: Andreas A. <ar...@so...> - 2024-12-04 16:07:09
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=c23ec25e896b06950ac4c677bfe7f2d59c666078 commit c23ec25e896b06950ac4c677bfe7f2d59c666078 Author: Florian Krohm <fl...@ei...> Date: Wed Dec 4 16:53:17 2024 +0100 Bug 495817 - s390x: Fix disassembly for SEL[G]R and SELFHR The disassemblies of selr, selgr, and selfhr have their register operands mixed up, and no extended mnemonics are used. Fix this. Diff: --- VEX/priv/guest_s390_toIR.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VEX/priv/guest_s390_toIR.c b/VEX/priv/guest_s390_toIR.c index 1d889ac32c..b6e8e5997e 100644 --- a/VEX/priv/guest_s390_toIR.c +++ b/VEX/priv/guest_s390_toIR.c @@ -3186,7 +3186,7 @@ s390_format_RRF_RURR(const HChar *(*irgen)(UChar, UChar, UChar, UChar), const HChar *mnm = irgen(r3, m4, r1, r2); if (UNLIKELY(vex_traceflags & VEX_TRACE_FE)) - s390_disasm(ENC5(MNM, GPR, GPR, GPR, UINT), mnm, r1, r3, r2, m4); + s390_disasm(ENC4(XMNM, GPR, GPR, GPR), S390_XMNM_CLS, mnm, m4, r1, r2, r3); } static void |
From: Andreas A. <ar...@so...> - 2024-12-04 16:07:04
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=d7e5f4ca5fcea86f4cbcd84494b68317adf2fbdc commit d7e5f4ca5fcea86f4cbcd84494b68317adf2fbdc Author: Florian Krohm <fl...@ei...> Date: Wed Dec 4 16:53:17 2024 +0100 Bug 495817 - s390x: Fix disassembly for BC[R], BR[C]L, and BIC The disassembly of the conditional branch insns bc, bcr, brl, brcl, and bic differs from objdump's output. Some examples: *** mismatch VEX: |bic 20,0| vs objdump: |bic 0,20| *** mismatch VEX: |bic 20(%r6),0| vs objdump: |bic 0,20(%r6)| *** mismatch VEX: |bic 20(%r4),0| vs objdump: |bic 0,20(%r4,%r0)| *** mismatch VEX: |bih 20(%r12)| vs objdump: |bih 20(%r12,%r0)| *** mismatch VEX: |nopr| vs objdump: |nopr %r6| *** mismatch VEX: |b 12(%r11)| vs objdump: |b 12(%r11,%r0)| *** mismatch VEX: |blh 12(%r11)| vs objdump: |blh 12(%r11,%r0)| *** mismatch VEX: |brc 0,.+0| vs objdump: |jnop c| *** mismatch VEX: |brcl 0,.+0| vs objdump: |jgnop c| All fixed with this patch. Note that the issue with the base register sometimes being suppressed affects various other insns as well. Diff: --- VEX/priv/s390_disasm.c | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/VEX/priv/s390_disasm.c b/VEX/priv/s390_disasm.c index 67b5c2bc3c..77f7bd7e8b 100644 --- a/VEX/priv/s390_disasm.c +++ b/VEX/priv/s390_disasm.c @@ -219,7 +219,7 @@ bc_operand(UInt m1) static const HChar * brc_operand(UInt m1) { - if (m1 == 0) return "brc"; + if (m1 == 0) return "jnop"; if (m1 == 15) return "j"; return construct_mnemonic("j", "", m1); @@ -230,7 +230,7 @@ brc_operand(UInt m1) static const HChar * brcl_operand(UInt m1) { - if (m1 == 0) return "brcl"; + if (m1 == 0) return "jgnop"; if (m1 == 15) return "jg"; return construct_mnemonic("jg", "", m1); @@ -259,11 +259,7 @@ dxb_operand(HChar *p, UInt d, UInt x, UInt b, Bool displacement_is_signed) p += vex_sprintf(p, "%u", d); } if (x != 0) { - p += vex_sprintf(p, "(%s", gpr_operand(x)); - if (b != 0) { - p += vex_sprintf(p, ",%s", gpr_operand(b)); - } - p += vex_sprintf(p, ")"); + p += vex_sprintf(p, "(%s,%s)", gpr_operand(x), gpr_operand(b)); } else { if (b != 0) { p += vex_sprintf(p, "(%s)", gpr_operand(b)); @@ -373,8 +369,6 @@ s390_disasm(UInt command, ...) mask = va_arg(args, UInt); mnm = kind == S390_XMNM_BCR ? bcr_operand(mask) : bc_operand(mask); p += vex_sprintf(p, "%s", mnemonic(mnm)); - /* mask == 0 is a NOP and has no argument */ - if (mask == 0) goto done; break; case S390_XMNM_BRC: @@ -382,12 +376,6 @@ s390_disasm(UInt command, ...) mask = va_arg(args, UInt); mnm = kind == S390_XMNM_BRC ? brc_operand(mask) : brcl_operand(mask); p += vex_sprintf(p, "%s", mnemonic(mnm)); - - /* mask == 0 has no special mnemonic */ - if (mask == 0) { - p += vex_sprintf(p, " 0"); - separator = ','; - } break; case S390_XMNM_CAB: @@ -409,8 +397,8 @@ s390_disasm(UInt command, ...) mask = va_arg(args, UInt); if (mask == 0) { /* There is no special opcode when mask == 0. */ - p += vex_sprintf(p, "bic"); - mask_suffix = mask; + p += vex_sprintf(p, "%s", mnemonic("bic")); + p += vex_sprintf(p, "%u,", mask); } else { p += vex_sprintf(p, "%s", construct_mnemonic("bi", "", mask)); } |
From: Andreas A. <ar...@so...> - 2024-12-04 16:06:59
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=c251bf089f4e4502affa0db9972a78991bbfb1a9 commit c251bf089f4e4502affa0db9972a78991bbfb1a9 Author: Florian Krohm <fl...@ei...> Date: Wed Dec 4 16:53:17 2024 +0100 Bug 495817 - s390x: Fix disassembly for compare-and-branch/trap insns The insns C[L][G]R[BJ], C[L][G]I[BJ], CL[G]T, and CL[FG]IT are disassembled incorrectly. Fix this. Replace s390_format_RIEv1 with s390_format_R0UU and s390_format_R0IU. Handling both a signed and unsigned immediate constant field with the same s390_format_... function does not work. Add function s390_format_RSY_R0RD for CLT and CLGT. Those opcodes have extended mnemonics. So adjusting the formerly used s390_format_RSY_RURD wasn't an option as that function is also used for CLM[HY], STCM[HY], and ICM[HY] which don't have extended mnemonics. Diff: --- VEX/priv/guest_s390_toIR.c | 79 ++++++++++++++++++++++++++++++++-------------- VEX/priv/s390_disasm.c | 12 ++++--- 2 files changed, 62 insertions(+), 29 deletions(-) diff --git a/VEX/priv/guest_s390_toIR.c b/VEX/priv/guest_s390_toIR.c index 7f077efd23..1d889ac32c 100644 --- a/VEX/priv/guest_s390_toIR.c +++ b/VEX/priv/guest_s390_toIR.c @@ -141,9 +141,9 @@ typedef enum { #define RIE_RRUUU_i3(insn) (((insn) >> 40) & 0xff) #define RIE_RRUUU_i4(insn) (((insn) >> 32) & 0xff) #define RIE_RRUUU_i5(insn) (((insn) >> 24) & 0xff) -#define RIEv1_r1(insn) (((insn) >> 52) & 0xf) -#define RIEv1_i2(insn) (((insn) >> 32) & 0xffff) -#define RIEv1_m3(insn) (((insn) >> 28) & 0xf) +#define RIE_R0xU_r1(insn) (((insn) >> 52) & 0xf) +#define RIE_R0xU_i2(insn) (((insn) >> 32) & 0xffff) +#define RIE_R0xU_m3(insn) (((insn) >> 28) & 0xf) #define RIE_RRPU_r1(insn) (((insn) >> 52) & 0xf) #define RIE_RRPU_r2(insn) (((insn) >> 48) & 0xf) #define RIE_RRPU_i4(insn) (((insn) >> 32) & 0xffff) @@ -2796,13 +2796,25 @@ s390_format_RIE_RRUUU(const HChar *(*irgen)(UChar r1, UChar r2, UChar i3, } static void -s390_format_RIEv1(const HChar *(*irgen)(UChar r1, UShort i2, UChar m3), - UChar r1, UShort i2, UChar m3) +s390_format_R0UU(const HChar *(*irgen)(UChar r1, UShort i2, UChar m3), + UChar r1, UShort i2, UChar m3) { const HChar *mnm = irgen(r1, i2, m3); if (UNLIKELY(vex_traceflags & VEX_TRACE_FE)) - s390_disasm(ENC4(MNM, GPR, UINT, UINT), mnm, r1, i2, m3); + s390_disasm(ENC4(XMNM, GPR, INT, CABM), S390_XMNM_CAB, mnm, m3, r1, + i2, m3); +} + +static void +s390_format_R0IU(const HChar *(*irgen)(UChar r1, UShort i2, UChar m3), + UChar r1, UShort i2, UChar m3) +{ + const HChar *mnm = irgen(r1, i2, m3); + + if (UNLIKELY(vex_traceflags & VEX_TRACE_FE)) + s390_disasm(ENC4(XMNM, GPR, INT, CABM), S390_XMNM_CAB, mnm, m3, r1, + (Int)(Short)i2, m3); } static void @@ -3333,6 +3345,25 @@ s390_format_RSY_RURD(const HChar *(*irgen)(UChar r1, UChar r3, IRTemp op2addr), s390_disasm(ENC4(MNM, GPR, UINT, SDXB), mnm, r1, r3, dh2, dl2, 0, b2); } +static void +s390_format_RSY_R0RD(const HChar *(*irgen)(UChar r1, UChar m3, IRTemp op2addr), + UChar r1, UChar m3, UChar b2, UShort dl2, UChar dh2) +{ + const HChar *mnm; + IRTemp op2addr = newTemp(Ity_I64); + IRTemp d2 = newTemp(Ity_I64); + + assign(d2, mkU64(((ULong)(Long)(Char)dh2 << 12) | ((ULong)dl2))); + assign(op2addr, binop(Iop_Add64, mkexpr(d2), b2 != 0 ? get_gpr_dw0(b2) : + mkU64(0))); + + mnm = irgen(r1, m3, op2addr); + + if (UNLIKELY(vex_traceflags & VEX_TRACE_FE)) + s390_disasm(ENC4(XMNM, GPR, CABM, SDXB), S390_XMNM_CAB, mnm, m3, r1, m3, + dh2, dl2, 0, b2); +} + static void s390_format_RSY_RDRM(const HChar *(*irgen)(UChar r1, IRTemp op2addr), UChar r1, UChar m3, UChar b2, UShort dl2, UChar dh2) @@ -22121,7 +22152,7 @@ s390_decode_6byte_and_irgen(const UChar *bytes) RSY_r3(ovl), RSY_b2(ovl), RSY_dl2(ovl), RSY_dh2(ovl)); goto ok; - case 0xeb0000000023ULL: s390_format_RSY_RURD(s390_irgen_CLT, RSY_r1(ovl), + case 0xeb0000000023ULL: s390_format_RSY_R0RD(s390_irgen_CLT, RSY_r1(ovl), RSY_r3(ovl), RSY_b2(ovl), RSY_dl2(ovl), RSY_dh2(ovl)); goto ok; @@ -22134,7 +22165,7 @@ s390_decode_6byte_and_irgen(const UChar *bytes) RSY_r3(ovl), RSY_b2(ovl), RSY_dl2(ovl), RSY_dh2(ovl)); goto ok; - case 0xeb000000002bULL: s390_format_RSY_RURD(s390_irgen_CLGT, RSY_r1(ovl), + case 0xeb000000002bULL: s390_format_RSY_R0RD(s390_irgen_CLGT, RSY_r1(ovl), RSY_r3(ovl), RSY_b2(ovl), RSY_dl2(ovl), RSY_dh2(ovl)); goto ok; @@ -22390,22 +22421,22 @@ s390_decode_6byte_and_irgen(const UChar *bytes) RIE_RRPU_r2(ovl), RIE_RRPU_i4(ovl), RIE_RRPU_m3(ovl)); goto ok; - case 0xec0000000070ULL: s390_format_RIEv1(s390_irgen_CGIT, - RIEv1_r1(ovl), - RIEv1_i2(ovl), - RIEv1_m3(ovl)); goto ok; - case 0xec0000000071ULL: s390_format_RIEv1(s390_irgen_CLGIT, - RIEv1_r1(ovl), - RIEv1_i2(ovl), - RIEv1_m3(ovl)); goto ok; - case 0xec0000000072ULL: s390_format_RIEv1(s390_irgen_CIT, - RIEv1_r1(ovl), - RIEv1_i2(ovl), - RIEv1_m3(ovl)); goto ok; - case 0xec0000000073ULL: s390_format_RIEv1(s390_irgen_CLFIT, - RIEv1_r1(ovl), - RIEv1_i2(ovl), - RIEv1_m3(ovl)); goto ok; + case 0xec0000000070ULL: s390_format_R0IU(s390_irgen_CGIT, + RIE_R0xU_r1(ovl), + RIE_R0xU_i2(ovl), + RIE_R0xU_m3(ovl)); goto ok; + case 0xec0000000071ULL: s390_format_R0UU(s390_irgen_CLGIT, + RIE_R0xU_r1(ovl), + RIE_R0xU_i2(ovl), + RIE_R0xU_m3(ovl)); goto ok; + case 0xec0000000072ULL: s390_format_R0IU(s390_irgen_CIT, + RIE_R0xU_r1(ovl), + RIE_R0xU_i2(ovl), + RIE_R0xU_m3(ovl)); goto ok; + case 0xec0000000073ULL: s390_format_R0UU(s390_irgen_CLFIT, + RIE_R0xU_r1(ovl), + RIE_R0xU_i2(ovl), + RIE_R0xU_m3(ovl)); goto ok; case 0xec0000000076ULL: s390_format_RIE_RRPU(s390_irgen_CRJ, RIE_RRPU_r1(ovl), RIE_RRPU_r2(ovl), diff --git a/VEX/priv/s390_disasm.c b/VEX/priv/s390_disasm.c index 77f7bd7e8b..b4ff13c23d 100644 --- a/VEX/priv/s390_disasm.c +++ b/VEX/priv/s390_disasm.c @@ -124,8 +124,10 @@ cab_operand(const HChar *base, UInt mask) *to = *from; } /* strcat(buf, suffix); */ - for (from = suffix[mask >> 1]; *from; ++from, ++to) { - *to = *from; + if (! (mask & 0x1)) { + for (from = suffix[mask >> 1]; *from; ++from, ++to) { + *to = *from; + } } *to = '\0'; @@ -424,7 +426,7 @@ s390_disasm(UInt command, ...) break; case S390_ARG_INT: - p += vex_sprintf(p, "%d", (Int)(va_arg(args, UInt))); + p += vex_sprintf(p, "%d", va_arg(args, Int)); break; case S390_ARG_PCREL: { @@ -478,8 +480,8 @@ s390_disasm(UInt command, ...) case S390_ARG_CABM: { UInt mask; - mask = va_arg(args, UInt) & 0xE; - if (mask == 0 || mask == 14) { + mask = va_arg(args, UInt); + if (mask == 0 || mask == 14 || (mask & 0x1)) { p += vex_sprintf(p, ",%u", mask); } break; |
From: Andreas A. <ar...@so...> - 2024-12-04 16:06:54
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=5604e0af1107dacc8344484c91f18c66fb22efbe commit 5604e0af1107dacc8344484c91f18c66fb22efbe Author: Florian Krohm <fl...@ei...> Date: Wed Dec 4 16:53:17 2024 +0100 Bug 495817 - s390x: Disassemble cksm, mvcl, and clcl There is no output from the disassembler for cksm, mvcl, and clcl. Fix this. Diff: --- VEX/priv/guest_s390_toIR.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/VEX/priv/guest_s390_toIR.c b/VEX/priv/guest_s390_toIR.c index b0468cdc8d..7f077efd23 100644 --- a/VEX/priv/guest_s390_toIR.c +++ b/VEX/priv/guest_s390_toIR.c @@ -19878,10 +19878,10 @@ s390_decode_2byte_and_irgen(const UChar *bytes) case 0x0c: /* BASSM */ goto unimplemented; case 0x0d: s390_format_RR_RR(s390_irgen_BASR, RR_r1(ovl), RR_r2(ovl)); goto ok; - case 0x0e: s390_format_RR(s390_irgen_MVCL, RR_r1(ovl), RR_r2(ovl)); - goto ok; - case 0x0f: s390_format_RR(s390_irgen_CLCL, RR_r1(ovl), RR_r2(ovl)); - goto ok; + case 0x0e: s390_format_RR_RR(s390_irgen_MVCL, RR_r1(ovl), RR_r2(ovl)); + goto ok; + case 0x0f: s390_format_RR_RR(s390_irgen_CLCL, RR_r1(ovl), RR_r2(ovl)); + goto ok; case 0x10: s390_format_RR_RR(s390_irgen_LPR, RR_r1(ovl), RR_r2(ovl)); goto ok; case 0x11: s390_format_RR_RR(s390_irgen_LNR, RR_r1(ovl), RR_r2(ovl)); @@ -20085,8 +20085,8 @@ s390_decode_4byte_and_irgen(const UChar *bytes) case 0xb23b: /* RCHP */ goto unimplemented; case 0xb23c: /* SCHM */ goto unimplemented; case 0xb240: /* BAKR */ goto unimplemented; - case 0xb241: s390_format_RRE(s390_irgen_CKSM, RRE_r1(ovl), - RRE_r2(ovl)); goto ok; + case 0xb241: s390_format_RRE_RR(s390_irgen_CKSM, RRE_r1(ovl), + RRE_r2(ovl)); goto ok; case 0xb244: /* SQDR */ goto unimplemented; case 0xb245: /* SQER */ goto unimplemented; case 0xb246: /* STURA */ goto unimplemented; |
From: Andreas A. <ar...@so...> - 2024-12-04 16:06:50
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=1e694434a5cd2a0352e97f872ebd6922129c0282 commit 1e694434a5cd2a0352e97f872ebd6922129c0282 Author: Florian Krohm <fl...@ei...> Date: Wed Dec 4 16:53:17 2024 +0100 Bug 495816 - s390x: Fix disassembler segfault for C[G]RT and CL[G]RT The function s390_format_RRF_U0RR() is called with one of the following xmnm_kind parameters: S390_XMNM_CAB when constructing IR for C[G]RT or CL[G]RT S390_XMNM_LOCFHR for LOCFHR S390_XMNM_LOCGR for LOCGR S390_XMNM_LOCR for LOCR In all cases it invokes the disassembler without providing a mnemonic: if (UNLIKELY(vex_traceflags & VEX_TRACE_FE)) s390_disasm(ENC3(XMNM, GPR, GPR), xmnm_kind, m3, r1, r2); But in the first case s390_disasm() processes these arguments as if there was one: case S390_XMNM_CAB: mnm = va_arg(args, HChar *); // <--- m3 mask = va_arg(args, UInt); // <--- r1 p += vex_sprintf(p, "%s", mnemonic(cab_operand(mnm, mask))); Thus, m3 is interpreted as a string which then causes the segfault. Fix this by (1) replacing all of S390_XMNM_LOC* and S390_XMNM_STOC* by S390_XMNM_CLS, (2) passing down the mnemonic to s390_disasm, and (3) changing function cls_operand() to be symmetric with cab_operand() by also taking in the base mnemonic. Apart from s390_format_RRF_U0RR(), further "load/store on condition" instructions are handled via s390_format_RIE_RUPIX() and s390_format_RSY_RDRM(). Adjust these functions accordingly as well. Diff: --- VEX/priv/guest_s390_toIR.c | 52 ++++++++++++++++++++-------------------------- VEX/priv/s390_disasm.c | 39 +++++----------------------------- VEX/priv/s390_disasm.h | 15 ++----------- 3 files changed, 29 insertions(+), 77 deletions(-) diff --git a/VEX/priv/guest_s390_toIR.c b/VEX/priv/guest_s390_toIR.c index 2e0f6bb28d..b0468cdc8d 100644 --- a/VEX/priv/guest_s390_toIR.c +++ b/VEX/priv/guest_s390_toIR.c @@ -2843,12 +2843,13 @@ s390_format_RIE_RUPI(const HChar *(*irgen)(UChar r1, UChar m3, UShort i4, static void s390_format_RIE_RUPIX(const HChar *(*irgen)(UChar r1, UChar m3, UShort i2), - UChar r1, UChar m3, UShort i2, Int xmnm_kind) + UChar r1, UChar m3, UShort i2) { - irgen(r1, m3, i2); + const HChar *mnm = irgen(r1, m3, i2); if (UNLIKELY(vex_traceflags & VEX_TRACE_FE)) - s390_disasm(ENC3(XMNM, GPR, INT), xmnm_kind, m3, r1, (Int)(Short)i2); + s390_disasm(ENC3(XMNM, GPR, INT), S390_XMNM_CLS, mnm, m3, r1, + (Int)(Short)i2); } static void @@ -3106,10 +3107,10 @@ static void s390_format_RRF_U0RR(const HChar *(*irgen)(UChar m3, UChar r1, UChar r2), UChar m3, UChar r1, UChar r2, Int xmnm_kind) { - irgen(m3, r1, r2); + const HChar *mnm = irgen(m3, r1, r2); if (UNLIKELY(vex_traceflags & VEX_TRACE_FE)) - s390_disasm(ENC3(XMNM, GPR, GPR), xmnm_kind, m3, r1, r2); + s390_disasm(ENC3(XMNM, GPR, GPR), xmnm_kind, mnm, m3, r1, r2); } static void @@ -3334,8 +3335,7 @@ s390_format_RSY_RURD(const HChar *(*irgen)(UChar r1, UChar r3, IRTemp op2addr), static void s390_format_RSY_RDRM(const HChar *(*irgen)(UChar r1, IRTemp op2addr), - UChar r1, UChar m3, UChar b2, UShort dl2, UChar dh2, - Int xmnm_kind) + UChar r1, UChar m3, UChar b2, UShort dl2, UChar dh2) { IRTemp op2addr = newTemp(Ity_I64); IRTemp d2 = newTemp(Ity_I64); @@ -3346,12 +3346,13 @@ s390_format_RSY_RDRM(const HChar *(*irgen)(UChar r1, IRTemp op2addr), assign(op2addr, binop(Iop_Add64, mkexpr(d2), b2 != 0 ? get_gpr_dw0(b2) : mkU64(0))); - irgen(r1, op2addr); + const HChar *mnm = irgen(r1, op2addr); vassert(dis_res->whatNext == Dis_Continue); if (UNLIKELY(vex_traceflags & VEX_TRACE_FE)) - s390_disasm(ENC3(XMNM, GPR, SDXB), xmnm_kind, m3, r1, dh2, dl2, 0, b2); + s390_disasm(ENC3(XMNM, GPR, SDXB), S390_XMNM_CLS, mnm, m3, r1, + dh2, dl2, 0, b2); } static void @@ -20763,12 +20764,12 @@ s390_decode_4byte_and_irgen(const UChar *bytes) RRE_r2(ovl)); goto ok; case 0xb9e0: s390_format_RRF_U0RR(s390_irgen_LOCFHR, RRF3_r3(ovl), RRF3_r1(ovl), RRF3_r2(ovl), - S390_XMNM_LOCFHR); goto ok; + S390_XMNM_CLS); goto ok; case 0xb9e1: s390_format_RRFa_U0RR(s390_irgen_POPCNT, RRF3_r3(ovl), RRF3_r1(ovl), RRF3_r2(ovl)); goto ok; case 0xb9e2: s390_format_RRF_U0RR(s390_irgen_LOCGR, RRF3_r3(ovl), RRF3_r1(ovl), RRF3_r2(ovl), - S390_XMNM_LOCGR); goto ok; + S390_XMNM_CLS); goto ok; case 0xb9e3: s390_format_RRF_RURR(s390_irgen_SELGR, RRF4_r3(ovl), RRF4_m4(ovl), RRF4_r1(ovl), RRF4_r2(ovl)); goto ok; @@ -20807,7 +20808,7 @@ s390_decode_4byte_and_irgen(const UChar *bytes) RRF4_r2(ovl)); goto ok; case 0xb9f2: s390_format_RRF_U0RR(s390_irgen_LOCR, RRF3_r3(ovl), RRF3_r1(ovl), RRF3_r2(ovl), - S390_XMNM_LOCR); goto ok; + S390_XMNM_CLS); goto ok; case 0xb9f4: s390_format_RRF_R0RR2(s390_irgen_NRK, RRF4_r3(ovl), RRF4_r1(ovl), RRF4_r2(ovl)); goto ok; @@ -22251,23 +22252,19 @@ s390_decode_6byte_and_irgen(const UChar *bytes) case 0xeb00000000e0ULL: s390_format_RSY_RDRM(s390_irgen_LOCFH, RSY_r1(ovl), RSY_r3(ovl), RSY_b2(ovl), RSY_dl2(ovl), - RSY_dh2(ovl), - S390_XMNM_LOCFH); goto ok; + RSY_dh2(ovl)); goto ok; case 0xeb00000000e1ULL: s390_format_RSY_RDRM(s390_irgen_STOCFH, RSY_r1(ovl), RSY_r3(ovl), RSY_b2(ovl), RSY_dl2(ovl), - RSY_dh2(ovl), - S390_XMNM_STOCFH); goto ok; + RSY_dh2(ovl)); goto ok; case 0xeb00000000e2ULL: s390_format_RSY_RDRM(s390_irgen_LOCG, RSY_r1(ovl), RSY_r3(ovl), RSY_b2(ovl), RSY_dl2(ovl), - RSY_dh2(ovl), - S390_XMNM_LOCG); goto ok; + RSY_dh2(ovl)); goto ok; case 0xeb00000000e3ULL: s390_format_RSY_RDRM(s390_irgen_STOCG, RSY_r1(ovl), RSY_r3(ovl), RSY_b2(ovl), RSY_dl2(ovl), - RSY_dh2(ovl), - S390_XMNM_STOCG); goto ok; + RSY_dh2(ovl)); goto ok; case 0xeb00000000e4ULL: s390_format_RSY_RRRD(s390_irgen_LANG, RSY_r1(ovl), RSY_r3(ovl), RSY_b2(ovl), RSY_dl2(ovl), @@ -22291,13 +22288,11 @@ s390_decode_6byte_and_irgen(const UChar *bytes) case 0xeb00000000f2ULL: s390_format_RSY_RDRM(s390_irgen_LOC, RSY_r1(ovl), RSY_r3(ovl), RSY_b2(ovl), RSY_dl2(ovl), - RSY_dh2(ovl), S390_XMNM_LOC); - goto ok; + RSY_dh2(ovl)); goto ok; case 0xeb00000000f3ULL: s390_format_RSY_RDRM(s390_irgen_STOC, RSY_r1(ovl), RSY_r3(ovl), RSY_b2(ovl), RSY_dl2(ovl), - RSY_dh2(ovl), - S390_XMNM_STOC); goto ok; + RSY_dh2(ovl)); goto ok; case 0xeb00000000f4ULL: s390_format_RSY_RRRD(s390_irgen_LAN, RSY_r1(ovl), RSY_r3(ovl), RSY_b2(ovl), RSY_dl2(ovl), @@ -22321,8 +22316,7 @@ s390_decode_6byte_and_irgen(const UChar *bytes) case 0xec0000000042ULL: s390_format_RIE_RUPIX(s390_irgen_LOCHI, RIEv3_r1(ovl), RIEv3_m3(ovl), - RIEv3_i4(ovl), - S390_XMNM_LOCHI); goto ok; + RIEv3_i4(ovl)); goto ok; case 0xec0000000044ULL: s390_format_RIE_RRP(s390_irgen_BRXHG, RIE_r1(ovl), RIE_r3(ovl), RIE_i2(ovl)); goto ok; @@ -22332,13 +22326,11 @@ s390_decode_6byte_and_irgen(const UChar *bytes) case 0xec0000000046ULL: s390_format_RIE_RUPIX(s390_irgen_LOCGHI, RIEv3_r1(ovl), RIEv3_m3(ovl), - RIEv3_i4(ovl), - S390_XMNM_LOCGHI); goto ok; + RIEv3_i4(ovl)); goto ok; case 0xec000000004eULL: s390_format_RIE_RUPIX(s390_irgen_LOCHHI, RIEv3_r1(ovl), RIEv3_m3(ovl), - RIEv3_i4(ovl), - S390_XMNM_LOCHHI); goto ok; + RIEv3_i4(ovl)); goto ok; case 0xec0000000051ULL: s390_format_RIE_RRUUU(s390_irgen_RISBLG, RIE_RRUUU_r1(ovl), RIE_RRUUU_r2(ovl), diff --git a/VEX/priv/s390_disasm.c b/VEX/priv/s390_disasm.c index a1cf61bb4d..67b5c2bc3c 100644 --- a/VEX/priv/s390_disasm.c +++ b/VEX/priv/s390_disasm.c @@ -239,27 +239,8 @@ brcl_operand(UInt m1) /* Return the special mnemonic for a conditional load/store opcode */ static const HChar * -cls_operand(Int kind, UInt mask) +cls_operand(const HChar *prefix, UInt mask) { - const HChar *prefix; - - switch (kind) { - case S390_XMNM_LOCR: prefix = "locr"; break; - case S390_XMNM_LOCGR: prefix = "locgr"; break; - case S390_XMNM_LOC: prefix = "loc"; break; - case S390_XMNM_LOCG: prefix = "locg"; break; - case S390_XMNM_STOC: prefix = "stoc"; break; - case S390_XMNM_STOCG: prefix = "stocg"; break; - case S390_XMNM_STOCFH: prefix = "stocfh"; break; - case S390_XMNM_LOCFH: prefix = "locfh"; break; - case S390_XMNM_LOCFHR: prefix = "locfhr"; break; - case S390_XMNM_LOCHI: prefix = "lochi"; break; - case S390_XMNM_LOCGHI: prefix = "locghi"; break; - case S390_XMNM_LOCHHI: prefix = "lochhi"; break; - default: - vpanic("cls_operand"); - } - return construct_mnemonic(prefix, "", mask); } @@ -415,25 +396,15 @@ s390_disasm(UInt command, ...) p += vex_sprintf(p, "%s", mnemonic(cab_operand(mnm, mask))); break; - case S390_XMNM_LOCR: - case S390_XMNM_LOCGR: - case S390_XMNM_LOC: - case S390_XMNM_LOCG: - case S390_XMNM_STOC: - case S390_XMNM_STOCG: - case S390_XMNM_STOCFH: - case S390_XMNM_LOCFH: - case S390_XMNM_LOCFHR: - case S390_XMNM_LOCHI: - case S390_XMNM_LOCGHI: - case S390_XMNM_LOCHHI: + case S390_XMNM_CLS: + mnm = va_arg(args, HChar *); mask = va_arg(args, UInt); - mnm = cls_operand(kind, mask); - p += vex_sprintf(p, "%s", mnemonic(mnm)); + p += vex_sprintf(p, "%s", mnemonic(cls_operand(mnm, mask))); /* There are no special opcodes when mask == 0 or 15. In that case the integer mask is appended as the final operand */ if (mask == 0 || mask == 15) mask_suffix = mask; break; + case S390_XMNM_BIC: mask = va_arg(args, UInt); if (mask == 0) { diff --git a/VEX/priv/s390_disasm.h b/VEX/priv/s390_disasm.h index eec41f8ac5..d6b2fbc8eb 100644 --- a/VEX/priv/s390_disasm.h +++ b/VEX/priv/s390_disasm.h @@ -80,19 +80,8 @@ enum { S390_XMNM_BC = 2, S390_XMNM_BRC = 3, S390_XMNM_BRCL = 4, - S390_XMNM_LOCR = 5, - S390_XMNM_LOCGR = 6, - S390_XMNM_LOC = 7, - S390_XMNM_LOCG = 8, - S390_XMNM_STOC = 9, - S390_XMNM_STOCG = 10, - S390_XMNM_STOCFH = 11, - S390_XMNM_LOCFH = 12, - S390_XMNM_LOCFHR = 13, - S390_XMNM_LOCHI = 14, - S390_XMNM_LOCGHI = 15, - S390_XMNM_LOCHHI = 16, - S390_XMNM_BIC = 17 + S390_XMNM_CLS = 5, + S390_XMNM_BIC = 6, }; void s390_disasm(UInt command, ...); |
From: Andreas A. <ar...@so...> - 2024-12-04 16:06:39
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=b585c6bdba0c5729e79fbc37c15abb6c15cff1af commit b585c6bdba0c5729e79fbc37c15abb6c15cff1af Author: Florian Krohm <fl...@ei...> Date: Wed Dec 4 16:53:17 2024 +0100 s390x: Add `--check-formats' flag to s390-check-opcodes.pl Enhance the script s390-check-opcodes.pl: Add the command line option `--check-formats' to print mismatches in the opcode formats between guest_s390_toIR.c and s390-opc.txt. Diff: --- auxprogs/s390-check-opcodes.pl | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/auxprogs/s390-check-opcodes.pl b/auxprogs/s390-check-opcodes.pl index 5262a74d8f..52325beaa1 100755 --- a/auxprogs/s390-check-opcodes.pl +++ b/auxprogs/s390-check-opcodes.pl @@ -2,6 +2,7 @@ use strict; use warnings; +use Getopt::Long; #------------------------------------------------------------------ # This script assists in updating s390-opcodes.csv @@ -12,11 +13,16 @@ use warnings; # - identify opcodes that are implemented in guest_s390_toIR.c # but have an out-of-date status in the CSV file. #------------------------------------------------------------------ -my $num_arg = $#ARGV + 1; - my $csv_file; my $opc_file; my $toir_file; +my $check_formats = 0; +my $usage = "usage: s390-check-opcodes [--check-formats] s390-opcodes.csv " + . "s390-opc.txt guest_s390_toIR.c\n"; + +GetOptions("check-formats" => \$check_formats) || die $usage; + +my $num_arg = $#ARGV + 1; if ($num_arg == 0) { my $cwd = `pwd`; @@ -29,14 +35,16 @@ if ($num_arg == 0) { $opc_file = $ARGV[1]; $toir_file = $ARGV[2]; } else { - die "usage: s390-check-opcodes s390-opcodes.csv s390-opc.txt guest_s390_toIR.c\n"; + die $usage; } my %opc_desc = (); +my %opc_format = (); my %csv_desc = (); my %csv_implemented = (); my %toir_implemented = (); my %toir_decoded = (); +my %toir_format = (); my %known_arch = map {($_ => 1)} qw(g5 z900 z990 z9-109 z9-ec z10 z196 zEC12 z13 arch12 arch13 arch14); @@ -261,6 +269,9 @@ while (my $line = <OPC>) { $opc_desc{$mnemonic} = $description; } + if (! exists $opc_format{$mnemonic}) { + $opc_format{$mnemonic} = $format; + } if ($description =~ /,/) { print "warning: description of $mnemonic contains comma\n"; } @@ -342,6 +353,9 @@ while (my $line = <TOIR>) { my $mnemonic = lc $1; $toir_implemented{$mnemonic} = 1; } + if ($line =~ /^..*s390_format_([A-Z_]+)[ ]*\([ ]*s390_irgen_([A-Z]+)/) { + $toir_format{lc $2} = $1; + } } close(TOIR); @@ -399,5 +413,22 @@ foreach my $opc (keys %opc_desc) { } } +#---------------------------------------------------- +# 5) Cross-check opcode formats +#---------------------------------------------------- +if ($check_formats) { + foreach my $opc (keys %toir_format) { + if (! exists $opc_format{$opc}) { + print "*** format $toir_format{$opc} does not exist in s390-opc.txt\n"; + } else { + if ($opc_format{$opc} ne $toir_format{$opc}) { + print "*** format for opcode $opc differs:\n"; + print " binutils: $opc_format{$opc}\n"; + print " toIR: $toir_format{$opc}\n"; + } + } + } +} + print "there are " . int(keys %toir_implemented) . " implemented opcodes\n"; exit 0 |
From: Florian K. <fl...@ei...> - 2024-12-02 21:00:20
|
The patch below removes artefacts from failing regression tests. Specifically, "make distclean" and "make maintainer-clean" removes them. Previously they were not removed which was a surprise. post_regtest_checks does not appear to create any files that ought to be cleaned up. Thanks to Paul for pointing me to the file to change. Florian diff --git a/Makefile.am b/Makefile.am index b3e5be5f4..b584cb34b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -139,6 +139,14 @@ clean-local: rm -rf $(inplacedir) include/vgversion.h find . -name '*.vgtest.log' -print0 | xargs -r -0 rm find . -name '*.vgtest.trs' -print0 | xargs -r -0 rm + find . -name '*.stdout.out' -print0 | xargs -r -0 rm + find . -name '*.stderr.out' -print0 | xargs -r -0 rm + find . -name '*.stdoutB.out' -print0 | xargs -r -0 rm + find . -name '*.stderrB.out' -print0 | xargs -r -0 rm + find . -name '*.stdout.diff' -print0 | xargs -r -0 rm + find . -name '*.stderr.diff' -print0 | xargs -r -0 rm + find . -name '*.stdoutB.diff' -print0 | xargs -r -0 rm + find . -name '*.stderrB.diff' -print0 | xargs -r -0 rm find . -name test-suite.log -print0 | xargs -r -0 rm rm -f test-suite-overall.log |
From: Paul F. <pa...@so...> - 2024-12-01 20:14:06
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=9ec2c7e2e960c9cfaaeb13678f81c1d685d7e18a commit 9ec2c7e2e960c9cfaaeb13678f81c1d685d7e18a Author: Paul Floyd <pj...@wa...> Date: Sun Dec 1 21:13:18 2024 +0100 Fix typo in FAQ. Diff: --- docs/xml/FAQ.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/xml/FAQ.xml b/docs/xml/FAQ.xml index 4179a62ac1..9421aa0ffa 100644 --- a/docs/xml/FAQ.xml +++ b/docs/xml/FAQ.xml @@ -512,7 +512,7 @@ int main(void) </listitem> <listitem> <para>Do not link with tcmalloc for the builds that you use for - Memecheck testing.</para> + Memcheck testing.</para> </listitem> </itemizedlist> </para> |
From: Mark W. <ma...@kl...> - 2024-11-26 22:38:06
|
Hi developers and packagers, I created a VALGRIND_3_24_BRANCH where I hope to put commits which I think distros should pick up. The idea would be to first commit to the main branch. Then git cherry-pick -x the commit to the branch (updating NEWS to list all bugs fixed on the branch). The patches I put on the VALGRIND_3_24_BRANCH are to fix a few off-by-one writes in vgdb, fix some test results, cleanup some C23 issues (just in case people test the build with a GCC15 pre-release), and add support for some linux syscalls (landlock_create_ruleset, landlock_add_rule, landlock_restrict_self, open_tree, move_mount, fsopen, fsconfig, fsmount, fspick). I don't intent to do a full 3.24.1 release, but I hope distros will pick up these fixes. I have also added them to the Fedora package. Please let me know if you find other fixes on trunk you believe really should be backported to 3.24.0. Thanks, Mark Set version to 3.24.1.GIT Prepare NEWS for branch 3.24 fixes vgdb.c (fork_and_exec_valgrind): Fix off-by-one error write vgdb.c (fork_and_exec_valgrind): Fix another off-by-one error write Add exp and supp patterns for missing main frame for ppc64le helgrind/tests/tc17_sembar.c: Remove bool typedef drd/tests/swapcontext.c: Rename typedef struct thread_local to threadlocal none/tests/bug234814.c: sa_handler take an int as argument Add open_tree, move_mount, fsopen, fsconfig, fsmount, fspick linux syswraps regtest: add a fdleak filter for write on write on linux arm64 Add additional exp-ppc64le files to EXTRA_DIST Add support for landlock_create_ruleset (444), landlock_add_rule (445) and landlock_restrict_self (446) syscalls |
From: Mark W. <ma...@so...> - 2024-11-26 21:15:36
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=459fa5b82df0d07cf871fc7359a060410052b82e commit 459fa5b82df0d07cf871fc7359a060410052b82e 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; | ^~~~~~~ (cherry picked from commit 932bf2c027579c8d933b57ed80bb5842b390bdb3) 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...@so...> - 2024-11-26 21:15:36
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=3d72dd780be97bd19331403da60908f295712fc7 commit 3d72dd780be97bd19331403da60908f295712fc7 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...> (cherry picked from commit b1453546fe7396e7d4b4b2fc8ec7e64b71d18611) Diff: --- NEWS | 2 ++ 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, 138 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 8362e1d2df..68cd0c6fa6 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ Branch 3.24 The following bugs have been fixed or resolved on this branch. +489913 WARNING: unhandled amd64-linux syscall: 444 (landlock_create_ruleset) + To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX where XXXXXX is the bug number as listed above. 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 d326fdb9ee..65f64af99b 100644 --- a/coregrind/m_syswrap/syswrap-arm-linux.c +++ b/coregrind/m_syswrap/syswrap-arm-linux.c @@ -1062,6 +1062,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 eec8388224..70ae837a94 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: Mark W. <ma...@so...> - 2024-11-26 21:15:36
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=349b57d3a8c8d2df23128d4b03eca91b629629e1 commit 349b57d3a8c8d2df23128d4b03eca91b629629e1 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 (cherry picked from commit 4044bcea0427853fc44a3d02a0fc0b2a81935452) Diff: --- NEWS | 1 + 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 +- 13 files changed, 215 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 68cd0c6fa6..7f1334aa0f 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,7 @@ Branch 3.24 The following bugs have been fixed or resolved on this branch. 489913 WARNING: unhandled amd64-linux syscall: 444 (landlock_create_ruleset) +494246 syscall fsopen not wrapped To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX 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 65f64af99b..108e1f91e5 100644 --- a/coregrind/m_syswrap/syswrap-arm-linux.c +++ b/coregrind/m_syswrap/syswrap-arm-linux.c @@ -1052,7 +1052,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 70ae837a94..57672f1671 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -13836,6 +13836,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: Mark W. <ma...@so...> - 2024-11-26 21:15:36
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=53d667789d369042b1fe45f72102ecb5c16e5d12 commit 53d667789d369042b1fe45f72102ecb5c16e5d12 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; | ^ (cherry picked from commit 8f6cef269b91739f6a2e7f3b4b1e0a429db3e748) 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-26 21:15:36
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=42f196574aebea451c7e4138b476e042ba302745 commit 42f196574aebea451c7e4138b476e042ba302745 Author: Paul Floyd <pj...@wa...> Date: Sun Nov 24 08:10:51 2024 +0100 Add additional exp-ppc64le files to EXTRA_DIST (cherry picked from commit 7241959ebb88a588eebe5a9fd35d1642db71474b) 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-26 21:15:26
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=c08e155fdf6641a569053b3a70c52bfae09dd34c commit c08e155fdf6641a569053b3a70c52bfae09dd34c 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; | ^~~~~~~~~~~~~~ (cherry picked from commit 907b985725805f1537396a6d76539bf490cc6c7e) 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-26 21:15:06
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=ba15b8fe7d6fabfb73424a616de18a752a56430a commit ba15b8fe7d6fabfb73424a616de18a752a56430a 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" (cherry picked from commit e6960c2e41b103ab8d393cbe13dc6473fb89bffc) Diff: --- none/tests/fdleak_cmsg_supp.supp | 47 ++++++++ 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, 431 insertions(+) diff --git a/none/tests/fdleak_cmsg_supp.supp b/none/tests/fdleak_cmsg_supp.supp index 92fbacabdb..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,3 +49,43 @@ fun:client fun:main } +{ + sup6-ppc64le + CoreError:FdNotClosed + fun:socket + fun:client + #fun:main +} +{ + sup7 + CoreError:FdNotClosed + fun:_so_socket + fun:__xnet_socket + fun:client + fun:main +} +{ + sup8 + CoreError:FdNotClosed + fun:__so_recvmsg + fun:__xnet_recvmsg + fun:client + fun:main +} +{ + sup9 + CoreError:FdNotClosed + fun:_so_socket + fun:__xnet_socket + fun:server + fun:main +} +{ + sup10 + CoreError:FdNotClosed + fun:__so_accept + fun:accept + fun:server + fun:main +} + 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: Mark W. <ma...@so...> - 2024-11-26 21:14:55
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=7e79bb6e6b80eb43138cbbb64737433f9e036cd4 commit 7e79bb6e6b80eb43138cbbb64737433f9e036cd4 Author: Paul Floyd <pj...@wa...> Date: Thu Nov 21 08:44:04 2024 +0100 regtest: add a fdleak filter for write on write on linux arm64 (cherry picked from commit 9150b3c7cfad2fdbeb7cf707175c359ee12d8f75) Diff: --- none/tests/filter_fdleak | 2 ++ 1 file changed, 2 insertions(+) diff --git a/none/tests/filter_fdleak b/none/tests/filter_fdleak index d26937bccd..72923aa730 100755 --- a/none/tests/filter_fdleak +++ b/none/tests/filter_fdleak @@ -19,6 +19,8 @@ perl -p -e 's/socket\.c:[1-9][0-9]*/in \/...libc.../' | # arm systems substitute open for creat perl -p -e 's/open \(open64\.c:[1-9][0-9]*\)/creat (in \/...libc...)/' | perl -p -e "s/: open \(/: creat (/" | +# arm64 write resolved to file:line with debuginfo +perl -p -e "s/write\.c:[1-9][0-9]*/in \/...libc.../" | # FreeBSD specific fdleak filters perl -p -e 's/ _close / close /;s/ _openat / creat /;s/internet/AF_INET socket 4: 127.0.0.1:... <-> 127.0.0.1:.../' | |
From: Mark W. <ma...@so...> - 2024-11-26 21:14:55
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=8b08da73cf3d72439c4f750c96ed2f088ef1bbec commit 8b08da73cf3d72439c4f750c96ed2f088ef1bbec Author: Mark Wielaard <ma...@kl...> Date: Tue Nov 12 13:34:09 2024 +0100 vgdb.c (fork_and_exec_valgrind): Fix another off-by-one error write commit 646978d9adc5 ("vgdb: Handle EINTR and EAGAIN more consistently") introduced another off-by-one issue trying to write back the error from child to parent. Instead of +1 it should have been +written (which initially is zero). This is when the child needs to do a chdir and that chdir fails. If that happens the parent would have gotten the wrong error code. (cherry picked from commit 747ca4eb5fed5dd58a14391a997bb9e658e3b1c8) Diff: --- coregrind/vgdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coregrind/vgdb.c b/coregrind/vgdb.c index 112f23fe6b..cc945c8dfa 100644 --- a/coregrind/vgdb.c +++ b/coregrind/vgdb.c @@ -1289,7 +1289,7 @@ int fork_and_exec_valgrind (int argc, char **argv, const char *working_dir, // We try to write the result to the parent, but always exit. size_t written = 0; while (written < sizeof (int)) { - int nrw = write (pipefd[1], ((char *)&err) + 1, + int nrw = write (pipefd[1], ((char *)&err) + written, sizeof (int) - written); if (nrw == -1) { if (errno == EINTR || errno == EAGAIN) |
From: Mark W. <ma...@so...> - 2024-11-26 21:14:50
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=2cb0bee2d7722b57956f66a0795b5b9106f88afc commit 2cb0bee2d7722b57956f66a0795b5b9106f88afc Author: Mark Wielaard <ma...@kl...> Date: Tue Nov 12 13:23:03 2024 +0100 vgdb.c (fork_and_exec_valgrind): Fix off-by-one error write commit 646978d9adc5 ("vgdb: Handle EINTR and EAGAIN more consistently") introduced an off-by-one issue trying to write back the error from child to parent. Instead of +1 it should have been +written (which initially is zero). This is in an "should never happen" path, so hopefully didn't really cause issues. But if it did happen the parent would have gotten the wrong error code. (cherry picked from commit f4fe5faf3d0f45b3824bbb9070232682df52a582) Diff: --- coregrind/vgdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coregrind/vgdb.c b/coregrind/vgdb.c index 786ead160d..112f23fe6b 100644 --- a/coregrind/vgdb.c +++ b/coregrind/vgdb.c @@ -1368,7 +1368,7 @@ int fork_and_exec_valgrind (int argc, char **argv, const char *working_dir, // We try to write the result to the parent, but always exit. size_t written = 0; while (written < sizeof (int)) { - ssize_t nrw = write (pipefd[1], ((char *) &err) + 1, + ssize_t nrw = write (pipefd[1], ((char *) &err) + written, sizeof (int) - written); if (nrw == -1) { if (errno == EINTR || errno == EAGAIN) |
From: Mark W. <ma...@so...> - 2024-11-26 21:14:39
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=cc09f61e56e90c9d3a0e7231cc69b2a499d1205f commit cc09f61e56e90c9d3a0e7231cc69b2a499d1205f Author: Mark Wielaard <ma...@kl...> Date: Sat Nov 23 02:09:27 2024 +0100 Prepare NEWS for branch 3.24 fixes Diff: --- NEWS | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/NEWS b/NEWS index 49b4647d42..8362e1d2df 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,14 @@ +Branch 3.24 +~~~~~~~~~~~ + +* ==================== FIXED BUGS ==================== + +The following bugs have been fixed or resolved on this branch. + +To see details of a given bug, visit + https://bugs.kde.org/show_bug.cgi?id=XXXXXX +where XXXXXX is the bug number as listed above. + Release 3.24.0 (31 Oct 2024) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
From: Mark W. <ma...@so...> - 2024-11-26 21:14:34
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=33cb8ed5b65ccaaeb6d627ec112ed72833018f77 commit 33cb8ed5b65ccaaeb6d627ec112ed72833018f77 Author: Mark Wielaard <ma...@kl...> Date: Sat Nov 23 02:07:47 2024 +0100 Set version to 3.24.1.GIT Diff: --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 095659ac25..e85ce0a8fb 100755 --- a/configure.ac +++ b/configure.ac @@ -16,9 +16,9 @@ # Do not forget to rerun ./autogen.sh m4_define([v_major_ver], [3]) m4_define([v_minor_ver], [24]) -m4_define([v_micro_ver], [0]) -m4_define([v_suffix_ver], []) -m4_define([v_rel_date], ["31 Oct 2024"]) +m4_define([v_micro_ver], [1]) +m4_define([v_suffix_ver], [GIT]) +m4_define([v_rel_date], ["?? ??? 202?"]) m4_define([v_version], m4_if(v_suffix_ver, [], [v_major_ver.v_minor_ver.v_micro_ver], |