]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-5.15/nfc-nci-fix-kcov-check-in-nci_rx_work.patch
Fixes for 5.15
[thirdparty/kernel/stable-queue.git] / queue-5.15 / nfc-nci-fix-kcov-check-in-nci_rx_work.patch
1 From e943d3612f48832ca87cd787410b8e4772a43a67 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Sun, 5 May 2024 19:36:49 +0900
4 Subject: nfc: nci: Fix kcov check in nci_rx_work()
5
6 From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
7
8 [ Upstream commit 19e35f24750ddf860c51e51c68cf07ea181b4881 ]
9
10 Commit 7e8cdc97148c ("nfc: Add KCOV annotations") added
11 kcov_remote_start_common()/kcov_remote_stop() pair into nci_rx_work(),
12 with an assumption that kcov_remote_stop() is called upon continue of
13 the for loop. But commit d24b03535e5e ("nfc: nci: Fix uninit-value in
14 nci_dev_up and nci_ntf_packet") forgot to call kcov_remote_stop() before
15 break of the for loop.
16
17 Reported-by: syzbot <syzbot+0438378d6f157baae1a2@syzkaller.appspotmail.com>
18 Closes: https://syzkaller.appspot.com/bug?extid=0438378d6f157baae1a2
19 Fixes: d24b03535e5e ("nfc: nci: Fix uninit-value in nci_dev_up and nci_ntf_packet")
20 Suggested-by: Andrey Konovalov <andreyknvl@gmail.com>
21 Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
22 Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
23 Link: https://lore.kernel.org/r/6d10f829-5a0c-405a-b39a-d7266f3a1a0b@I-love.SAKURA.ne.jp
24 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
25 Signed-off-by: Sasha Levin <sashal@kernel.org>
26 ---
27 net/nfc/nci/core.c | 1 +
28 1 file changed, 1 insertion(+)
29
30 diff --git a/net/nfc/nci/core.c b/net/nfc/nci/core.c
31 index 20e01f20fdcb1..d26c21df0d283 100644
32 --- a/net/nfc/nci/core.c
33 +++ b/net/nfc/nci/core.c
34 @@ -1522,6 +1522,7 @@ static void nci_rx_work(struct work_struct *work)
35
36 if (!nci_plen(skb->data)) {
37 kfree_skb(skb);
38 + kcov_remote_stop();
39 break;
40 }
41
42 --
43 2.43.0
44