android_kernel_samsung_a7y1.../net/nfc
Jia-Ju Bai 7a21cb4514 net: nfc: nci: fix a possible sleep-in-atomic-context bug in nci_uart_tty_receive()
[ Upstream commit b7ac893652cafadcf669f78452329727e4e255cc ]

The kernel may sleep while holding a spinlock.
The function call path (from bottom to top) in Linux 4.19 is:

net/nfc/nci/uart.c, 349:
	nci_skb_alloc in nci_uart_default_recv_buf
net/nfc/nci/uart.c, 255:
	(FUNC_PTR)nci_uart_default_recv_buf in nci_uart_tty_receive
net/nfc/nci/uart.c, 254:
	spin_lock in nci_uart_tty_receive

nci_skb_alloc(GFP_KERNEL) can sleep at runtime.
(FUNC_PTR) means a function pointer is called.

To fix this bug, GFP_KERNEL is replaced with GFP_ATOMIC for
nci_skb_alloc().

This bug is found by a static analysis tool STCheck written by myself.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-07 13:22:15 +02:00
..
hci A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
nci net: nfc: nci: fix a possible sleep-in-atomic-context bug in nci_uart_tty_receive() 2020-04-07 13:22:15 +02:00
af_nfc.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
core.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
digital_core.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
digital_dep.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
digital_technology.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
digital.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
llcp_commands.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
llcp_core.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
llcp_sock.c nfc: fix memory leak in llcp_sock_bind() 2020-04-07 08:07:14 +02:00
llcp.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
netlink.c nfc: netlink: fix double device reference drop 2020-04-07 11:48:24 +02:00
nfc.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
rawsock.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30