Skip to content

Commit 89a80ed

Browse files
committed
rxrpc: Use skb->len not skb->data_len
skb->len should be used rather than skb->data_len when referring to the amount of data in a packet. This will only cause a malfunction in the following cases: (1) We receive a jumbo packet (validation and splitting both are wrong). (2) We see if there's extra ACK info in an ACK packet (we think it's not there and just ignore it). Signed-off-by: David Howells <[email protected]>
1 parent b25de36 commit 89a80ed

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

net/rxrpc/input.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static bool rxrpc_validate_jumbo(struct sk_buff *skb)
127127
{
128128
struct rxrpc_skb_priv *sp = rxrpc_skb(skb);
129129
unsigned int offset = sp->offset;
130-
unsigned int len = skb->data_len;
130+
unsigned int len = skb->len;
131131
int nr_jumbo = 1;
132132
u8 flags = sp->hdr.flags;
133133

@@ -196,7 +196,7 @@ static void rxrpc_input_data(struct rxrpc_call *call, struct sk_buff *skb,
196196
u8 ack = 0, flags, annotation = 0;
197197

198198
_enter("{%u,%u},{%u,%u}",
199-
call->rx_hard_ack, call->rx_top, skb->data_len, seq);
199+
call->rx_hard_ack, call->rx_top, skb->len, seq);
200200

201201
_proto("Rx DATA %%%u { #%u f=%02x }",
202202
sp->hdr.serial, seq, sp->hdr.flags);
@@ -233,7 +233,7 @@ static void rxrpc_input_data(struct rxrpc_call *call, struct sk_buff *skb,
233233
next_subpacket:
234234
queued = false;
235235
ix = seq & RXRPC_RXTX_BUFF_MASK;
236-
len = skb->data_len;
236+
len = skb->len;
237237
if (flags & RXRPC_JUMBO_PACKET)
238238
len = RXRPC_JUMBO_DATALEN;
239239

@@ -444,7 +444,7 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb,
444444
}
445445

446446
offset = sp->offset + nr_acks + 3;
447-
if (skb->data_len >= offset + sizeof(buf.info)) {
447+
if (skb->len >= offset + sizeof(buf.info)) {
448448
if (skb_copy_bits(skb, offset, &buf.info, sizeof(buf.info)) < 0)
449449
return rxrpc_proto_abort("XAI", call, 0);
450450
rxrpc_input_ackinfo(call, skb, &buf.info);

0 commit comments

Comments
 (0)