History log of /net/nfc/llcp_core.c
Revision Date Author Comments
bad93e9d4eeb0d2d6b79204d6cedc7f2e7b256f1 12-Jun-2014 Octavian Purdila <octavian.purdila@intel.com> net: add __pskb_copy_fclone and pskb_copy_for_clone

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 <alex.bluesman.smirnov@gmail.com>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Marek Lindner <mareklindner@neomailbox.ch>
Cc: Simon Wunderlich <sw@simonwunderlich.de>
Cc: Antonio Quartulli <antonio@meshcoding.com>
Cc: Marcel Holtmann <marcel@holtmann.org>
Cc: Gustavo Padovan <gustavo@padovan.org>
Cc: Johan Hedberg <johan.hedberg@gmail.com>
Cc: Arvid Brodin <arvid.brodin@alten.se>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Jon Maloy <jon.maloy@ericsson.com>
Cc: Allan Stephens <allan.stephens@windriver.com>
Cc: Andrew Hendry <andrew.hendry@gmail.com>
Cc: Eric Dumazet <edumazet@google.com>
Reviewed-by: Christoph Paasch <christoph.paasch@uclouvain.be>
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
57be1f3f3ec1ccab6432615ca161c4c9ece2a2aa 05-May-2014 Hiren Tandel <hirent@marvell.com> NFC: Add RAW socket type support for SOCKPROTO_RAW

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 <hirent@marvell.com>
Signed-off-by: Rahul Tank <rahult@marvell.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
676d23690fb62b5d51ba5d659935e9f7d9da9f8e 11-Apr-2014 David S. Miller <davem@davemloft.net> net: Fix use after free by removing length arg from sk_data_ready callbacks.

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 <davem@davemloft.net>
29e27dd86b5c4f8e6feb62d7b6a8491539ff1ef1 26-Feb-2014 Axel Lin <axel.lin@ingics.com> NFC: llcp: Use list_for_each_entry in nfc_llcp_find_local()

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 <axel.lin@ingics.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
3143a4ca610d6a3de0d8814ee6f5f7da6fc7fbfa 25-Feb-2014 Axel Lin <axel.lin@ingics.com> NFC: Move checking valid gb_len value to nfc_llcp_set_remote_gb

This checking is common for all caller, so move the checking to one place.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
0b51fc5633df563695f5021bc121a9df20b3eb14 22-Feb-2014 Axel Lin <axel.lin@ingics.com> NFC: Use LIST_HEAD() at appropriate places

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11bfb1c4b94fe24a83ebeae5c3310280f9606e0e 30-Nov-2013 Szymon Janc <szymon.janc@gmail.com> NFC: llcp: Use default MIU if none was specified on connect

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 <szymon.janc@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
98b32decc83ed3137e3ddbc918b102f8fc406b6d 06-Dec-2013 Jeff Kirsher <jeffrey.t.kirsher@intel.com> nfc: Fix FSF address in file headers

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 <http://www.gnu.org/licenses/> 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 <lauro.venancio@openbossa.org>
CC: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
CC: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4ca546e5545b7345b69e9331ecd53a1e4c6f7fe1 03-Jun-2013 Samuel Ortiz <sameo@linux.intel.com> NFC: llcp: Fix the well known services endianness

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 <sameo@linux.intel.com>
f768b34017cbe6e7690686514f682f076bb1f477 28-May-2013 Samuel Ortiz <sameo@linux.intel.com> NFC: llcp: Set the LLC Link Management well known service bit

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 <sameo@linux.intel.com>
2635a4bdfa8d513c531fa7d7a0ccafc1d6a9ff85 28-May-2013 Samuel Ortiz <sameo@linux.intel.com> NFC: llcp: Do not send pending Tx frames when the remote is not ready

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 <sameo@linux.intel.com>
f1b79dc8915ebf176d6f1fcfc4fee001b6d5ca46 05-Jun-2013 Thierry Escande <thierry.escande@linux.intel.com> NFC: Fix a potential memory leak

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 <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
17f7ae16aef1f58bc4af4c7a16b8778a91a30255 04-Jun-2013 Thierry Escande <thierry.escande@linux.intel.com> NFC: Keep socket alive until the DISC PDU is actually sent

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 <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
30cc4587659e1c9b1bfade8b2a757d91e04758ab 26-Apr-2013 Samuel Ortiz <sameo@linux.intel.com> NFC: Move LLCP code to the NFC top level diirectory

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 <sameo@linux.intel.com>