<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/nfc/virtual_ncidev.c, branch v6.1.124</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.124</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.124'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2024-07-11T10:47:18+00:00</updated>
<entry>
<title>nfc/nci: Add the inconsistency check between the input data length and count</title>
<updated>2024-07-11T10:47:18+00:00</updated>
<author>
<name>Edward Adam Davis</name>
<email>eadavis@qq.com</email>
</author>
<published>2024-05-28T03:12:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=41f5e2840cd0629f049ce5ce2f8dd10a8299de42'/>
<id>urn:sha1:41f5e2840cd0629f049ce5ce2f8dd10a8299de42</id>
<content type='text'>
[ Upstream commit 068648aab72c9ba7b0597354ef4d81ffaac7b979 ]

write$nci(r0, &amp;(0x7f0000000740)=ANY=[@ANYBLOB="610501"], 0xf)

Syzbot constructed a write() call with a data length of 3 bytes but a count value
of 15, which passed too little data to meet the basic requirements of the function
nci_rf_intf_activated_ntf_packet().

Therefore, increasing the comparison between data length and count value to avoid
problems caused by inconsistent data length and count.

Reported-and-tested-by: syzbot+71bfed2b2bcea46c98f2@syzkaller.appspotmail.com
Signed-off-by: Edward Adam Davis &lt;eadavis@qq.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: virtual_ncidev: Fix memory leak in virtual_nci_send()</title>
<updated>2022-10-21T04:13:04+00:00</updated>
<author>
<name>Shang XiaoJing</name>
<email>shangxiaojing@huawei.com</email>
</author>
<published>2022-10-20T03:05:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e840d8f4a1b323973052a1af5ad4edafcde8ae3d'/>
<id>urn:sha1:e840d8f4a1b323973052a1af5ad4edafcde8ae3d</id>
<content type='text'>
skb should be free in virtual_nci_send(), otherwise kmemleak will report
memleak.

Steps for reproduction (simulated in qemu):
	cd tools/testing/selftests/nci
	make
	./nci_dev

BUG: memory leak
unreferenced object 0xffff888107588000 (size 208):
  comm "nci_dev", pid 206, jiffies 4294945376 (age 368.248s)
  hex dump (first 32 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
  backtrace:
    [&lt;000000008d94c8fd&gt;] __alloc_skb+0x1da/0x290
    [&lt;00000000278bc7f8&gt;] nci_send_cmd+0xa3/0x350
    [&lt;0000000081256a22&gt;] nci_reset_req+0x6b/0xa0
    [&lt;000000009e721112&gt;] __nci_request+0x90/0x250
    [&lt;000000005d556e59&gt;] nci_dev_up+0x217/0x5b0
    [&lt;00000000e618ce62&gt;] nfc_dev_up+0x114/0x220
    [&lt;00000000981e226b&gt;] nfc_genl_dev_up+0x94/0xe0
    [&lt;000000009bb03517&gt;] genl_family_rcv_msg_doit.isra.14+0x228/0x2d0
    [&lt;00000000b7f8c101&gt;] genl_rcv_msg+0x35c/0x640
    [&lt;00000000c94075ff&gt;] netlink_rcv_skb+0x11e/0x350
    [&lt;00000000440cfb1e&gt;] genl_rcv+0x24/0x40
    [&lt;0000000062593b40&gt;] netlink_unicast+0x43f/0x640
    [&lt;000000001d0b13cc&gt;] netlink_sendmsg+0x73a/0xbf0
    [&lt;000000003272487f&gt;] __sys_sendto+0x324/0x370
    [&lt;00000000ef9f1747&gt;] __x64_sys_sendto+0xdd/0x1b0
    [&lt;000000001e437841&gt;] do_syscall_64+0x3f/0x90

Fixes: e624e6c3e777 ("nfc: Add a virtual nci device driver")
Signed-off-by: Shang XiaoJing &lt;shangxiaojing@huawei.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@linaro.org&gt;
Link: https://lore.kernel.org/r/20221020030505.15572-1-shangxiaojing@huawei.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>nfc: virtual_ncidev: change default device permissions</title>
<updated>2021-11-26T19:14:31+00:00</updated>
<author>
<name>Thadeu Lima de Souza Cascardo</name>
<email>cascardo@canonical.com</email>
</author>
<published>2021-11-25T14:14:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c26381f97e2a7df43826150dc7d4c207bd6794a5'/>
<id>urn:sha1:c26381f97e2a7df43826150dc7d4c207bd6794a5</id>
<content type='text'>
Device permissions is S_IALLUGO, with many unnecessary bits. Remove them
and also remove read and write permissions from group and others.

Before the change:
crwsrwsrwt    1 0        0          10, 125 Nov 25 13:59 /dev/virtual_nci

After the change:
crw-------    1 0        0          10, 125 Nov 25 14:05 /dev/virtual_nci

Signed-off-by: Thadeu Lima de Souza Cascardo &lt;cascardo@canonical.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.com&gt;
Reviewed-by: Bongsu Jeon &lt;bongsu.jeon@samsung.com&gt;
Link: https://lore.kernel.org/r/20211125141457.716921-1-cascardo@canonical.com
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
<entry>
<title>nfc: virtual_ncidev: Use wait queue instead of polling</title>
<updated>2021-08-18T09:17:57+00:00</updated>
<author>
<name>Bongsu Jeon</name>
<email>bongsu.jeon@samsung.com</email>
</author>
<published>2021-08-17T13:28:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8675569d73cab15e5127d1f228afd3317cbeb5bf'/>
<id>urn:sha1:8675569d73cab15e5127d1f228afd3317cbeb5bf</id>
<content type='text'>
In previous version, the user level virtual device application that used
this driver should have the polling scheme to read a NCI frame.
To remove this polling scheme, use Wait Queue.

Signed-off-by: Bongsu Jeon &lt;bongsu.jeon@samsung.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>nfc: virtual_ncidev: constify pointer to nfc_dev</title>
<updated>2021-07-29T11:28:03+00:00</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzysztof.kozlowski@canonical.com</email>
</author>
<published>2021-07-29T10:40:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=83428dbbac514f33597e6c8c571969027b3fac82'/>
<id>urn:sha1:83428dbbac514f33597e6c8c571969027b3fac82</id>
<content type='text'>
virtual_ncidev_ioctl() does not modify struct nfc_dev, so local variable
can be a pointer to const.

Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>nfc: constify nci_ops</title>
<updated>2021-07-25T08:21:20+00:00</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzysztof.kozlowski@canonical.com</email>
</author>
<published>2021-07-24T21:47:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b9c28286d8f1822a10f702fcefe0b8a1db4e6917'/>
<id>urn:sha1:b9c28286d8f1822a10f702fcefe0b8a1db4e6917</id>
<content type='text'>
The struct nci_ops is modified by NFC core in only one case:
nci_allocate_device() receives too many proprietary commands (prop_ops)
to configure.  This is a build time known constrain, so a graceful
handling of such case is not necessary.

Instead, fail the nci_allocate_device() and add BUILD_BUG_ON() to places
which set these.

This allows to constify the struct nci_ops (consisting of function
pointers) for correctness and safety.

Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>nfc: Add a virtual nci device driver</title>
<updated>2021-01-30T02:03:33+00:00</updated>
<author>
<name>Bongsu Jeon</name>
<email>bongsu.jeon@samsung.com</email>
</author>
<published>2021-01-27T13:08:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e624e6c3e777fb3dfed036b9da4d433aee3608a5'/>
<id>urn:sha1:e624e6c3e777fb3dfed036b9da4d433aee3608a5</id>
<content type='text'>
NCI virtual device simulates a NCI device to the user. It can be used to
validate the NCI module and applications. This driver supports
communication between the virtual NCI device and NCI module.

Signed-off-by: Bongsu Jeon &lt;bongsu.jeon@samsung.com&gt;
Signed-off-by: Jakub Kicinski &lt;kuba@kernel.org&gt;
</content>
</entry>
</feed>
