* [PATCH net-next] net: tcp_probe: adapt tbuf size for recent changes
@ 2013-09-03 16:24 Daniel Borkmann
2013-09-04 4:55 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Daniel Borkmann @ 2013-09-03 16:24 UTC (permalink / raw)
To: davem; +Cc: netdev
With recent changes in tcp_probe module (e.g. f925d0a62d ("net: tcp_probe:
add IPv6 support")) we also need to take into account that tbuf needs to
be updated as format string will be further expanded. tbuf sits on the stack
in tcpprobe_read() function that is invoked when user space reads procfs
file /proc/net/tcpprobe, hence not fast path as in jtcp_rcv_established().
Having a size similarly as in sctp_probe module of 256 bytes is fully
sufficient for that, we need theoretical maximum of 252 bytes otherwise we
could get truncated.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
---
net/ipv4/tcp_probe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv4/tcp_probe.c b/net/ipv4/tcp_probe.c
index 622a437..1f6aa54 100644
--- a/net/ipv4/tcp_probe.c
+++ b/net/ipv4/tcp_probe.c
@@ -218,7 +218,7 @@ static ssize_t tcpprobe_read(struct file *file, char __user *buf,
return -EINVAL;
while (cnt < len) {
- char tbuf[164];
+ char tbuf[256];
int width;
/* Wait for data in buffer */
--
1.7.11.7
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] net: tcp_probe: adapt tbuf size for recent changes
2013-09-03 16:24 [PATCH net-next] net: tcp_probe: adapt tbuf size for recent changes Daniel Borkmann
@ 2013-09-04 4:55 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-09-04 4:55 UTC (permalink / raw)
To: dborkman; +Cc: netdev
From: Daniel Borkmann <dborkman@redhat.com>
Date: Tue, 3 Sep 2013 18:24:02 +0200
> With recent changes in tcp_probe module (e.g. f925d0a62d ("net: tcp_probe:
> add IPv6 support")) we also need to take into account that tbuf needs to
> be updated as format string will be further expanded. tbuf sits on the stack
> in tcpprobe_read() function that is invoked when user space reads procfs
> file /proc/net/tcpprobe, hence not fast path as in jtcp_rcv_established().
> Having a size similarly as in sctp_probe module of 256 bytes is fully
> sufficient for that, we need theoretical maximum of 252 bytes otherwise we
> could get truncated.
>
> Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-09-04 4:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-03 16:24 [PATCH net-next] net: tcp_probe: adapt tbuf size for recent changes Daniel Borkmann
2013-09-04 4:55 ` David Miller
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).