From: James Prestwood <prestwoj@gmail.com>
To: Denis Kenzior <denkenz@gmail.com>, iwd@lists.linux.dev
Subject: Re: [PATCH 2/2] dpp: check for non-utf8 SSID's in scan results
Date: Thu, 16 Nov 2023 07:52:54 -0800 [thread overview]
Message-ID: <957e1fdd-6573-4d01-a3aa-04caaca4352d@gmail.com> (raw)
In-Reply-To: <210c60de-f02c-4ba4-bb66-17c54a2f0f29@gmail.com>
Hi Denis,
On 11/16/23 07:51, Denis Kenzior wrote:
> Hi James,
>
> On 11/16/23 09:44, James Prestwood wrote:
>> In theory this shouldn't be possible because the configuration object
>> validates that the SSID is utf-8. But it doesn't hurt to check
>> especially since we can't control what the kernel sends us.
>> ---
>> src/dpp.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/src/dpp.c b/src/dpp.c
>> index 18b2a7c6..8da79603 100644
>> --- a/src/dpp.c
>> +++ b/src/dpp.c
>> @@ -884,6 +884,9 @@ static bool dpp_scan_results(int err, struct
>> l_queue *bss_list,
>> /* Purely for grabbing the SSID */
>> bss = l_queue_peek_head(bss_list);
>> + if (L_WARN_ON(!util_ssid_is_utf8(bss->ssid_len, bss->ssid)))
>> + goto reset;
>> +
>
> This still seems brittle. You have the validated SSID from the DPP
> session, shouldn't you be storing that and using it to filter the scan
> results? There's no guarantee that a filtered active scan is going to
> return only the SSID you asked for (lets say a misbehaving or
> malicious AP), so assuming that the first BSS in the scan results list
> is the SSID you want isn't really guaranteed.
Sure I can do that. I was banking on the kernel filtering, but we can be
100% sure and just store the SSID in the dpp_sm.
>
>> memcpy(ssid, bss->ssid, bss->ssid_len);
>> ssid[bss->ssid_len] = '\0';
>
> Regards,
> -Denis
next prev parent reply other threads:[~2023-11-16 15:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-16 15:44 [PATCH 1/2] dpp: check that DPP is running in station watch James Prestwood
2023-11-16 15:44 ` [PATCH 2/2] dpp: check for non-utf8 SSID's in scan results James Prestwood
2023-11-16 15:51 ` Denis Kenzior
2023-11-16 15:52 ` James Prestwood [this message]
2023-11-16 15:48 ` [PATCH 1/2] dpp: check that DPP is running in station watch Denis Kenzior
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=957e1fdd-6573-4d01-a3aa-04caaca4352d@gmail.com \
--to=prestwoj@gmail.com \
--cc=denkenz@gmail.com \
--cc=iwd@lists.linux.dev \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).