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
(19) |
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
1
(3) |
2
|
3
|
4
|
|
5
(13) |
6
(2) |
7
(5) |
8
(4) |
9
(3) |
10
(4) |
11
(4) |
|
12
(7) |
13
|
14
(1) |
15
|
16
|
17
(2) |
18
|
|
19
|
20
|
21
(3) |
22
(8) |
23
(7) |
24
(5) |
25
(4) |
|
26
(6) |
27
|
28
(9) |
29
|
30
(4) |
31
(5) |
|
|
From: Paul F. <pa...@so...> - 2023-03-05 16:42:16
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=43880cb199e4f467ebeda70b9f6c14b10cd863e5 commit 43880cb199e4f467ebeda70b9f6c14b10cd863e5 Author: Paul Floyd <pj...@wa...> Date: Sun Mar 5 17:41:27 2023 +0100 Linux musl: fix code refactor that missed one usage Diff: --- coregrind/m_replacemalloc/vg_replace_malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index d123890a8a..18cbb7f88e 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -1939,7 +1939,7 @@ extern int *___errno (void) __attribute__((weak)); #endif #if defined(MUSL_LIBC) -#define VG_ALIGNED_ALLOC_SIZE_ZERO 0 +#define VG_ALIGNED_ALLOC_NO_SIZE_ZERO 0 #else #define VG_ALIGNED_ALLOC_NO_SIZE_ZERO 1 #endif |
|
From: Paul F. <pa...@so...> - 2023-03-05 16:23:48
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=b2ca91d66997653c56468be25b416b81a81f5476 commit b2ca91d66997653c56468be25b416b81a81f5476 Author: Paul Floyd <pj...@wa...> Date: Sun Mar 5 17:22:59 2023 +0100 Darwin regtest: again, forgot to delete errno Setting errno on Darwin not supported on Valgrind. Diff: --- memcheck/tests/darwin/aligned_alloc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/memcheck/tests/darwin/aligned_alloc.c b/memcheck/tests/darwin/aligned_alloc.c index 8d38f593bf..f8d580538f 100644 --- a/memcheck/tests/darwin/aligned_alloc.c +++ b/memcheck/tests/darwin/aligned_alloc.c @@ -9,15 +9,12 @@ int main(void) // zero size p = aligned_alloc(0, 8); assert(p == NULL); - errno = 0; // non multiple of alignment fails on Darwin p = aligned_alloc(8, 25); assert(p == NULL); - errno = 0; // align not power of 2 p = aligned_alloc(40, 160); assert(p == NULL); - errno = 0; // @todo PJF this works standalone // but for some reason it doesn't fail in arena_memalign |
|
From: Paul F. <pa...@so...> - 2023-03-05 16:21:23
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=0fecf3914d52dcc0b783806ab6d4fe9482ad30f8 commit 0fecf3914d52dcc0b783806ab6d4fe9482ad30f8 Author: Paul Floyd <pj...@wa...> Date: Sun Mar 5 17:20:23 2023 +0100 Darwin regtest: remove test that aligned_alloc fails with huge alignment Needs more debugging. Diff: --- coregrind/m_replacemalloc/vg_replace_malloc.c | 4 ++-- memcheck/tests/darwin/aligned_alloc.c | 21 ++++++++++++--------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index cbb9f038e4..d123890a8a 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -1941,7 +1941,7 @@ extern int *___errno (void) __attribute__((weak)); #if defined(MUSL_LIBC) #define VG_ALIGNED_ALLOC_SIZE_ZERO 0 #else -#define VG_ALIGNED_ALLOC_SIZE_ZERO 1 +#define VG_ALIGNED_ALLOC_NO_SIZE_ZERO 1 #endif #if defined (VGO_linux) && !defined(MUSL_LIBC) @@ -1984,7 +1984,7 @@ extern int *___errno (void) __attribute__((weak)); \ MALLOC_TRACE("aligned_alloc(al %llu, size %llu)", \ (ULong)alignment, (ULong)size ); \ - if ((VG_ALIGNED_ALLOC_SIZE_ZERO && (alignment == 0)) \ + if ((VG_ALIGNED_ALLOC_NO_SIZE_ZERO && (alignment == 0)) \ || (VG_ALIGNED_ALLOC_SIZE_MULTIPLE_ALIGN && (size % alignment != 0)) \ || (VG_ALIGNED_ALLOC_ALIGN_POWER_TWO && (alignment & (alignment - 1)) != 0) \ || (VG_ALIGNED_ALLOC_ALIGN_FACTOR_FOUR && (alignment % 4 != 0))) { \ diff --git a/memcheck/tests/darwin/aligned_alloc.c b/memcheck/tests/darwin/aligned_alloc.c index 13b04525a5..8d38f593bf 100644 --- a/memcheck/tests/darwin/aligned_alloc.c +++ b/memcheck/tests/darwin/aligned_alloc.c @@ -1,6 +1,5 @@ #include <stdlib.h> #include <assert.h> -#include <errno.h> int main(void) { @@ -9,19 +8,24 @@ int main(void) // zero size p = aligned_alloc(0, 8); - assert(p == NULL && errno == EINVAL); + assert(p == NULL); errno = 0; // non multiple of alignment fails on Darwin p = aligned_alloc(8, 25); - assert(p == NULL && errno == EINVAL); + assert(p == NULL); errno = 0; // align not power of 2 p = aligned_alloc(40, 160); - assert(p == NULL && errno == EINVAL); + assert(p == NULL); errno = 0; - // the test below causes a segfault with musl 1.2.2 - // apparently it has been + // @todo PJF this works standalone + // but for some reason it doesn't fail in arena_memalign + // and I see + // ==25899== Warning: set address range perms: large range [0x1000, 0x1000000001000) (defined) + + +#if 0 // too big if (sizeof(size_t) == 8) { @@ -30,11 +34,10 @@ int main(void) else { p = NULL; - errno = ENOMEM; } - assert(p == NULL && errno == ENOMEM); - + assert(p == NULL); +#endif } |
|
From: Paul F. <pa...@so...> - 2023-03-05 15:49:57
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=b07d06888720187221660c6b5d54a20f7fcc3112 commit b07d06888720187221660c6b5d54a20f7fcc3112 Author: Paul Floyd <pj...@wa...> Date: Sun Mar 5 16:49:12 2023 +0100 Linux musl: one more iteration for aligned_alloc, assert in wrong place Diff: --- memcheck/tests/linux/aligned_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memcheck/tests/linux/aligned_alloc.c b/memcheck/tests/linux/aligned_alloc.c index 0cffe085b3..6585580d8b 100644 --- a/memcheck/tests/linux/aligned_alloc.c +++ b/memcheck/tests/linux/aligned_alloc.c @@ -35,9 +35,9 @@ int main(void) p = NULL; errno = ENOMEM; } -#endif assert(p == NULL && errno == ENOMEM); #endif +#endif } |
|
From: Paul F. <pa...@so...> - 2023-03-05 15:44:13
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=e99cd3c6a36d0cb250850da8a79cdf5ef85d8401 commit e99cd3c6a36d0cb250850da8a79cdf5ef85d8401 Author: Paul Floyd <pj...@wa...> Date: Sun Mar 5 16:43:25 2023 +0100 Linux musl: corrections for aligned_alloc test Diff: --- memcheck/tests/linux/Makefile.am | 1 + memcheck/tests/linux/aligned_alloc.c | 6 +++--- memcheck/tests/linux/aligned_alloc.vgtest | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/memcheck/tests/linux/Makefile.am b/memcheck/tests/linux/Makefile.am index 895f76ed69..af88e8cb6f 100644 --- a/memcheck/tests/linux/Makefile.am +++ b/memcheck/tests/linux/Makefile.am @@ -38,6 +38,7 @@ EXTRA_DIST = \ memalign.vgtest memalign.stderr.exp check_PROGRAMS = \ + aligned_alloc \ brk \ capget \ check_preadv2_pwritev2 \ diff --git a/memcheck/tests/linux/aligned_alloc.c b/memcheck/tests/linux/aligned_alloc.c index 15955ff845..0cffe085b3 100644 --- a/memcheck/tests/linux/aligned_alloc.c +++ b/memcheck/tests/linux/aligned_alloc.c @@ -11,8 +11,8 @@ int main(void) // zero size p = aligned_alloc(0, 8); - assert(p == NULL && errno == EINVAL); - errno = 0; + assert(p && ((size_t)p % 8U == 0U)); + free(p); // non multiple of alignment passes on FreeBSD p = aligned_alloc(8, 25); assert(p && ((size_t)p % 8U == 0U)); @@ -20,7 +20,7 @@ int main(void) //errno = 0; // align not power of 2 p = aligned_alloc(40, 160); - assert(p == NULL && errno == EINVAL); + assert(p == NULL); errno = 0; // the test below causes a segfault with musl 1.2.2 // apparently it has been fixed in 1.2.3 diff --git a/memcheck/tests/linux/aligned_alloc.vgtest b/memcheck/tests/linux/aligned_alloc.vgtest index 07c1c4faf7..a20bccb007 100644 --- a/memcheck/tests/linux/aligned_alloc.vgtest +++ b/memcheck/tests/linux/aligned_alloc.vgtest @@ -1 +1,2 @@ prog: aligned_alloc +vgopts: -q |
|
From: Paul F. <pa...@so...> - 2023-03-05 15:35:15
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=15fdfa846446d73eb596dbbc138ca40532efa6a5 commit 15fdfa846446d73eb596dbbc138ca40532efa6a5 Author: Paul Floyd <pj...@wa...> Date: Sun Mar 5 16:34:50 2023 +0100 Fix a compiler warning Diff: --- coregrind/m_replacemalloc/vg_replace_malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index c781da5989..cbb9f038e4 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -1984,7 +1984,7 @@ extern int *___errno (void) __attribute__((weak)); \ MALLOC_TRACE("aligned_alloc(al %llu, size %llu)", \ (ULong)alignment, (ULong)size ); \ - if (VG_ALIGNED_ALLOC_SIZE_ZERO && (alignment == 0) \ + if ((VG_ALIGNED_ALLOC_SIZE_ZERO && (alignment == 0)) \ || (VG_ALIGNED_ALLOC_SIZE_MULTIPLE_ALIGN && (size % alignment != 0)) \ || (VG_ALIGNED_ALLOC_ALIGN_POWER_TWO && (alignment & (alignment - 1)) != 0) \ || (VG_ALIGNED_ALLOC_ALIGN_FACTOR_FOUR && (alignment % 4 != 0))) { \ |
|
From: Paul F. <pa...@so...> - 2023-03-05 15:31:19
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=dc8af61b5a6dbf0b3887ff09f194a38e12c5c3cc commit dc8af61b5a6dbf0b3887ff09f194a38e12c5c3cc Author: Paul Floyd <pj...@wa...> Date: Sun Mar 5 16:30:44 2023 +0100 Linux musl: alligned_alloc accepts alignment of zero Diff: --- coregrind/m_replacemalloc/vg_replace_malloc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index b00d33d497..c781da5989 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -1938,6 +1938,11 @@ extern int *___errno (void) __attribute__((weak)); #define VG_ALIGNED_ALLOC_ALIGN_FACTOR_FOUR 0 #endif +#if defined(MUSL_LIBC) +#define VG_ALIGNED_ALLOC_SIZE_ZERO 0 +#else +#define VG_ALIGNED_ALLOC_SIZE_ZERO 1 +#endif #if defined (VGO_linux) && !defined(MUSL_LIBC) @@ -1979,7 +1984,7 @@ extern int *___errno (void) __attribute__((weak)); \ MALLOC_TRACE("aligned_alloc(al %llu, size %llu)", \ (ULong)alignment, (ULong)size ); \ - if (alignment == 0 \ + if (VG_ALIGNED_ALLOC_SIZE_ZERO && (alignment == 0) \ || (VG_ALIGNED_ALLOC_SIZE_MULTIPLE_ALIGN && (size % alignment != 0)) \ || (VG_ALIGNED_ALLOC_ALIGN_POWER_TWO && (alignment & (alignment - 1)) != 0) \ || (VG_ALIGNED_ALLOC_ALIGN_FACTOR_FOUR && (alignment % 4 != 0))) { \ |
|
From: Paul F. <pa...@so...> - 2023-03-05 15:25:44
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=afb5867858ec33f20b85b138b2a0b49fc877314a commit afb5867858ec33f20b85b138b2a0b49fc877314a Author: Paul Floyd <pj...@wa...> Date: Sun Mar 5 16:24:44 2023 +0100 Solaris regtest: final iteration for aligned_alloc Diff: --- memcheck/tests/solaris/aligned_alloc.c | 7 ++----- memcheck/tests/solaris/aligned_alloc.vgtest | 1 + 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/memcheck/tests/solaris/aligned_alloc.c b/memcheck/tests/solaris/aligned_alloc.c index 36456623e9..8136062234 100644 --- a/memcheck/tests/solaris/aligned_alloc.c +++ b/memcheck/tests/solaris/aligned_alloc.c @@ -18,12 +18,10 @@ int main(void) //errno = 0; // align not power of 2 p = aligned_alloc(40, 160); - assert(p == NULL && errno == EINVAL); + assert(p); errno = 0; - // the test below causes a segfault with musl 1.2.2 - // apparently it has been - // too big + // too big aligment if (sizeof(size_t) == 8) { p = aligned_alloc(16, 1UL<<48); @@ -38,4 +36,3 @@ int main(void) } - diff --git a/memcheck/tests/solaris/aligned_alloc.vgtest b/memcheck/tests/solaris/aligned_alloc.vgtest index 07c1c4faf7..a20bccb007 100644 --- a/memcheck/tests/solaris/aligned_alloc.vgtest +++ b/memcheck/tests/solaris/aligned_alloc.vgtest @@ -1 +1,2 @@ prog: aligned_alloc +vgopts: -q |
|
From: Paul F. <pa...@so...> - 2023-03-05 15:17:27
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=4ca2fa7b1f25681cdf25b1975cabd2d71abbcfa2 commit 4ca2fa7b1f25681cdf25b1975cabd2d71abbcfa2 Author: Paul Floyd <pj...@wa...> Date: Sun Mar 5 16:13:09 2023 +0100 Solaris: bump alignment to next power of two for aligned_alloc I'm not changing the Valgrind allocator to fit Solaris, too bad. Diff: --- coregrind/m_replacemalloc/vg_replace_malloc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index 09c1dccdb1..b00d33d497 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -1990,6 +1990,8 @@ extern int *___errno (void) __attribute__((weak)); /* Round up to minimum alignment if necessary. */ \ if (alignment < VG_MIN_MALLOC_SZB) \ alignment = VG_MIN_MALLOC_SZB; \ + /* Solaris allows non-power of 2 alignment but not Valgrind. */ \ + while (0 != (alignment & (alignment - 1))) alignment++; \ \ mem = (void*)VALGRIND_NON_SIMD_CALL2( info.tl_memalign, \ alignment, size ); \ |
|
From: Paul F. <pa...@so...> - 2023-03-05 15:01:58
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=bf8d5b9a52ce063c3467d9e95b36014f93cd14b6 commit bf8d5b9a52ce063c3467d9e95b36014f93cd14b6 Author: Paul Floyd <pj...@wa...> Date: Sun Mar 5 16:01:23 2023 +0100 Solaris: copy paste error in alignment check for aligned_alloc Diff: --- coregrind/m_replacemalloc/vg_replace_malloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index 719d011410..09c1dccdb1 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -1981,8 +1981,8 @@ extern int *___errno (void) __attribute__((weak)); (ULong)alignment, (ULong)size ); \ if (alignment == 0 \ || (VG_ALIGNED_ALLOC_SIZE_MULTIPLE_ALIGN && (size % alignment != 0)) \ - || (VG_ALIGNED_ALLOC_ALIGN_POWER_TWO && (alignment & (alignment - 1)) != 0) \ - || (VG_ALIGNED_ALLOC_ALIGN_FACTOR_FOUR && (size % 4 != 0))) { \ + || (VG_ALIGNED_ALLOC_ALIGN_POWER_TWO && (alignment & (alignment - 1)) != 0) \ + || (VG_ALIGNED_ALLOC_ALIGN_FACTOR_FOUR && (alignment % 4 != 0))) { \ SET_ERRNO_EINVAL; \ return 0; \ } \ |
|
From: Paul F. <pa...@so...> - 2023-03-05 14:43:31
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=b723d03bb3debd88e5d7cad081e23fda843597f5 commit b723d03bb3debd88e5d7cad081e23fda843597f5 Author: Paul Floyd <pj...@wa...> Date: Sun Mar 5 15:42:39 2023 +0100 Solaris: adapt to aligned_alloc only enforcing a multiple of 4 Diff: --- coregrind/m_replacemalloc/vg_replace_malloc.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index 1bdcac7d3e..719d011410 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -1926,6 +1926,19 @@ extern int *___errno (void) __attribute__((weak)); #define VG_ALIGNED_ALLOC_SIZE_MULTIPLE_ALIGN 0 #endif +#if defined(VGO_solaris) +#define VG_ALIGNED_ALLOC_ALIGN_POWER_TWO 0 +#else +#define VG_ALIGNED_ALLOC_ALIGN_POWER_TWO 1 +#endif + +#if defined(VGO_solaris) +#define VG_ALIGNED_ALLOC_ALIGN_FACTOR_FOUR 1 +#else +#define VG_ALIGNED_ALLOC_ALIGN_FACTOR_FOUR 0 +#endif + + #if defined (VGO_linux) && !defined(MUSL_LIBC) #define ALIGNED_ALLOC(soname, fnname) \ @@ -1968,7 +1981,8 @@ extern int *___errno (void) __attribute__((weak)); (ULong)alignment, (ULong)size ); \ if (alignment == 0 \ || (VG_ALIGNED_ALLOC_SIZE_MULTIPLE_ALIGN && (size % alignment != 0)) \ - || (alignment & (alignment - 1)) != 0) { \ + || (VG_ALIGNED_ALLOC_ALIGN_POWER_TWO && (alignment & (alignment - 1)) != 0) \ + || (VG_ALIGNED_ALLOC_ALIGN_FACTOR_FOUR && (size % 4 != 0))) { \ SET_ERRNO_EINVAL; \ return 0; \ } \ |
|
From: Paul F. <pa...@so...> - 2023-03-05 14:30:34
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=fd20bb9c67f180e9e22b9b1694b3530c772ff73d commit fd20bb9c67f180e9e22b9b1694b3530c772ff73d Author: Paul Floyd <pj...@wa...> Date: Sun Mar 5 15:25:51 2023 +0100 Make aligned_alloc behave more like the underlying platform aligned_alloc This is the third part of Bug 466104 aligned_alloc problems, part 1 Shouldn't affect Linux glibc. Diff: --- .gitignore | 3 ++ coregrind/m_replacemalloc/vg_replace_malloc.c | 28 ++++++++++---- memcheck/tests/darwin/Makefile.am | 2 + memcheck/tests/darwin/aligned_alloc.c | 40 ++++++++++++++++++++ memcheck/tests/darwin/aligned_alloc.stderr.exp | 0 memcheck/tests/darwin/aligned_alloc.vgtest | 2 + memcheck/tests/freebsd/errno_aligned_allocs.c | 5 ++- .../tests/freebsd/errno_aligned_allocs.stderr.exp | 2 +- memcheck/tests/linux/Makefile.am | 1 + memcheck/tests/linux/aligned_alloc.c | 43 ++++++++++++++++++++++ memcheck/tests/linux/aligned_alloc.stderr.exp | 0 memcheck/tests/linux/aligned_alloc.vgtest | 1 + memcheck/tests/solaris/Makefile.am | 2 + memcheck/tests/solaris/aligned_alloc.c | 41 +++++++++++++++++++++ memcheck/tests/solaris/aligned_alloc.stderr.exp | 0 memcheck/tests/solaris/aligned_alloc.vgtest | 1 + 16 files changed, 160 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 7cd35cc9e3..67e6b545fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1082,6 +1082,7 @@ /memcheck/tests/darwin/Makefile /memcheck/tests/darwin/Makefile.in /memcheck/tests/darwin/aio +/memcheck/tests/darwin/aligned_alloc /memcheck/tests/darwin/deep_badparam /memcheck/tests/darwin/env /memcheck/tests/darwin/ioctl-tiocsbrk @@ -1099,6 +1100,7 @@ /memcheck/tests/linux/*.stdout.diff /memcheck/tests/linux/*.stdout.out /memcheck/tests/linux/.deps +/memcheck/tests/linux/aligned_alloc /memcheck/tests/linux/brk /memcheck/tests/linux/capget /memcheck/tests/linux/check_preadv2_pwritev2 @@ -1193,6 +1195,7 @@ /memcheck/tests/solaris/.deps /memcheck/tests/solaris/Makefile /memcheck/tests/solaris/Makefile.in +/memcheck/tests/solaris/aligned_alloc /memcheck/tests/solaris/brk /memcheck/tests/solaris/context_stack_die /memcheck/tests/solaris/door_data diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index 494ef96371..1bdcac7d3e 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -1892,14 +1892,14 @@ extern int *___errno (void) __attribute__((weak)); * alignment supported by the implementation the function shall * fail by returning a null pointer". * - * Linux glibc, the man page claims that the alignment must be + * Linux glibc. The man page claims that the alignment must be * a power of two and that size should be a multiple of alignment. * However the only case that returns EINVAL (glibc 2.34) * is if the alignement is > SIZE_MAX / 2 + 1 * Also this is just a weak alias for memalign so this wrapper - * has no effect on Linux. + * has no effect on Linux glibc. * - * Linux musl, the alignment must be a power of 2 else + * Linux musl. The alignment must be a power of 2 else * returns einval. The value of the alignment is clamped * to a minumum of UNIT (16). * @@ -1908,16 +1908,25 @@ extern int *___errno (void) __attribute__((weak)); * The code checks that the alignment is a power of * 2 and not less than the minumum alignment (1) * - * Solaris: doesn't seem to exist on 11.3 - * Illumos: invalid if the size is 0, the alignment is 0, the + * Solaris. Doesn't seem to exist on 11.3 + * Illumos. Invalid if the size is 0, the alignment is 0, the * alignment is not a multiple of 4 (no power of 2 * requirement even though the manpage claims is) or the * alignment is greater than MAX_ALIGN (whatever that is). * Wrapper function that just calls memalign * + * Darwin. Does enforce size bing an integer multiple of + * alignment. + * */ -#if defined (VGO_linux) +#if defined(VGO_darwin) +#define VG_ALIGNED_ALLOC_SIZE_MULTIPLE_ALIGN 1 +#else +#define VG_ALIGNED_ALLOC_SIZE_MULTIPLE_ALIGN 0 +#endif + +#if defined (VGO_linux) && !defined(MUSL_LIBC) #define ALIGNED_ALLOC(soname, fnname) \ \ @@ -1928,7 +1937,6 @@ extern int *___errno (void) __attribute__((weak)); { \ void *mem; \ \ - TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED(alignment); \ TRIGGER_MEMCHECK_ERROR_IF_UNDEFINED(size); \ MALLOC_TRACE("aligned_alloc(al %llu, size %llu)", \ (ULong)alignment, (ULong)size ); \ @@ -1959,12 +1967,16 @@ extern int *___errno (void) __attribute__((weak)); MALLOC_TRACE("aligned_alloc(al %llu, size %llu)", \ (ULong)alignment, (ULong)size ); \ if (alignment == 0 \ - || size % alignment != 0 \ + || (VG_ALIGNED_ALLOC_SIZE_MULTIPLE_ALIGN && (size % alignment != 0)) \ || (alignment & (alignment - 1)) != 0) { \ SET_ERRNO_EINVAL; \ return 0; \ } \ \ + /* Round up to minimum alignment if necessary. */ \ + if (alignment < VG_MIN_MALLOC_SZB) \ + alignment = VG_MIN_MALLOC_SZB; \ + \ mem = (void*)VALGRIND_NON_SIMD_CALL2( info.tl_memalign, \ alignment, size ); \ \ diff --git a/memcheck/tests/darwin/Makefile.am b/memcheck/tests/darwin/Makefile.am index 4e34a22ec2..c180964dd6 100644 --- a/memcheck/tests/darwin/Makefile.am +++ b/memcheck/tests/darwin/Makefile.am @@ -7,6 +7,7 @@ noinst_HEADERS = scalar.h EXTRA_DIST = \ aio.stderr.exp aio.vgtest \ + aligned_alloc.stderr.exp aligned_alloc.vgtest \ deep_badparam.stderr.exp deep_badparam.stdout.exp deep_badparam.vgtest \ env.stderr.exp env.vgtest \ ioctl-tiocsbrk.stderr.exp ioctl-tiocsbrk.vgtest \ @@ -20,6 +21,7 @@ EXTRA_DIST = \ check_PROGRAMS = \ aio \ + aligned_alloc \ deep_badparam \ env \ ioctl-tiocsbrk \ diff --git a/memcheck/tests/darwin/aligned_alloc.c b/memcheck/tests/darwin/aligned_alloc.c new file mode 100644 index 0000000000..13b04525a5 --- /dev/null +++ b/memcheck/tests/darwin/aligned_alloc.c @@ -0,0 +1,40 @@ +#include <stdlib.h> +#include <assert.h> +#include <errno.h> + +int main(void) +{ + char* p = NULL; + int res; + + // zero size + p = aligned_alloc(0, 8); + assert(p == NULL && errno == EINVAL); + errno = 0; + // non multiple of alignment fails on Darwin + p = aligned_alloc(8, 25); + assert(p == NULL && errno == EINVAL); + errno = 0; + // align not power of 2 + p = aligned_alloc(40, 160); + assert(p == NULL && errno == EINVAL); + errno = 0; + // the test below causes a segfault with musl 1.2.2 + // apparently it has been + + // too big + if (sizeof(size_t) == 8) + { + p = aligned_alloc(16, 1UL<<48); + } + else + { + p = NULL; + errno = ENOMEM; + } + + assert(p == NULL && errno == ENOMEM); + +} + + diff --git a/memcheck/tests/darwin/aligned_alloc.stderr.exp b/memcheck/tests/darwin/aligned_alloc.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/memcheck/tests/darwin/aligned_alloc.vgtest b/memcheck/tests/darwin/aligned_alloc.vgtest new file mode 100644 index 0000000000..a20bccb007 --- /dev/null +++ b/memcheck/tests/darwin/aligned_alloc.vgtest @@ -0,0 +1,2 @@ +prog: aligned_alloc +vgopts: -q diff --git a/memcheck/tests/freebsd/errno_aligned_allocs.c b/memcheck/tests/freebsd/errno_aligned_allocs.c index b8954be773..7faffd5307 100644 --- a/memcheck/tests/freebsd/errno_aligned_allocs.c +++ b/memcheck/tests/freebsd/errno_aligned_allocs.c @@ -61,8 +61,9 @@ int main(void) assert(p == NULL && errno == EINVAL); errno = 0; // non multiple of alignment passes on FreeBSD - //p = aligned_alloc(8, 25); - //assert(p == NULL && errno == EINVAL); + p = aligned_alloc(8, 25); + assert(p && ((size_t)p % 8U == 0U)); + free(p); //errno = 0; // align not power of 2 p = aligned_alloc(40, 160); diff --git a/memcheck/tests/freebsd/errno_aligned_allocs.stderr.exp b/memcheck/tests/freebsd/errno_aligned_allocs.stderr.exp index eb42921c60..df22e9a5bb 100644 --- a/memcheck/tests/freebsd/errno_aligned_allocs.stderr.exp +++ b/memcheck/tests/freebsd/errno_aligned_allocs.stderr.exp @@ -2,7 +2,7 @@ HEAP SUMMARY: in use at exit: 0 bytes in 0 blocks - total heap usage: 0 allocs, 0 frees, 0 bytes allocated + total heap usage: 1 allocs, 1 frees, 25 bytes allocated For a detailed leak analysis, rerun with: --leak-check=full diff --git a/memcheck/tests/linux/Makefile.am b/memcheck/tests/linux/Makefile.am index af26730c37..895f76ed69 100644 --- a/memcheck/tests/linux/Makefile.am +++ b/memcheck/tests/linux/Makefile.am @@ -4,6 +4,7 @@ include $(top_srcdir)/Makefile.tool-tests.am dist_noinst_SCRIPTS = filter_stderr EXTRA_DIST = \ + aligned_alloc.c aligned_alloc.vgtest aligned_alloc.stderr.exp \ brk.stderr.exp brk.vgtest \ capget.vgtest capget.stderr.exp capget.stderr.exp2 capget.stderr.exp3 \ debuginfod-check.stderr.exp debuginfod-check.vgtest.in \ diff --git a/memcheck/tests/linux/aligned_alloc.c b/memcheck/tests/linux/aligned_alloc.c new file mode 100644 index 0000000000..15955ff845 --- /dev/null +++ b/memcheck/tests/linux/aligned_alloc.c @@ -0,0 +1,43 @@ +#include <stdlib.h> +#include <assert.h> +#include <errno.h> +#include "../../../config.h" + +int main(void) +{ +#if defined(MUSL_LIBC) + char* p = NULL; + int res; + + // zero size + p = aligned_alloc(0, 8); + assert(p == NULL && errno == EINVAL); + errno = 0; + // non multiple of alignment passes on FreeBSD + p = aligned_alloc(8, 25); + assert(p && ((size_t)p % 8U == 0U)); + free(p); + //errno = 0; + // align not power of 2 + p = aligned_alloc(40, 160); + assert(p == NULL && errno == EINVAL); + errno = 0; + // the test below causes a segfault with musl 1.2.2 + // apparently it has been fixed in 1.2.3 +#if 0 + // too big + if (sizeof(size_t) == 8) + { + p = aligned_alloc(16, 1UL<<48); + } + else + { + p = NULL; + errno = ENOMEM; + } +#endif + assert(p == NULL && errno == ENOMEM); +#endif +} + + diff --git a/memcheck/tests/linux/aligned_alloc.stderr.exp b/memcheck/tests/linux/aligned_alloc.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/memcheck/tests/linux/aligned_alloc.vgtest b/memcheck/tests/linux/aligned_alloc.vgtest new file mode 100644 index 0000000000..07c1c4faf7 --- /dev/null +++ b/memcheck/tests/linux/aligned_alloc.vgtest @@ -0,0 +1 @@ +prog: aligned_alloc diff --git a/memcheck/tests/solaris/Makefile.am b/memcheck/tests/solaris/Makefile.am index 024856901c..fe1e2ca3fb 100644 --- a/memcheck/tests/solaris/Makefile.am +++ b/memcheck/tests/solaris/Makefile.am @@ -12,6 +12,7 @@ dist_noinst_SCRIPTS = \ noinst_HEADERS = scalar.h EXTRA_DIST = \ + aligned_alloc.stderr.exp aligned_alloc.vgtest \ brk.stderr.exp brk.stdout.exp brk.vgtest \ context_stack_die.stderr.exp context_stack_die.stdout.exp context_stack_die.vgtest \ door_data.stderr.exp door_data.stdout.exp door_data.vgtest \ @@ -58,6 +59,7 @@ EXTRA_DIST = \ memalign.vgtest memalign.stderr.exp check_PROGRAMS = \ + aligned_alloc \ brk \ context_stack_die \ door_data \ diff --git a/memcheck/tests/solaris/aligned_alloc.c b/memcheck/tests/solaris/aligned_alloc.c new file mode 100644 index 0000000000..36456623e9 --- /dev/null +++ b/memcheck/tests/solaris/aligned_alloc.c @@ -0,0 +1,41 @@ +#include <stdlib.h> +#include <assert.h> +#include <errno.h> + +int main(void) +{ + char* p = NULL; + int res; + + // zero size + p = aligned_alloc(0, 8); + assert(p == NULL && errno == EINVAL); + errno = 0; + // non multiple of alignment passes on Solaris + p = aligned_alloc(8, 25); + assert(p && ((size_t)p % 8U == 0U)); + free(p); + //errno = 0; + // align not power of 2 + p = aligned_alloc(40, 160); + assert(p == NULL && errno == EINVAL); + errno = 0; + // the test below causes a segfault with musl 1.2.2 + // apparently it has been + + // too big + if (sizeof(size_t) == 8) + { + p = aligned_alloc(16, 1UL<<48); + } + else + { + p = NULL; + errno = ENOMEM; + } + + assert(p == NULL && errno == ENOMEM); + +} + + diff --git a/memcheck/tests/solaris/aligned_alloc.stderr.exp b/memcheck/tests/solaris/aligned_alloc.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/memcheck/tests/solaris/aligned_alloc.vgtest b/memcheck/tests/solaris/aligned_alloc.vgtest new file mode 100644 index 0000000000..07c1c4faf7 --- /dev/null +++ b/memcheck/tests/solaris/aligned_alloc.vgtest @@ -0,0 +1 @@ +prog: aligned_alloc |
|
From: Paul F. <pa...@so...> - 2023-03-05 07:43:39
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=cb7adf4a9eaa06951afd8a066df3da6fcc095e5b commit cb7adf4a9eaa06951afd8a066df3da6fcc095e5b Author: Paul Floyd <pj...@wa...> Date: Sun Mar 5 08:38:34 2023 +0100 Bug 449309 - Missing loopback device ioctl(s) Patch provided by: Faheem Sheikh <fah...@bm...> Note that the testcase provided with this report hasn't been added as it requires privileges. Diff: --- NEWS | 1 + coregrind/m_syswrap/syswrap-linux.c | 53 +++++++++++++++++++++++++++++++++++ include/vki/vki-linux.h | 56 +++++++++++++++++++++++++++++++++++++ 3 files changed, 110 insertions(+) diff --git a/NEWS b/NEWS index e31fc3c50d..61c4e03053 100644 --- a/NEWS +++ b/NEWS @@ -89,6 +89,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 444568 drd/tests/pth_barrier_thr_cr fails on Fedora 38 445743 "The impossible happened: mutex is locked simultaneously by two threads" while using mutexes with priority inheritance and signals +449309 Missing loopback device ioctl(s) 459476 vgdb: allow address reuse to avoid "address already in use" errorsuse" errors 460356 s390: Sqrt32Fx4 -- cannot reduce tree 462830 WARNING: unhandled amd64-freebsd syscall: 474 diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index 4a5a93b35a..34d4cf1f55 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -7861,6 +7861,32 @@ PRE(sys_ioctl) PRE_MEM_WRITE( "ioctl(RTC_IRQP_READ)", ARG3, sizeof(unsigned long)); break; + /* Loopback control */ + case VKI_LOOP_CTL_ADD: + case VKI_LOOP_CTL_REMOVE: + case VKI_LOOP_CTL_GET_FREE: + break; + /* Loopback device */ + case VKI_LOOP_SET_FD: + case VKI_LOOP_CLR_FD: + case VKI_LOOP_CHANGE_FD: + case VKI_LOOP_SET_CAPACITY: + case VKI_LOOP_SET_DIRECT_IO: + case VKI_LOOP_SET_BLOCK_SIZE: + break; + case VKI_LOOP_SET_STATUS: + PRE_MEM_READ("ioctl(LOOP_SET_STATUS)", ARG3, sizeof(struct vki_loop_info)); + break; + case VKI_LOOP_GET_STATUS: + PRE_MEM_WRITE("ioctl(LOOP_GET_STATUS)", ARG3, sizeof(struct vki_loop_info)); + break; + case VKI_LOOP_SET_STATUS64: + PRE_MEM_READ("ioctl(LOOP_SET_STATUS64)", ARG3, sizeof(struct vki_loop_info64)); + break; + case VKI_LOOP_GET_STATUS64: + PRE_MEM_WRITE("ioctl(LOOP_GET_STATUS64)", ARG3, sizeof(struct vki_loop_info64)); + break; + /* Block devices */ case VKI_BLKROSET: PRE_MEM_READ( "ioctl(BLKROSET)", ARG3, sizeof(int)); @@ -10828,6 +10854,33 @@ POST(sys_ioctl) POST_MEM_WRITE(ARG3, sizeof(unsigned long)); break; + /* Loopback devices */ + case VKI_LOOP_CTL_ADD: + case VKI_LOOP_CTL_REMOVE: + case VKI_LOOP_CTL_GET_FREE: + break; + /* Loopback device */ + case VKI_LOOP_SET_FD: + case VKI_LOOP_CLR_FD: + case VKI_LOOP_CHANGE_FD: + case VKI_LOOP_SET_CAPACITY: + case VKI_LOOP_SET_DIRECT_IO: + case VKI_LOOP_SET_BLOCK_SIZE: + break; + case VKI_LOOP_SET_STATUS: + POST_MEM_WRITE(ARG3, sizeof(struct vki_loop_info)); + break; + case VKI_LOOP_GET_STATUS: + POST_MEM_WRITE(ARG3, sizeof(struct vki_loop_info)); + break; + case VKI_LOOP_SET_STATUS64: + POST_MEM_WRITE(ARG3, sizeof(struct vki_loop_info64)); + break; + case VKI_LOOP_GET_STATUS64: + POST_MEM_WRITE(ARG3, sizeof(struct vki_loop_info64)); + break; + + /* Block devices */ case VKI_BLKROSET: break; diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h index c963837015..be3d76690c 100644 --- a/include/vki/vki-linux.h +++ b/include/vki/vki-linux.h @@ -1872,6 +1872,62 @@ struct vki_ppdev_frob_struct { #define VKI_PPGETFLAGS _VKI_IOR(VKI_PP_IOCTL, 0x9a, int) #define VKI_PPSETFLAGS _VKI_IOW(VKI_PP_IOCTL, 0x9b, int) +//---------------------------------------------------------------------- +// From linux-5.2.5/include/uapi/linux/loop.h +//---------------------------------------------------------------------- + +#define VKI_LO_NAME_SIZE 64 +#define VKI_LO_KEY_SIZE 32 + +struct vki_loop_info { + + int lo_number; /* ioctl r/o */ + unsigned short lo_device; /* ioctl r/o */ + unsigned long lo_inode; /* ioctl r/o */ + unsigned short lo_rdevice; /* ioctl r/o */ + int lo_offset; + int lo_encrypt_type; + int lo_encrypt_key_size; /* ioctl w/o */ + int lo_flags; /* ioctl r/o */ + char lo_name[VKI_LO_NAME_SIZE]; + unsigned char lo_encrypt_key[VKI_LO_KEY_SIZE];/* ioctl w/o */ + unsigned long lo_init[2]; + char reserved[4]; +}; + +struct vki_loop_info64 { + __vki_u64 lo_device; /* ioctl r/o */ + __vki_u64 lo_inode; /* ioctl r/o */ + __vki_u64 lo_rdevice; /* ioctl r/o */ + __vki_u64 lo_offset; + __vki_u64 lo_sizelimit;/* bytes, 0 == max available */ + __vki_u32 lo_number; /* ioctl r/o */ + __vki_u32 lo_encrypt_type; + __vki_u32 lo_encrypt_key_size; /* ioctl w/o */ + __vki_u32 lo_flags; /* ioctl r/o */ + __vki_u8 lo_file_name[VKI_LO_NAME_SIZE]; + __vki_u8 lo_crypt_name[VKI_LO_NAME_SIZE]; + __vki_u8 lo_encrypt_key[VKI_LO_KEY_SIZE]; /* ioctl w/o */ + __vki_u64 lo_init[2]; +}; + +/* loopback device related, e.g. see losetup program options */ +#define VKI_LOOP_SET_FD 0x4C00 +#define VKI_LOOP_CLR_FD 0x4C01 +#define VKI_LOOP_SET_STATUS 0x4C02 +#define VKI_LOOP_GET_STATUS 0x4C03 +#define VKI_LOOP_SET_STATUS64 0x4C04 +#define VKI_LOOP_GET_STATUS64 0x4C05 +#define VKI_LOOP_CHANGE_FD 0x4C06 +#define VKI_LOOP_SET_CAPACITY 0x4C07 +#define VKI_LOOP_SET_DIRECT_IO 0x4C08 +#define VKI_LOOP_SET_BLOCK_SIZE 0x4C09 + +/* ioctls for loop-control device interface */ +#define VKI_LOOP_CTL_ADD 0x4C80 // adds a new loopback device +#define VKI_LOOP_CTL_REMOVE 0x4C81 // deletes an existing loopback device +#define VKI_LOOP_CTL_GET_FREE 0x4C82 // finds a free/available loopback device + //---------------------------------------------------------------------- // From linux-5.2.5/include/uapi/linux/fs.h //---------------------------------------------------------------------- |