Skip to content

Commit a4e390f

Browse files
rddunlapZhengShunQian
authored andcommitted
tcp: identify cryptic messages as TCP seq # bugs
[ Upstream commit e56b8ce ] Attempt to make cryptic TCP seq number error messages clearer by (1) identifying the source of the message as "TCP", (2) identifying the errors as "seq # bug", and (3) grouping the field identifiers and values by separating them with commas. E.g., the following message is changed from: recvmsg bug 2: copied 73BCB6CD seq 70F17CBE rcvnxt 73BCB9AA fl 0 WARNING: CPU: 2 PID: 1501 at /linux/net/ipv4/tcp.c:1881 tcp_recvmsg+0x649/0xb90 to: TCP recvmsg seq # bug 2: copied 73BCB6CD, seq 70F17CBE, rcvnxt 73BCB9AA, fl 0 WARNING: CPU: 2 PID: 1501 at /linux/net/ipv4/tcp.c:2011 tcp_recvmsg+0x694/0xba0 Suggested-by: 積丹尼 Dan Jacobson <[email protected]> Signed-off-by: Randy Dunlap <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9a7c15d commit a4e390f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/ipv4/tcp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,7 +1659,7 @@ int tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock,
16591659
* shouldn't happen.
16601660
*/
16611661
if (WARN(before(*seq, TCP_SKB_CB(skb)->seq),
1662-
"recvmsg bug: copied %X seq %X rcvnxt %X fl %X\n",
1662+
"TCP recvmsg seq # bug: copied %X, seq %X, rcvnxt %X, fl %X\n",
16631663
*seq, TCP_SKB_CB(skb)->seq, tp->rcv_nxt,
16641664
flags))
16651665
break;
@@ -1672,7 +1672,7 @@ int tcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, int nonblock,
16721672
if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN)
16731673
goto found_fin_ok;
16741674
WARN(!(flags & MSG_PEEK),
1675-
"recvmsg bug 2: copied %X seq %X rcvnxt %X fl %X\n",
1675+
"TCP recvmsg seq # bug 2: copied %X, seq %X, rcvnxt %X, fl %X\n",
16761676
*seq, TCP_SKB_CB(skb)->seq, tp->rcv_nxt, flags);
16771677
}
16781678

0 commit comments

Comments
 (0)