From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Nguyen Dinh Phi <phind.uet@gmail.com>, bongsu.jeon@samsung.com
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"syzbot+6eb09d75211863f15e3e@syzkaller.appspotmail.com"
<syzbot+6eb09d75211863f15e3e@syzkaller.appspotmail.com>
Subject: Re: [PATCH] nfc: virtual_ncidev: Add variable to check if ndev is running
Date: Mon, 20 Nov 2023 11:45:05 +0100 [thread overview]
Message-ID: <d82e5a5f-1bbc-455e-b6a7-c636b23591f7@linaro.org> (raw)
In-Reply-To: <20d93e83-66c0-28d9-4426-a0d4c098f303@gmail.com>
On 20/11/2023 11:39, Nguyen Dinh Phi wrote:
>>>> mutex_lock(&vdev->mtx);
>>>> kfree_skb(vdev->send_buff);
>>>> vdev->send_buff = NULL;
>>>> + vdev->running = false;
>>>> mutex_unlock(&vdev->mtx);
>>>>
>>>> return 0;
>>>> @@ -50,7 +55,7 @@ static int virtual_nci_send(struct nci_dev *ndev, struct sk_buff *skb)
>>>> struct virtual_nci_dev *vdev = nci_get_drvdata(ndev);
>>>>
>>>> mutex_lock(&vdev->mtx);
>>>> - if (vdev->send_buff) {
>>>> + if (vdev->send_buff || !vdev->running) {
>>>
>>> Dear Krzysztof,
>>>
>>> I agree this defensive code.
>>> But i think NFC submodule has to avoid this situation.(calling send function of closed nci_dev)
>>> Could you check this?
>>
>> This code looks not effective. At this point vdev->send_buff is always
>> false, so the additional check would not bring any value.
>>
>> I don't see this fixing anything. Syzbot also does not seem to agree.
>>
>> Nguyen, please test your patches against syzbot *before* sending them.
>> If you claim this fixes the report, please provide me the link to syzbot
>> test results confirming it is fixed.
>>
>> I looked at syzbot dashboard and do not see this issue fixed with this
>> patch.
>>
>> Best regards,
>> Krzysztof
>>
>
> Hi Krzysztof,
>
> I've submitted it to syzbot, it is the test request that created at
> [2023/11/20 09:39] in dashboard link
> https://syzkaller.appspot.com/bug?extid=6eb09d75211863f15e3e
...and I see there two errors.
I don't know, maybe I miss something obvious (our brains like to do it
sometimes), but please explain me how this could fix anything?
Best regards,
Krzysztof
next prev parent reply other threads:[~2023-11-20 10:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-19 16:47 [PATCH] nfc: virtual_ncidev: Add variable to check if ndev is running Nguyen Dinh Phi
[not found] ` <CGME20231119164714epcas2p2c0480d014abc4f0f780c714a445881ca@epcms2p4>
2023-11-20 4:47 ` Bongsu Jeon
2023-11-20 9:06 ` Krzysztof Kozlowski
2023-11-20 10:39 ` Nguyen Dinh Phi
2023-11-20 10:45 ` Krzysztof Kozlowski [this message]
2023-11-20 18:23 ` Phi Nguyen
2023-11-20 18:29 ` Krzysztof Kozlowski
2023-11-20 18:32 ` Krzysztof Kozlowski
2023-11-20 18:44 ` Krzysztof Kozlowski
[not found] ` <CGME20231120184433epcas2p23e9f5db776d46ad8dd77a16dd326c1bc@epcms2p1>
2023-11-21 1:31 ` Bongsu Jeon
2023-11-21 7:05 ` Krzysztof Kozlowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d82e5a5f-1bbc-455e-b6a7-c636b23591f7@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=bongsu.jeon@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=phind.uet@gmail.com \
--cc=syzbot+6eb09d75211863f15e3e@syzkaller.appspotmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).