]> git.baikalelectronics.ru Git - kernel.git/commit
tcp-zerocopy: Update returned getsockopt() optlen.
authorArjun Roy <arjunroy@google.com>
Tue, 25 Feb 2020 20:38:54 +0000 (12:38 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 27 Feb 2020 04:24:22 +0000 (20:24 -0800)
commit6be85df59950ba73ec12c6f97a014b69a6f6d0e6
treeb9873f953bf4389af332e307fa55efa8d613f11e
parentdcb6d53d22684c4a94b7d0f69a26252352eb1a69
tcp-zerocopy: Update returned getsockopt() optlen.

TCP receive zerocopy currently does not update the returned optlen for
getsockopt() if the user passed in a larger than expected value.
Thus, userspace cannot properly determine if all the fields are set in
the passed-in struct. This patch sets the optlen for this case before
returning, in keeping with the expected operation of getsockopt().

Fixes: 90763c2f00f2 ("tcp-zerocopy: Return inq along with tcp receive zerocopy.")
Signed-off-by: Arjun Roy <arjunroy@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp.c