Hello David,
here is the correct pull request for net/linux-3.11.
As described earlier this patchset contains a change which properly ends a seq_read cycle and another change that takes care of aborting TX operations if the skb preparation should faile.
Please pull or let me know if there is any problem.
(about merge of net into net-next?)
Thanks a lot! Antonio
The following changes since commit 0f7dd1aa8f959216f1faa71513b9d3c1a9065e5a:
Merge tag 'clk-fixes-for-linus' of git://git.linaro.org/people/mturquette/linux (2013-08-16 10:00:18 -0700)
are available in the git repository at:
git://git.open-mesh.org/linux-merge.git tags/batman-adv-fix-for-davem
for you to fetch changes up to d823c33c0717cffea2dc73180ef780bf626908c7:
batman-adv: check return type of unicast packet preparations (2013-08-17 12:52:27 +0200)
---------------------------------------------------------------- Included change: - Add a missing skb_abort_seq_read() to properly close seq_read session - Check if the skb has been correctly prepared before going on
---------------------------------------------------------------- Antonio Quartulli (1): batman-adv: properly end seq_read session
Linus Lüssing (1): batman-adv: check return type of unicast packet preparations
net/batman-adv/main.c | 1 + net/batman-adv/unicast.c | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-)
A missing skb_abort_seq_read() has to be added in order to properly close the seq_read session initiated with skb_prepare_seq_read().
Signed-off-by: Antonio Quartulli ordex@autistici.org --- net/batman-adv/main.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c index 08125f3..51aafd6 100644 --- a/net/batman-adv/main.c +++ b/net/batman-adv/main.c @@ -473,6 +473,7 @@ __be32 batadv_skb_crc32(struct sk_buff *skb, u8 *payload_ptr) crc = crc32c(crc, data, len); consumed += len; } + skb_abort_seq_read(&st);
return htonl(crc); }
From: Linus Lüssing linus.luessing@web.de
batadv_unicast(_4addr)_prepare_skb 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 Signed-off-by: Marek Lindner lindner_marek@yahoo.de Acked-by: Antonio Quartulli ordex@autistici.org Signed-off-by: Antonio Quartulli ordex@autistici.org --- net/batman-adv/unicast.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/net/batman-adv/unicast.c b/net/batman-adv/unicast.c index 688a041..857e1b8 100644 --- a/net/batman-adv/unicast.c +++ b/net/batman-adv/unicast.c @@ -432,12 +432,16 @@ find_router:
switch (packet_type) { case BATADV_UNICAST: - batadv_unicast_prepare_skb(skb, orig_node); + if (!batadv_unicast_prepare_skb(skb, orig_node)) + goto out; + header_len = sizeof(struct batadv_unicast_packet); break; case BATADV_UNICAST_4ADDR: - batadv_unicast_4addr_prepare_skb(bat_priv, skb, orig_node, - packet_subtype); + if (!batadv_unicast_4addr_prepare_skb(bat_priv, skb, orig_node, + packet_subtype)) + goto out; + header_len = sizeof(struct batadv_unicast_4addr_packet); break; default:
On Sat, Aug 17, 2013 at 01:04:44PM +0200, Antonio Quartulli wrote:
Hello David,
here is the correct pull request for net/linux-3.11.
As described earlier this patchset contains a change which properly ends a seq_read cycle and another change that takes care of aborting TX operations if the skb preparation should faile.
Hi David,
sorry for the noise but after analysing the code once more we realised that skb_abort_seq_read() is not needed anymore for >=linux-3.11.
Therefore one of the patches in this pull request is not needed.
I will send a third pull request with the correct patch only.
Thanks, Antonio
From: Antonio Quartulli ordex@autistici.org Date: Sat, 17 Aug 2013 13:04:44 +0200
git://git.open-mesh.org/linux-merge.git tags/batman-adv-fix-for-davem
...
Antonio Quartulli (1): batman-adv: properly end seq_read session
Linus Lüssing (1): batman-adv: check return type of unicast packet preparations
The change by Linus is not in that tree.
When I pulled I only got the seq_rea fix.
From: David Miller davem@davemloft.net Date: Tue, 20 Aug 2013 16:56:49 -0700 (PDT)
From: Antonio Quartulli ordex@autistici.org Date: Sat, 17 Aug 2013 13:04:44 +0200
git://git.open-mesh.org/linux-merge.git tags/batman-adv-fix-for-davem
...
Antonio Quartulli (1): batman-adv: properly end seq_read session
Linus Lüssing (1): batman-adv: check return type of unicast packet preparations
The change by Linus is not in that tree.
When I pulled I only got the seq_rea fix.
Nevermind, in fact, I see that only Linus's unicast fix was in there, which is what you intended.
Sorry for the false alarm.
b.a.t.m.a.n@lists.open-mesh.org