From: Antonio Quartulli <ordex@autistici.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: check return type of unicast packet preparations
Date: Fri, 26 Jul 2013 21:19:45 +0200 [thread overview]
Message-ID: <781a231bf18987470c628b87d19469fa@autistici.org> (raw)
In-Reply-To: <1374864646-19268-1-git-send-email-linus.luessing@web.de>
Hi Linus,
since these are two fixes, are those based on top of next? That is
where they should be applied.
Cheers,
Il 26.07.2013 20:50 Linus Lüssing ha scritto:
> batadv_send_skb_prepare_unicast(_4addr) might reallocate the skb's
> data.
> And if it tries to do so then this can potentially fail.
>
> We shouldn't continue working on this skb in such a case.
>
> Signed-off-by: Linus Lüssing <linus.luessing@web.de>
> ---
> send.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/send.c b/send.c
> index d2cc507..9c9cab6 100644
> --- a/send.c
> +++ b/send.c
> @@ -266,11 +266,14 @@ static int batadv_send_skb_unicast(struct
> batadv_priv *bat_priv,
>
> switch (packet_type) {
> case BATADV_UNICAST:
> - batadv_send_skb_prepare_unicast(skb, orig_node);
> + if (!batadv_send_skb_prepare_unicast(skb, orig_node))
> + goto out;
> break;
> case BATADV_UNICAST_4ADDR:
> - batadv_send_skb_prepare_unicast_4addr(bat_priv, skb, orig_node,
> - packet_subtype);
> + if (!batadv_send_skb_prepare_unicast_4addr(bat_priv, skb,
> + orig_node,
> + packet_subtype))
> + goto out;
> break;
> default:
> /* this function supports UNICAST and UNICAST_4ADDR only. It
--
Antonio Quartulli
prev parent reply other threads:[~2013-07-26 19:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-26 18:50 [B.A.T.M.A.N.] [PATCH 1/2] batman-adv: check return type of unicast packet preparations Linus Lüssing
2013-07-26 18:50 ` [B.A.T.M.A.N.] [PATCH 2/2] batman-adv: fix potential kernel paging error for unicast transmissions Linus Lüssing
2013-07-26 19:19 ` Antonio Quartulli [this message]
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=781a231bf18987470c628b87d19469fa@autistici.org \
--to=ordex@autistici.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