https://bugs.kde.org/show_bug.cgi?id=408414

            Bug ID: 408414
           Summary: Add support for missing for preadv2 and pwritev2
                    syscalls
           Product: valgrind
           Version: unspecified
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: jsew...@acm.org
          Reporter: ahajk...@redhat.com
  Target Milestone: ---

SUMMARY


STEPS TO REPRODUCE
1. compile glibc
2. run from the build dir:
 ./testrun.sh --tool=valgrind misc/tst-preadvwritev2 --direct


OBSERVED RESULT
 Memcheck, a memory error detector

...
--8186-- WARNING: unhandled amd64-linux syscall: 327
--8186-- You may be able to write your own handler.
--8186-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--8186-- Nevertheless we consider this a bug.  Please report
--8186-- it at http://valgrind.org/support/bug_reports.html.

...

==8186== Syscall param pwritev(vector[...]) points to uninitialised byte(s)
==8186==    at 0x4D01369: pwritev (pwritev64.c:30)
==8186==    by 0x4019CE: do_test_with_invalid_iov
(tst-preadvwritev2-common.c:80)
==8186==    by 0x401F15: do_test (tst-preadvwritev2.c:34)
==8186==    by 0x403061: support_test_main (support_test_main.c:350)
==8186==    by 0x401618: main (test-driver.c:168)
==8186==  Address 0x1ffeffb040 is on thread 1's stack
==8186==  in frame #1, created by do_test_with_invalid_iov
(tst-preadvwritev2-common.c:70)
==8186== 
--8186-- WARNING: unhandled amd64-linux syscall: 327
--8186-- You may be able to write your own handler.
--8186-- Read the file README_MISSING_SYSCALL_OR_IOCTL.
--8186-- Nevertheless we consider this a bug.  Please report
--8186-- it at http://valgrind.org/support/bug_reports.html.
--8186-- WARNING: unhandled amd64-linux syscall: 328
...

RESULTS with proposed patch:
....

==30023== Syscall param pwritev2(vector[...]) points to uninitialised byte(s)
==30023==    at 0x4D0159D: pwritev2 (pwritev64v2.c:31)
==30023==    by 0x401CEC: do_test_with_invalid_flags
(tst-preadvwritev2-common.c:119)
==30023==    by 0x401CEC: do_test (tst-preadvwritev2.c:31)
==30023==    by 0x403061: support_test_main (support_test_main.c:350)
==30023==    by 0x401618: main (test-driver.c:168)
==30023==  Address 0x1ffefff0f0 is on thread 1's stack
==30023==  in frame #1, created by do_test (tst-preadvwritev2-common.c:30)
==30023== 
==30023== Warning: invalid file descriptor -1 in syscall preadv2()
==30023== Warning: invalid file descriptor -1 in syscall pwritev2()
==30023== Warning: invalid file descriptor -1 in syscall preadv2()
==30023== Warning: invalid file descriptor -1 in syscall pwritev2()
==30023== Syscall param preadv2(vector[...]) points to unaddressable byte(s)
==30023==    at 0x4D0143D: preadv2 (preadv64v2.c:31)
==30023==    by 0x401988: do_test_with_invalid_iov
(tst-preadvwritev2-common.c:78)
==30023==    by 0x401F15: do_test (tst-preadvwritev2.c:34)
==30023==    by 0x403061: support_test_main (support_test_main.c:350)
==30023==    by 0x401618: main (test-driver.c:168)
==30023==  Address 0x1fff001000 is not stack'd, malloc'd or (recently) free'd
==30023== 
==30023== Syscall param pwritev2(vector[...]) points to uninitialised byte(s)
==30023==    at 0x4D0159D: pwritev2 (pwritev64v2.c:31)
==30023==    by 0x4019CE: do_test_with_invalid_iov
(tst-preadvwritev2-common.c:80)
==30023==    by 0x401F15: do_test (tst-preadvwritev2.c:34)
==30023==    by 0x403061: support_test_main (support_test_main.c:350)
==30023==    by 0x401618: main (test-driver.c:168)
==30023==  Address 0x1ffeffb020 is on thread 1's stack
==30023==  in frame #1, created by do_test_with_invalid_iov
(tst-preadvwritev2-common.c:70)
==30023== 
==30023== Syscall param preadv2(vector[...]) points to unaddressable byte(s)
==30023==    at 0x4D0143D: preadv2 (preadv64v2.c:31)
==30023==    by 0x401A0F: do_test_with_invalid_iov
(tst-preadvwritev2-common.c:85)
==30023==    by 0x401F15: do_test (tst-preadvwritev2.c:34)
==30023==    by 0x403061: support_test_main (support_test_main.c:350)
==30023==    by 0x401618: main (test-driver.c:168)
==30023==  Address 0x1fff001000 is not stack'd, malloc'd or (recently) free'd
==30023== 
==30023== Syscall param pwritev2(vector[...]) points to uninitialised byte(s)
==30023==    at 0x4D0159D: pwritev2 (pwritev64v2.c:31)
==30023==    by 0x401A54: do_test_with_invalid_iov
(tst-preadvwritev2-common.c:87)
==30023==    by 0x401F15: do_test (tst-preadvwritev2.c:34)
==30023==    by 0x403061: support_test_main (support_test_main.c:350)
==30023==    by 0x401618: main (test-driver.c:168)
==30023==  Address 0x1ffeffb020 is on thread 1's stack
==30023==  in frame #1, created by do_test_with_invalid_iov
(tst-preadvwritev2-common.c:70)
==30023== 
==30023== 

....

Proposed patch on github:
https://github.com/sasshka/valgrind/commit/a671972cbce09a4e6d03905d4fd70c1ba84807af

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to