Skip to contentSkip to conversation

tcp repair: Fix unaligned access when repairing options (v2)

PATCH In review Pavel Emelyanov 2 participants 3 messages Apr 26, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tcp repair: Fix unaligned access when repairing options (v2)

Don't pick __u8/__u16 values directly from raw pointers, but instead use an array of structures of code:value pairs. This is OK, since the buffer we take options from is not an skb memory, but a user-to-kernel one.

For those options which don't require any value now, require this to be zero (for potential future extension of this API).

v2: Changed tcp_repair_opt to use two __u32-s as spotted by David Laight.

---
 include/linux/tcp.h |    5 ++++
 net/ipv4/tcp.c      |   60 +++++++++++++++++---------------------------------
 2 files changed, 26 insertions(+), 39 deletions(-)
include/linux/tcp.h +5 -0
index 9865936..d0401d9 100644
@@ -111,6 +111,11 @@ enum {
 #define TCP_QUEUE_SEQ		21
 #define TCP_REPAIR_OPTIONS	22
 
+struct tcp_repair_opt {
+	__u32	opt_code;
+	__u32	opt_val;
+};
+
 enum {
 	TCP_NO_QUEUE,
 	TCP_RECV_QUEUE,
net/ipv4/tcp.c +21 -39

88 lines not on this page · raw message

Signature · 1 line
1.5.5.6
maintainer
#1 lore raw

From: Pavel Emelyanov <[email protected]>
Date: Thu, 26 Apr 2012 12:50:57 +0400

Quoted 10 lines

Don't pick __u8/__u16 values directly from raw pointers, but instead use an array of structures of code:value pairs. This is OK, since the buffer we take options from is not an skb memory, but a user-to-kernel one.

For those options which don't require any value now, require this to be zero (for potential future extension of this API).

v2: Changed tcp_repair_opt to use two __u32-s as spotted by David Laight.

Hmmm, this didn't show up on netdev, I wonder why?

#2 lore raw
Quoted 7 lines · David Miller

From: Pavel Emelyanov <[email protected]>
Date: Thu, 26 Apr 2012 12:50:57 +0400

Quoted 4 lines

Don't pick __u8/__u16 values directly from raw pointers, but instead use an array of structures of code:value pairs. This is OK, since the buffer we take options from is not an skb memory, but a user-to-kernel one.

Quoted 8 lines
Quoted 6 lines

For those options which don't require any value now, require this to be zero (for potential future extension of this API).

v2: Changed tcp_repair_opt to use two __u32-s as spotted by David Laight.

Hmmm, this didn't show up on netdev, I wonder why?

So do I :( I haven't received any mail with errors from netdev, neither Parallels mail server reported any problems.

I will resubmit this one again.

Thanks,
Pavel