From: Sebastian Smolorz <Sebastian.Smolorz@gmx.de>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: xenomai@xenomai.org
Subject: Re: [PATCH v2 4/8] net/tcp: Copy data back to user buffer in rt_tcp_recvmsg
Date: Thu, 08 Nov 2018 09:09:04 +0100 [thread overview]
Message-ID: <2186966.bbFq7nfX5c@lenni> (raw)
In-Reply-To: <87bbe98f-1799-8dbc-0a7f-763380cace8c@siemens.com>
On 06.11.18, 19:52, Jan Kiszka wrote:
> On 06.11.18 11:00, Sebastian Smolorz via Xenomai wrote:
> > A bug in rt_tcp_recvmsg() prevented an application to receive data
> > over an RTTCP socket. Data was not copied back to the application's
> > buffer but rather into a temporary kernel buffer.
> >
> > Signed-off-by: Sebastian Smolorz <sebastian.smolorz@gmx.de>
> > ---
> >
> > kernel/drivers/net/stack/ipv4/tcp/tcp.c | 13 +++----------
> > 1 file changed, 3 insertions(+), 10 deletions(-)
> >
> > diff --git a/kernel/drivers/net/stack/ipv4/tcp/tcp.c
> > b/kernel/drivers/net/stack/ipv4/tcp/tcp.c index 2678e6a..3242a08
> > 100644
> > --- a/kernel/drivers/net/stack/ipv4/tcp/tcp.c
> > +++ b/kernel/drivers/net/stack/ipv4/tcp/tcp.c
> > @@ -2084,17 +2084,10 @@ static ssize_t rt_tcp_recvmsg(struct rtdm_fd
> > *fd, struct user_msghdr *msg, int m>
> > len = iov[0].iov_len;
> > if (len > 0) {
> >
> > - buf = xnmalloc(len);
> > - if (buf == NULL) {
> > - ret = -ENOMEM;
> > - goto out;
> > - }
> > - ret = rtdm_copy_from_user(fd, buf, iov[0].iov_base, len);
> > - if (!ret)
> > - ret = rt_tcp_read(fd, buf, len);
> > - xnfree(buf);
> > + buf = iov[0].iov_base;
> > + ret = rt_tcp_read(fd, buf, len);
>
> Does this go well with smap? IOW: Was everything testing on a system
> with smap support available and enabled?
smap was enabled. Tests were executed on an Atom E3845. cat /proc/
cpuinfo showed no smap flag.
> > }
> >
> > -out:
> > +
> >
> > rtdm_drop_iovec(iov, iov_fast);
> >
> > return ret;
--
Sebastian
next prev parent reply other threads:[~2018-11-08 8:09 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-06 10:00 [PATCH v2 0/8] net/tcp: Fix several bugs and allow rttcp to be built Sebastian Smolorz
2018-11-06 10:00 ` [PATCH v2 1/8] net/tcp: return ufd in rt_tcp_accept() Sebastian Smolorz
2018-11-06 10:00 ` [PATCH v2 2/8] net/tcp: fix listen() and shutdown() IOCTL calls Sebastian Smolorz
2018-11-06 10:00 ` [PATCH v2 3/8] net/tcp: Fix bug when obtaining RST socket's private structure from its rtdm_fd pointer Sebastian Smolorz
2018-11-06 10:00 ` [PATCH v2 4/8] net/tcp: Copy data back to user buffer in rt_tcp_recvmsg Sebastian Smolorz
2018-11-06 18:52 ` Jan Kiszka
2018-11-08 8:09 ` Sebastian Smolorz [this message]
2018-11-06 10:00 ` [PATCH v2 5/8] net/tcp: fix TCP connection termination Sebastian Smolorz
2018-11-06 10:00 ` [PATCH v2 6/8] net/tcp: Set valid flags in struct tcphdr on little and big endian machines Sebastian Smolorz
2018-11-06 10:00 ` [PATCH v2 7/8] net/tcp: return already copied number of bytes to recv() callers when peer socket terminates Sebastian Smolorz
2018-11-06 10:00 ` [PATCH v2 8/8] net/tcp: Allow choice of rttcp protocol in Kconfig Sebastian Smolorz
2018-11-16 6:28 ` [PATCH v2 0/8] net/tcp: Fix several bugs and allow rttcp to be built Jan Kiszka
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=2186966.bbFq7nfX5c@lenni \
--to=sebastian.smolorz@gmx.de \
--cc=jan.kiszka@siemens.com \
--cc=xenomai@xenomai.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.