<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/nfc/pn533, branch linux-4.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.9.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.9.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2023-01-07T11:07:29Z</updated>
<entry>
<title>nfc: pn533: Clear nfc_target before being used</title>
<updated>2023-01-07T11:07:29Z</updated>
<author>
<name>Minsuk Kang</name>
</author>
<published>2022-12-14T01:51:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9da4a0411f3455e3885831d0758bee3e3d565bbc'/>
<id>urn:sha1:9da4a0411f3455e3885831d0758bee3e3d565bbc</id>
<content type='text'>
[ Upstream commit 9f28157778ede0d4f183f7ab3b46995bb400abbe ]

Fix a slab-out-of-bounds read that occurs in nla_put() called from
nfc_genl_send_target() when target-&gt;sensb_res_len, which is duplicated
from an nfc_target in pn533, is too large as the nfc_target is not
properly initialized and retains garbage values. Clear nfc_targets with
memset() before they are used.

Found by a modified version of syzkaller.

BUG: KASAN: slab-out-of-bounds in nla_put
Call Trace:
 memcpy
 nla_put
 nfc_genl_dump_targets
 genl_lock_dumpit
 netlink_dump
 __netlink_dump_start
 genl_family_rcv_msg_dumpit
 genl_rcv_msg
 netlink_rcv_skb
 genl_rcv
 netlink_unicast
 netlink_sendmsg
 sock_sendmsg
 ____sys_sendmsg
 ___sys_sendmsg
 __sys_sendmsg
 do_syscall_64

Fixes: 673088fb42d0 ("NFC: pn533: Send ATR_REQ directly for active device detection")
Fixes: 361f3cb7f9cf ("NFC: DEP link hook implementation for pn533")
Signed-off-by: Minsuk Kang &lt;linuxlovemin@yonsei.ac.kr&gt;
Reviewed-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@linaro.org&gt;
Link: https://lore.kernel.org/r/20221214015139.119673-1-linuxlovemin@yonsei.ac.kr
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>nfc: pn533: Fix double free when pn533_fill_fragment_skbs() fails</title>
<updated>2021-11-26T10:48:39Z</updated>
<author>
<name>Chengfeng Ye</name>
</author>
<published>2021-11-05T13:36:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4a85c43a03d41a6cf5735ec406b5e1e245db2238'/>
<id>urn:sha1:4a85c43a03d41a6cf5735ec406b5e1e245db2238</id>
<content type='text'>
[ Upstream commit 9fec40f850658e00a14a7dd9e06f7fbc7e59cc4a ]

skb is already freed by dev_kfree_skb in pn533_fill_fragment_skbs,
but follow error handler branch when pn533_fill_fragment_skbs()
fails, skb is freed again, results in double free issue. Fix this
by not free skb in error path of pn533_fill_fragment_skbs.

Fixes: 963a82e07d4e ("NFC: pn533: Split large Tx frames in chunks")
Fixes: 93ad42020c2d ("NFC: pn533: Target mode Tx fragmentation support")
Signed-off-by: Chengfeng Ye &lt;cyeaa@connect.ust.hk&gt;
Reviewed-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>nfc: pn533: prevent potential memory corruption</title>
<updated>2021-05-22T08:40:26Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2021-04-02T11:44:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d0ad174f5c4a7eb758bc766abe02e0fdddc3b90e'/>
<id>urn:sha1:d0ad174f5c4a7eb758bc766abe02e0fdddc3b90e</id>
<content type='text'>
[ Upstream commit ca4d4c34ae9aa5c3c0da76662c5e549d2fc0cc86 ]

If the "type_a-&gt;nfcid_len" is too large then it would lead to memory
corruption in pn533_target_found_type_a() when we do:

	memcpy(nfc_tgt-&gt;nfcid1, tgt_type_a-&gt;nfcid_data, nfc_tgt-&gt;nfcid1_len);

Fixes: c3b1e1e8a76f ("NFC: Export NFCID1 from pn533")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>NFC: pn533: Fix wrong GFP flag usage</title>
<updated>2018-08-24T11:12:32Z</updated>
<author>
<name>Hans de Goede</name>
</author>
<published>2018-06-07T13:54:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5113cb753af23b4d0e89004ccf1cda3446bf6ac3'/>
<id>urn:sha1:5113cb753af23b4d0e89004ccf1cda3446bf6ac3</id>
<content type='text'>
[ Upstream commit ecc443c03fb14abfb8a6af5e3b2d43b5257e60f2 ]

pn533_recv_response() is an urb completion handler, so it must use
GFP_ATOMIC. pn533_usb_send_frame() OTOH runs from a regular sleeping
context, so the pn533_submit_urb_for_response() there (and only there)
can use the regular GFP_KERNEL flags.

BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1514134
Fixes: 9815c7cf22da ("NFC: pn533: Separate physical layer from ...")
Cc: Michael Thalmeier &lt;michael.thalmeier@hale.at&gt;
Signed-off-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>NFC: pn533: change order of free_irq and dev unregistration</title>
<updated>2018-03-22T08:17:46Z</updated>
<author>
<name>Andrey Rusalin</name>
</author>
<published>2016-12-28T17:10:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=14c63f375b9a94cb39f9b8a669a9d6e530e6bfa9'/>
<id>urn:sha1:14c63f375b9a94cb39f9b8a669a9d6e530e6bfa9</id>
<content type='text'>
[ Upstream commit 068a496c4525c638ffab56449d905b88ef97fe32 ]

Change order of free_irq and dev unregistration.
It fixes situation when device already unregistered and
an interrupt happens and nobody can handle it.

Signed-off-by: Andrey Rusalin &lt;arusalin@dev.rtsoft.ru&gt;
Signed-off-by: Samuel Ortiz &lt;sameo@linux.intel.com&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>NFC: pn533: double free on error in probe()</title>
<updated>2016-07-04T10:15:00Z</updated>
<author>
<name>Dan Carpenter</name>
</author>
<published>2016-05-17T07:32:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6d2f70cae481a2e8e85a244d3b2d36828dadff83'/>
<id>urn:sha1:6d2f70cae481a2e8e85a244d3b2d36828dadff83</id>
<content type='text'>
We can't pass devm_ allocated pointers to kfree() because they will be
freed again after the drive is unloaded.

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Samuel Ortiz &lt;sameo@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>NFC: pn533: handle interrupted commands in pn533_recv_frame</title>
<updated>2016-05-09T22:01:47Z</updated>
<author>
<name>Michael Thalmeier</name>
</author>
<published>2016-04-21T14:43:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b31d5103c33280738188c51e226224dff4401c7b'/>
<id>urn:sha1:b31d5103c33280738188c51e226224dff4401c7b</id>
<content type='text'>
When pn533_recv_frame is called from within abort_command
context the current  dev-&gt;cmd is not guaranteed to be set.

Additionally on receiving an error status we can omit frame
checking and simply schedule the workqueue.

Signed-off-by: Michael Thalmeier &lt;michael.thalmeier@hale.at&gt;
Signed-off-by: Samuel Ortiz &lt;sameo@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>NFC: pn533: reset poll modulation list before calling targets_found</title>
<updated>2016-05-09T22:01:16Z</updated>
<author>
<name>Michael Thalmeier</name>
</author>
<published>2016-04-21T14:43:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c952f915ce8567120ffdf12998ad0c945fbc93ac'/>
<id>urn:sha1:c952f915ce8567120ffdf12998ad0c945fbc93ac</id>
<content type='text'>
We need to reset the poll modulation list before calling
nfc_targets_found because otherwise userspace could run
before the modulation list is cleared and then get a "Cannot
activate target while polling" error upon calling activate_target.

Signed-off-by: Michael Thalmeier &lt;michael.thalmeier@hale.at&gt;
Signed-off-by: Samuel Ortiz &lt;sameo@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>NFC: pn533: i2c: do not call pn533_recv_frame with aborted commands</title>
<updated>2016-05-09T21:59:47Z</updated>
<author>
<name>Michael Thalmeier</name>
</author>
<published>2016-04-21T14:43:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=30f98489f54e027001cc9b27c59840975871de65'/>
<id>urn:sha1:30f98489f54e027001cc9b27c59840975871de65</id>
<content type='text'>
When a command gets aborted the pn533 core does not need any RX
frames that may be received until a new frame is sent.

Signed-off-by: Michael Thalmeier &lt;michael.thalmeier@hale.at&gt;
Signed-off-by: Samuel Ortiz &lt;sameo@linux.intel.com&gt;
</content>
</entry>
<entry>
<title>NFC: pn533: fix order of initialization</title>
<updated>2016-05-09T21:59:18Z</updated>
<author>
<name>Michael Thalmeier</name>
</author>
<published>2016-04-21T14:43:50Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b16931b13c67f06ca74cc8d02797de480dea348b'/>
<id>urn:sha1:b16931b13c67f06ca74cc8d02797de480dea348b</id>
<content type='text'>
Correctly call nfc_set_parent_dev before nfc_register_device.
Otherwise the driver will OOPS when being removed.

Signed-off-by: Michael Thalmeier &lt;michael.thalmeier@hale.at&gt;
Signed-off-by: Samuel Ortiz &lt;sameo@linux.intel.com&gt;
</content>
</entry>
</feed>
