[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 01/13] linux-user/syscall: Verify recvfrom(ad
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-devel] [PATCH v3 01/13] linux-user/syscall: Verify recvfrom(addr) is user-writable |
Date: |
Tue, 3 Jul 2018 16:55:26 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
Le 02/07/2018 à 19:50, Philippe Mathieu-Daudé a écrit :
> 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 2117fb13b4..ad40682cee 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -4154,6 +4154,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 patch breaks the test recvfrom01 of the Linux Test Project.
Laurent
[Qemu-devel] [PATCH v3 02/13] linux-user/strace: Improve capget()/capset() output, Philippe Mathieu-Daudé, 2018/07/02
[Qemu-devel] [PATCH v3 05/13] linux-user/strace: Improve settimeofday(), Philippe Mathieu-Daudé, 2018/07/02
[Qemu-devel] [PATCH v3 06/13] linux-user/strace: Dump AF_NETLINK sockaddr content, Philippe Mathieu-Daudé, 2018/07/02
[Qemu-devel] [PATCH v3 07/13] linux-user/strace: Improve recvmsg() output, Philippe Mathieu-Daudé, 2018/07/02
[Qemu-devel] [PATCH v3 10/13] linux-user/strace: Let print_sockaddr() have a 'last' argument, Philippe Mathieu-Daudé, 2018/07/02