Skip to content

Commit 70796fb

Browse files
jrfastabborkmann
authored andcommitted
bpf, sockmap: Use truesize with sk_rmem_schedule()
We use skb->size with sk_rmem_scheduled() which is not correct. Instead use truesize to align with socket and tcp stack usage of sk_rmem_schedule. Suggested-by: Daniel Borkman <[email protected]> Signed-off-by: John Fastabend <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Reviewed-by: Jakub Sitnicki <[email protected]> Link: https://lore.kernel.org/bpf/160556570616.73229.17003722112077507863.stgit@john-XPS-13-9370
1 parent 36cd0e6 commit 70796fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/core/skmsg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ static int sk_psock_skb_ingress(struct sk_psock *psock, struct sk_buff *skb)
411411
msg = kzalloc(sizeof(*msg), __GFP_NOWARN | GFP_ATOMIC);
412412
if (unlikely(!msg))
413413
return -EAGAIN;
414-
if (!sk_rmem_schedule(sk, skb, skb->len)) {
414+
if (!sk_rmem_schedule(sk, skb, skb->truesize)) {
415415
kfree(msg);
416416
return -EAGAIN;
417417
}

0 commit comments

Comments
 (0)