16 Jun, 2017
1 commit
-
A common pattern with skb_put() is to just want to memcpy()
some data into the new space, introduce skb_put_data() for
this.An spatch similar to the one for skb_put_zero() converts many
of the places using it:@@
identifier p, p2;
expression len, skb, data;
type t, t2;
@@
(
-p = skb_put(skb, len);
+p = skb_put_data(skb, data, len);
|
-p = (t)skb_put(skb, len);
+p = skb_put_data(skb, data, len);
)
(
p2 = (t2)p;
-memcpy(p2, data, len);
|
-memcpy(p, data, len);
)@@
type t, t2;
identifier p, p2;
expression skb, data;
@@
t *p;
...
(
-p = skb_put(skb, sizeof(t));
+p = skb_put_data(skb, data, sizeof(t));
|
-p = (t *)skb_put(skb, sizeof(t));
+p = skb_put_data(skb, data, sizeof(t));
)
(
p2 = (t2)p;
-memcpy(p2, data, sizeof(*p));
|
-memcpy(p, data, sizeof(*p));
)@@
expression skb, len, data;
@@
-memcpy(skb_put(skb, len), data, len);
+skb_put_data(skb, data, len);(again, manually post-processed to retain some comments)
Reviewed-by: Stephen Hemminger
Signed-off-by: Johannes Berg
Signed-off-by: David S. Miller
04 Jul, 2016
1 commit
-
LLCP skb tx and rx functions now use print_hex_dump_debug() making
these verbose traces controllable using dynamic debug.Signed-off-by: Thierry Escande
Signed-off-by: Samuel Ortiz
11 May, 2015
1 commit
-
In preparation for changing how struct net is refcounted
on kernel sockets pass the knowledge that we are creating
a kernel socket from sock_create_kern through to sk_alloc.Signed-off-by: "Eric W. Biederman"
Signed-off-by: David S. Miller
28 Nov, 2014
1 commit
-
Signed-off-by: Julien Lefrique
Signed-off-by: Samuel Ortiz
12 Jun, 2014
1 commit
-
There are several instances where a pskb_copy or __pskb_copy is
immediately followed by an skb_clone.Add a couple of new functions to allow the copy skb to be allocated
from the fclone cache and thus speed up subsequent skb_clone calls.Cc: Alexander Smirnov
Cc: Dmitry Eremin-Solenikov
Cc: Marek Lindner
Cc: Simon Wunderlich
Cc: Antonio Quartulli
Cc: Marcel Holtmann
Cc: Gustavo Padovan
Cc: Johan Hedberg
Cc: Arvid Brodin
Cc: Patrick McHardy
Cc: Pablo Neira Ayuso
Cc: Jozsef Kadlecsik
Cc: Lauro Ramos Venancio
Cc: Aloisio Almeida Jr
Cc: Samuel Ortiz
Cc: Jon Maloy
Cc: Allan Stephens
Cc: Andrew Hendry
Cc: Eric Dumazet
Reviewed-by: Christoph Paasch
Signed-off-by: Octavian Purdila
Signed-off-by: David S. Miller
20 May, 2014
1 commit
-
This allows for a more generic NFC sniffing by using SOCKPROTO_RAW
SOCK_RAW to read RAW NFC frames. This is for sniffing anything but LLCP
(HCI, NCI, etc...).Signed-off-by: Hiren Tandel
Signed-off-by: Rahul Tank
Signed-off-by: Samuel Ortiz
12 Apr, 2014
1 commit
-
Several spots in the kernel perform a sequence like:
skb_queue_tail(&sk->s_receive_queue, skb);
sk->sk_data_ready(sk, skb->len);But at the moment we place the SKB onto the socket receive queue it
can be consumed and freed up. So this skb->len access is potentially
to freed up memory.Furthermore, the skb->len can be modified by the consumer so it is
possible that the value isn't accurate.And finally, no actual implementation of this callback actually uses
the length argument. And since nobody actually cared about it's
value, lots of call sites pass arbitrary values in such as '0' and
even '1'.So just remove the length argument from the callback, that way there
is no confusion whatsoever and all of these use-after-free cases get
fixed as a side effect.Based upon a patch by Eric Dumazet and his suggestion to audit this
issue tree-wide.Signed-off-by: David S. Miller
15 Mar, 2014
2 commits
-
nfc_llcp_find_local() does not modify any list entry while iterating the list.
So use list_for_each_entry instead of list_for_each_entry_safe.Signed-off-by: Axel Lin
Signed-off-by: Samuel Ortiz -
This checking is common for all caller, so move the checking to one place.
Signed-off-by: Axel Lin
Signed-off-by: Samuel Ortiz
24 Feb, 2014
1 commit
-
Signed-off-by: Axel Lin
Signed-off-by: Samuel Ortiz
04 Jan, 2014
1 commit
-
If MIUX is not present in CONNECT or CC use default MIU value (128)
instead of one announced durring link setup.This was affecting Bluetooth handover with Android 4.3+ NCI stack.
Signed-off-by: Szymon Janc
Signed-off-by: Samuel Ortiz
11 Dec, 2013
1 commit
-
Several files refer to an old address for the Free Software Foundation
in the file header comment. Resolve by replacing the address with
the URL so that we do not have to keep
updating the header comments anytime the address changes.CC: linux-wireless@vger.kernel.org
CC: Lauro Ramos Venancio
CC: Aloisio Almeida Jr
CC: Samuel Ortiz
Signed-off-by: Jeff Kirsher
Signed-off-by: John W. Linville
14 Jun, 2013
5 commits
-
The WKS (Well Known Services) bitmask should be transmitted in big endian
order. Picky implementations will refuse to establish an LLCP link when the
WKS bit 0 is not set to 1. The vast majority of implementations out there
are not that picky though...Signed-off-by: Samuel Ortiz
-
In order to advertise our LLCP support properly and to follow the LLCP
specs requirements, we need to initialize the WKS (Well-Known Services)
bitfield to 1 as SAP 0 is the only mandatory supported service.Signed-off-by: Samuel Ortiz
-
When we receive a RNR, the remote is busy processing the last received
frame. We set a local flag for that, and we should send a SYMM when it
is set instead of sending any pending frame.Signed-off-by: Samuel Ortiz
-
In nfc_llcp_tx_work() the sk_buff is not freed when the llcp_sock
is null and the PDU is an I one.Signed-off-by: Thierry Escande
Signed-off-by: Samuel Ortiz -
This patch keeps the socket alive and therefore does not remove
it from the sockets list in the local until the DISC PDU has been
actually sent. Otherwise we would reply with DM PDUs before sending
the DISC one.Signed-off-by: Thierry Escande
Signed-off-by: Samuel Ortiz
26 Apr, 2013
1 commit
-
And stop making it optional. LLCP is a fundamental part of the NFC
specifications and making it optional does not make much sense.Signed-off-by: Samuel Ortiz