]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
FreeBSD regtest: add fakes for FreeBSD < 13
authorPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 27 Oct 2024 17:59:12 +0000 (18:59 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Sun, 27 Oct 2024 17:59:12 +0000 (18:59 +0100)
Also try again to make mprotect fail. It doesn't fail
with a bogus 'prot' on FreeBSD 12.4.

memcheck/tests/freebsd/scalar.c
memcheck/tests/freebsd/scalar.stderr.exp
memcheck/tests/freebsd/scalar.supp

index a1cfb06b14c71e9a59d334a4d4479b74a5fe3001..bd34487b089907c9750d76c455dca3d3e2bab711 100644 (file)
@@ -334,7 +334,7 @@ int main(void)
 
    /* SYS_mprotect                74 */
    GO(SYS_mprotect, "3s 0m");
-   SY(SYS_mprotect, x0+1, x0+1, x0+9999); FAIL;
+   SY(SYS_mprotect, x0+1, x0-10, x0+9999); FAIL;
 
    /* SYS_madvise                 75 */
    GO(SYS_madvise, "3s 0m");
@@ -2176,31 +2176,148 @@ int main(void)
 
    // FreeBSD 13 (and any backports)
    /* SYS_shm_open2                      571 */
+#if defined(SYS_shm_open2)
    GO(SYS_shm_open2, " 5s 2m");
    SY(SYS_shm_open2, x0+0xf00c, x0+1, x0+2, x0+3, x0+4); FAIL;
 
    GO(SYS_shm_open2, " 5s 1m");
    SY(SYS_shm_open2, x0+SHM_ANON, x0+1, x0+2, x0+3, x0+4); FAIL;
+#else
+   FAKE_GO("571:           SYS_shm_open2  5s 2m");
+   FAKE_SY("Syscall param shm_open2(path) contains uninitialised byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param shm_open2(flags) contains uninitialised byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param shm_open2(mode) contains uninitialised byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param shm_open2(shmflags) contains uninitialised byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param shm_open2(name) contains uninitialised byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param shm_open2(path) points to unaddressable byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param shm_open2(name) points to unaddressable byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
+   FAKE_SY("\n");
+
+   FAKE_GO("571:           SYS_shm_open2  5s 1m");
+   FAKE_SY("Syscall param shm_open2(path) contains uninitialised byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param shm_open2(flags) contains uninitialised byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param shm_open2(mode) contains uninitialised byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param shm_open2(shmflags) contains uninitialised byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param shm_open2(name) contains uninitialised byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param shm_open2(name) points to unaddressable byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
+   FAKE_SY("\n");
+#endif
 
    /* SYS___realpathat                   574 */
+#if defined(SYS___realpathat)
    GO(SYS___realpathat, " 5s 2m");
    SY(SYS___realpathat, x0+0xffff, x0, x0, x0+100, x0+2); FAIL;
+#else
+   FAKE_GO("574:        SYS___realpathat  5s 2m");
+   FAKE_SY("Syscall param __realpathat(fd) contains uninitialised byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param __realpathat(path) contains uninitialised byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param __realpathat(buf) contains uninitialised byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param __realpathat(size) contains uninitialised byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param __realpathat(flags) contains uninitialised byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param __realpathat(path) points to unaddressable byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param __realpathat(buf) points to unaddressable byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
+   FAKE_SY("\n");
+#endif
 
    /* SYS_close_range                    575 */
+#if defined(SYS_close_range)
    GO(SYS_close_range, "3s 0m");
    SY(SYS_close_range, x0+5, x0+10, x0+12345); FAIL;
+#else
+#endif
 
    /* SYS___specialfd                    577 */
+#if defined(SYS___specialfd)
    GO(SYS___specialfd, "3s 1m");
    SY(SYS___specialfd, x0+0xf000, x0+1, x0+10); FAIL;
+#else
+   FAKE_GO("577:         SYS___specialfd 3s 1m");
+   FAKE_SY("Syscall param __specialfd(type) contains uninitialised byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param __specialfd(req) contains uninitialised byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param __specialfd(len) contains uninitialised byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param __specialfd(req) points to unaddressable byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
+   FAKE_SY("\n");
+#endif
 
    /* SYS_aio_writev                     578 */
+#if defined(SYS_aio_writev)
    GO(SYS_aio_writev, "1s 1m");
    SY(SYS_aio_writev, x0+1); FAIL;
+#else
+   FAKE_GO("578:          SYS_aio_writev 1s 1m");
+   FAKE_SY("Syscall param aio_writev(iocb) contains uninitialised byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param aio_writev(iocb) points to unaddressable byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
+   FAKE_SY("\n");
+#endif
 
    /* SYS_aio_readv                      579 */
+#if defined(SYS_aio_readv)
    GO(SYS_aio_readv, "1s 1m");
    SY(SYS_aio_readv, x0+1); FAIL;
+#else
+   FAKE_GO("579:           SYS_aio_readv 1s 1m");
+   FAKE_SY("Syscall param aio_readv(iocb) contains uninitialised byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY("\n");
+   FAKE_SY("Syscall param aio_readv(iocb) points to unaddressable byte(s)\n");
+   FAKE_SY("   ...\n");
+   FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n");
+   FAKE_SY("\n");
+#endif
 
    /* SYS_exit                    1 */
    GO(SYS_exit, "1s 0m");
index db12726f55ae01ae3f6207d94e85a284657d8e7d..cdda0a7e0d2e0cd0b0dc12e209789e2b2348310f 100644 (file)
@@ -610,6 +610,7 @@ Syscall param mprotect(len) contains uninitialised byte(s)
 Syscall param mprotect(prot) contains uninitialised byte(s)
    ...
 
+Warning: client syscall mprotect tried to modify addresses 0x........-0x........
 ---------------------------------------------------------
  75:             SYS_madvise 3s 0m
 ---------------------------------------------------------
index f6b15a33eaa780ecba50feb6db0b797af480dc4e..bf83845b5972ee47b27f586eaf2c1c74341d113c 100644 (file)
@@ -1,4 +1,4 @@
-# not sure what causes this exactly# on x86 and amd64 (but not arm64)
+# not sure what causes this exactly on x86 and amd64 (but not arm64)
 # there is an conditional uninit read
 # there are several if statements that use the two pointers to stack
 # structures that probably generate the error
@@ -7,5 +7,4 @@
    internal uninitilized read
    Memcheck:Cond
    fun:syscall
-   fun:main
 }