From: Antonio Quartulli <antonio@meshcoding.com>
To: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH] batman-adv: bugfix for kernel crash in batadv_tt_local_table_free
Date: Thu, 19 Mar 2015 17:01:33 +0100 [thread overview]
Message-ID: <550AF2DD.5000707@meshcoding.com> (raw)
In-Reply-To: <OF5389A718.644E8229-ONC1257E0D.00566F9A-C1257E0D.0056A5A0@phoenixcontact.com>
[-- Attachment #1: Type: text/plain, Size: 1574 bytes --]
Hi Andreas,
On 19/03/15 16:46, Andreas Pape wrote:
> This missing check lead to a kernel crash when a hard_if is removed on a
> node forwarding
> untagged and tagged traffic (VLANID 0) to and from the mesh network.
>
Did you actually see the crash? if so, can you please report the stacktrace?
When creating bat0 (untagged interface), a "fake" vlan object is created
with vid = BATADV_NO_FLAGS, therefore in this context the object "vlan"
should never be NULL because there is always an object to retrieve.
Cheers,
> Signed-off-by: Andreas Pape <apape@phoenixcontact.com>
> ---
> translation-table.c | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/translation-table.c b/translation-table.c
> index b20812b..4d3ab8d 100644
> --- a/translation-table.c
> +++ b/translation-table.c
> @@ -1143,8 +1143,10 @@ static void batadv_tt_local_table_free(struct
> batadv_priv *bat_priv)
> /* decrease the reference held for this vlan */
> vlan = batadv_softif_vlan_get(bat_priv,
> tt_common_entry->vid);
> - batadv_softif_vlan_free_ref(vlan);
> - batadv_softif_vlan_free_ref(vlan);
> + if (vlan) {
> + batadv_softif_vlan_free_ref(vlan);
> + batadv_softif_vlan_free_ref(vlan);
> + }
>
> batadv_tt_local_entry_free_ref(tt_local);
> }
>
--
Antonio Quartulli
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2015-03-19 16:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-19 15:46 [B.A.T.M.A.N.] [PATCH] batman-adv: bugfix for kernel crash in batadv_tt_local_table_free Andreas Pape
2015-03-19 16:01 ` Antonio Quartulli [this message]
2015-03-19 16:54 ` [B.A.T.M.A.N.] Antwort: " Andreas Pape
2015-04-22 2:24 ` Antonio Quartulli
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=550AF2DD.5000707@meshcoding.com \
--to=antonio@meshcoding.com \
--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;
as well as URLs for NNTP newsgroup(s).