Re: [B.A.T.M.A.N.] [PATCHv2 next] batman-adv: fix potential kernel paging errors for unicast transmissions

Marek Lindner
2013-08-05T08:36:18Z

On Friday, August 02, 2013 20:44:55 Linus Lüssing wrote:
> There are several functions which might reallocate skb data. Currently
> some places keep reusing their old ethhdr pointer regardless of whether
> they became invalid after such a reallocation or not. This potentially
> leads to kernel paging errors.
>
> This patch fixes these by refetching the ethdr pointer after the
> potential reallocations.

As discussed on IRC, please fix a similar problem in
batadv_gw_is_dhcp_target(). I know this bug wasn't created by your patch but I
found it while reviewing your code and looking for similar cases. Should be
simple to fix as well.

> @@ -326,7 +326,9 @@ static bool batadv_unicast_push_and_fill_skb(struct
> sk_buff *skb, int hdr_size, * @skb: the skb containing the payload to
> encapsulate
> * @orig_node: the destination node
> *
> - * Returns false if the payload could not be encapsulated or true
> otherwise +
> * Return false if the payload could not be encapsulated or
> true otherwise.

Don't change "returns" to "return".

> @@ -343,7 +345,9 @@ static bool batadv_unicast_prepare_skb(struct sk_buff
> *skb, * @orig_node: the destination node
> * @packet_subtype: the batman 4addr packet subtype to use
> *
> - * Returns false if the payload could not be encapsulated or true
> otherwise +
> * Return false if the payload could not be encapsulated or
> true otherwise.

Same here.

Cheers,
Marek