qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Riku Voipio <riku.voipio@iki.fi>
To: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/4] alloca one extra byte sockets
Date: Tue, 15 Jul 2014 16:29:30 +0300	[thread overview]
Message-ID: <20140715132930.GB607@afflict.kos.to> (raw)
In-Reply-To: <1405091884-29955-4-git-send-email-Joakim.Tjernlund@transmode.se>

On Fri, Jul 11, 2014 at 05:18:03PM +0200, Joakim Tjernlund wrote:
> target_to_host_sockaddr() may increase the lenth with 1 byte
> for AF_UNIX sockets so allocate 1 extra byte.

Thanks, applied to linux-user tree

> Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> ---
>  linux-user/syscall.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index a0e1ccc..8853c4e 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -1978,7 +1978,7 @@ static abi_long do_connect(int sockfd, abi_ulong target_addr,
>          return -TARGET_EINVAL;
>      }
>  
> -    addr = alloca(addrlen);
> +    addr = alloca(addrlen+1);
>  
>      ret = target_to_host_sockaddr(addr, target_addr, addrlen);
>      if (ret)
> @@ -1999,7 +1999,7 @@ static abi_long do_sendrecvmsg_locked(int fd, struct target_msghdr *msgp,
>  
>      if (msgp->msg_name) {
>          msg.msg_namelen = tswap32(msgp->msg_namelen);
> -        msg.msg_name = alloca(msg.msg_namelen);
> +        msg.msg_name = alloca(msg.msg_namelen+1);
>          ret = target_to_host_sockaddr(msg.msg_name, tswapal(msgp->msg_name),
>                                  msg.msg_namelen);
>          if (ret) {
> @@ -2262,7 +2262,7 @@ static abi_long do_sendto(int fd, abi_ulong msg, size_t len, int flags,
>      if (!host_msg)
>          return -TARGET_EFAULT;
>      if (target_addr) {
> -        addr = alloca(addrlen);
> +        addr = alloca(addrlen+1);
>          ret = target_to_host_sockaddr(addr, target_addr, addrlen);
>          if (ret) {
>              unlock_user(host_msg, msg, 0);
> -- 
> 1.8.5.5
> 

  parent reply	other threads:[~2014-07-15 13:29 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-11 15:18 [Qemu-devel] [PATCH 0/4] make busybox udhcpc happy Joakim Tjernlund
2014-07-11 15:18 ` [Qemu-devel] [PATCH 1/4] qemu-user: Impl. setsockopt(SO_BINDTODEVICE) Joakim Tjernlund
2014-07-11 15:46   ` Peter Maydell
2014-07-11 16:07     ` Joakim Tjernlund
2014-07-11 17:02       ` Peter Maydell
2014-07-12  8:31         ` Joakim Tjernlund
2014-07-12  9:01           ` Peter Maydell
2014-07-12  9:48             ` Joakim Tjernlund
2014-07-12 10:42               ` Peter Maydell
2014-07-12 13:52                 ` Joakim Tjernlund
2014-07-12 15:13         ` Joakim Tjernlund
2014-07-12 15:47           ` Peter Maydell
2014-07-12 17:30             ` Joakim Tjernlund
2014-07-12 17:38               ` Peter Maydell
2014-07-12 18:11                 ` Joakim Tjernlund
2014-07-11 15:18 ` [Qemu-devel] [PATCH 2/4] linux-user: impl. sockaddr_ll Joakim Tjernlund
2014-07-11 16:00   ` Peter Maydell
2014-07-11 17:27     ` Joakim Tjernlund
2014-07-11 15:18 ` [Qemu-devel] [PATCH 3/4] alloca one extra byte sockets Joakim Tjernlund
2014-07-11 17:08   ` Peter Maydell
2014-07-15 13:29   ` Riku Voipio [this message]
2014-07-11 15:18 ` [Qemu-devel] [PATCH 4/4] ppc: remove excessive logging Joakim Tjernlund
2014-07-11 17:14   ` Peter Maydell
2014-07-11 18:15     ` Joakim Tjernlund
2014-07-11 18:22       ` Peter Maydell
2014-07-12  0:39         ` [Qemu-devel] [Qemu-ppc] " Alexander Graf
2014-07-12  8:24           ` Joakim Tjernlund
2014-07-16  9:17             ` Alex Bennée
2014-07-16 12:01               ` Peter Maydell
2014-07-12  8:58           ` Peter Maydell
2014-07-12  9:39             ` Alexander Graf
2014-07-12 10:40               ` Peter Maydell
2014-07-12 10:41                 ` Alexander Graf
2014-07-12 14:06                   ` Joakim Tjernlund
2014-07-16  7:55                     ` Riku Voipio
2014-07-16  8:32                       ` Joakim Tjernlund
2014-07-16  8:48                         ` Alexander Graf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140715132930.GB607@afflict.kos.to \
    --to=riku.voipio@iki.fi \
    --cc=Joakim.Tjernlund@transmode.se \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).