[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 01/10] linux-user/syscall: Verify recvfrom(addr)
From: |
Laurent Vivier |
Subject: |
[Qemu-devel] [PATCH v5 01/10] linux-user/syscall: Verify recvfrom(addr) is user-writable |
Date: |
Sun, 14 Oct 2018 15:19:31 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 |
On 11/10/2018 00:36, Philippe Mathieu-Daudé wrote:
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> Tested-By: Guido Günther <address@hidden>
> Reviewed-by: Laurent Vivier <address@hidden>
> ---
> linux-user/syscall.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index ae3c0dfef7..ea503381aa 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -2968,6 +2968,11 @@ static abi_long do_recvfrom(int fd, abi_ulong msg,
> size_t len, int flags,
> ret = -TARGET_EINVAL;
> goto fail;
> }
> + if (!access_ok(VERIFY_WRITE, target_addr, addrlen)) {
> + ret = -TARGET_EFAULT;
> + goto fail;
> + }
> +
> addr = alloca(addrlen);
> ret = get_errno(safe_recvfrom(fd, host_msg, len, flags,
> addr, &addrlen));
>
This one breaks the test recvfrom01 from the LTP testsuite
ltp-full-20180515 archive.
recvfrom01 3 TFAIL : recvfrom01.c:170: invalid socket buffer ;
returned -1 (expected 0), errno 14 (expected 88)
The testcase is with an invalid socket number (-1) and an invalid
addrlen pointer.
Thanks,
Laurent
- [Qemu-devel] [PATCH v5 00/10] linux-user: strace improvements, Philippe Mathieu-Daudé, 2018/10/10
- [Qemu-devel] [PATCH v5 01/10] linux-user/syscall: Verify recvfrom(addr) is user-writable, Philippe Mathieu-Daudé, 2018/10/10
- [Qemu-devel] [PATCH v5 01/10] linux-user/syscall: Verify recvfrom(addr) is user-writable,
Laurent Vivier <=
- [Qemu-devel] [PATCH v5 03/10] linux-user/strace: Add print_timezone(), Philippe Mathieu-Daudé, 2018/10/10
- [Qemu-devel] [PATCH v5 02/10] linux-user/strace: Display invalid pointer in print_timeval(), Philippe Mathieu-Daudé, 2018/10/10
- [Qemu-devel] [PATCH v5 04/10] linux-user/strace: Improve settimeofday(), Philippe Mathieu-Daudé, 2018/10/10
- [Qemu-devel] [PATCH v5 05/10] linux-user/syscall: Introduce target_sockaddr_nl, Philippe Mathieu-Daudé, 2018/10/10
- [Qemu-devel] [PATCH v5 07/10] linux-user/strace: Add print_sockfd(), Philippe Mathieu-Daudé, 2018/10/10
- [Qemu-devel] [PATCH v5 06/10] linux-user/strace: Dump AF_NETLINK sockaddr content, Philippe Mathieu-Daudé, 2018/10/10
- [Qemu-devel] [PATCH v5 08/10] linux-user/strace: Let print_sockaddr() have a 'last' argument, Philippe Mathieu-Daudé, 2018/10/10
- Message not available