From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCH] batman-adv: Linearize fragment packets before merge
Date: Sat, 5 Feb 2011 22:41:58 +0100 [thread overview]
Message-ID: <1296942118-4875-1-git-send-email-sven@narfation.org> (raw)
We access the data inside the skbs of two fragments directly using memmove
during the merge. The data of the skb could span over multiple skb pages. An
direct access without knowledge about the pages would lead to an invalid memory
access.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
batman-adv/unicast.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/batman-adv/unicast.c b/batman-adv/unicast.c
index 6a9ab61..04b152c 100644
--- a/batman-adv/unicast.c
+++ b/batman-adv/unicast.c
@@ -50,6 +50,11 @@ static struct sk_buff *frag_merge_packet(struct list_head *head,
skb = tfp->skb;
}
+ if (skb_linearize(skb) < 0 || skb_linearize(tmp_skb) < 0) {
+ kfree_skb(tfp->skb);
+ return NULL;
+ }
+
skb_pull(tmp_skb, sizeof(struct unicast_frag_packet));
if (pskb_expand_head(skb, 0, tmp_skb->len, GFP_ATOMIC) < 0) {
/* free buffered skb, skb will be freed later */
--
1.7.2.3
next reply other threads:[~2011-02-05 21:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-05 21:41 Sven Eckelmann [this message]
2011-02-06 23:24 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Linearize fragment packets before merge Marek Lindner
-- strict thread matches above, loose matches on Subject: below --
2011-02-07 23:59 [B.A.T.M.A.N.] pull request: batman-adv 2011-02-08 Sven Eckelmann
2011-02-07 23:59 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Linearize fragment packets before merge Sven Eckelmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1296942118-4875-1-git-send-email-sven@narfation.org \
--to=sven@narfation.org \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox