netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* pull request net: 2013-08-17b
@ 2013-08-17 11:04 Antonio Quartulli
  2013-08-17 11:04 ` [PATCH 1/2] batman-adv: properly end seq_read session Antonio Quartulli
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Antonio Quartulli @ 2013-08-17 11:04 UTC (permalink / raw)
  To: davem; +Cc: netdev, b.a.t.m.a.n

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(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] batman-adv: properly end seq_read session
  2013-08-17 11:04 pull request net: 2013-08-17b Antonio Quartulli
@ 2013-08-17 11:04 ` Antonio Quartulli
  2013-08-17 11:04 ` [PATCH 2/2] batman-adv: check return type of unicast packet preparations Antonio Quartulli
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Antonio Quartulli @ 2013-08-17 11:04 UTC (permalink / raw)
  To: davem; +Cc: netdev, b.a.t.m.a.n, Antonio Quartulli

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);
 }
-- 
1.8.1.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] batman-adv: check return type of unicast packet preparations
  2013-08-17 11:04 pull request net: 2013-08-17b Antonio Quartulli
  2013-08-17 11:04 ` [PATCH 1/2] batman-adv: properly end seq_read session Antonio Quartulli
@ 2013-08-17 11:04 ` Antonio Quartulli
  2013-08-17 17:31 ` [B.A.T.M.A.N.] pull request net: 2013-08-17b Antonio Quartulli
  2013-08-20 23:56 ` David Miller
  3 siblings, 0 replies; 6+ messages in thread
From: Antonio Quartulli @ 2013-08-17 11:04 UTC (permalink / raw)
  To: davem
  Cc: netdev, b.a.t.m.a.n, Linus Lüssing, Marek Lindner,
	Antonio Quartulli

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:
-- 
1.8.1.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [B.A.T.M.A.N.] pull request net: 2013-08-17b
  2013-08-17 11:04 pull request net: 2013-08-17b Antonio Quartulli
  2013-08-17 11:04 ` [PATCH 1/2] batman-adv: properly end seq_read session Antonio Quartulli
  2013-08-17 11:04 ` [PATCH 2/2] batman-adv: check return type of unicast packet preparations Antonio Quartulli
@ 2013-08-17 17:31 ` Antonio Quartulli
  2013-08-20 23:56 ` David Miller
  3 siblings, 0 replies; 6+ messages in thread
From: Antonio Quartulli @ 2013-08-17 17:31 UTC (permalink / raw)
  To: davem; +Cc: netdev, b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 745 bytes --]

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

-- 
Antonio Quartulli

..each of us alone is worth nothing..
Ernesto "Che" Guevara

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: pull request net: 2013-08-17b
  2013-08-17 11:04 pull request net: 2013-08-17b Antonio Quartulli
                   ` (2 preceding siblings ...)
  2013-08-17 17:31 ` [B.A.T.M.A.N.] pull request net: 2013-08-17b Antonio Quartulli
@ 2013-08-20 23:56 ` David Miller
  2013-08-20 23:58   ` David Miller
  3 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2013-08-20 23:56 UTC (permalink / raw)
  To: ordex; +Cc: netdev, b.a.t.m.a.n

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: pull request net: 2013-08-17b
  2013-08-20 23:56 ` David Miller
@ 2013-08-20 23:58   ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2013-08-20 23:58 UTC (permalink / raw)
  To: ordex; +Cc: netdev, b.a.t.m.a.n

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-08-20 23:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-17 11:04 pull request net: 2013-08-17b Antonio Quartulli
2013-08-17 11:04 ` [PATCH 1/2] batman-adv: properly end seq_read session Antonio Quartulli
2013-08-17 11:04 ` [PATCH 2/2] batman-adv: check return type of unicast packet preparations Antonio Quartulli
2013-08-17 17:31 ` [B.A.T.M.A.N.] pull request net: 2013-08-17b Antonio Quartulli
2013-08-20 23:56 ` David Miller
2013-08-20 23:58   ` David Miller

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).