public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: James Prestwood <prestwoj@gmail.com>, iwd@lists.linux.dev
Subject: Re: [PATCH v2 1/4] knownnetworks: network: support updating known network settings
Date: Tue, 19 Dec 2023 10:31:59 -0600	[thread overview]
Message-ID: <f2d94ed6-0902-4dcd-bc7a-b7c58e7e61e3@gmail.com> (raw)
In-Reply-To: <ee339749-46cd-4927-a3fc-ff80924a5f70@gmail.com>

Hi James,

>>
>> Ehh, I'm not so sure about this. handshake_state_set_8021x_config() does a 
>> shallow copy of the l_settings object.  I think eap state machine will make 
>> copies of the info it needs, but...
> Ok, yes this wouldn't work as-is then, but we could clone it instead.
>>
>>>     to the profile if there is an ongoing connection. This is a much
>>>     simpler approach (unless I'm missing something). Only questionable
>>
>> Also, netconfig_load_settings is called very early in 
>> __station_connect_network, so even if you overwrite the settings object here, 
>> it is probably too late to take any effect.
> 
> For this case I'm not sure there is any difference. Keeping the existing 
> settings or replacing won't change netconfig once __station_connect_network() is 
> called. We would need some changes in station to load the settings again after 
> the connection. I'm not sure trying to solve this specific case of settings 

I guess I'm then confused on what you're trying to accomplish with this patch. 
I thought you were trying to take care of the inherent race between:
	1. Connect
	2. Write provisioning file

The result of that race is that any changes to the provisioning file are not 
taken into consideration when connect proceeds.  In particular, any networking 
related settings are ignored.  Note that today we have a bunch of logic with 
several paths for syncing to disk that take care that the settings are not 
actually lost (well, best effort anyway) when the connection is successfully 
established:
	- Special logic to update Autoconnect inside knownnetwork.c
	- Special logic for updating just the PSK bits in network_sync_settings()

I assumed that by solving the above race, you'd be solving the problem you're 
having with DPP?

> changing _during_ a connection is really in the scope of this patch set. I'm 

Okay, then this patch in particular is not needed?

> also not really convinced trying to fix this race condition is all that 
> important. Its not really a "race" per-se, but more of just how IWD works. The 
> profile is loaded upon connecting and those settings are used. If you swap 
> out/modify the profile in the middle of that I don't think anyone would/should 
> expect those changes to be taken for that ongoing connection. That's my opinion 
> on it anyways.

That's fine as well.  In that case you just need to have DPP wait until 
knownnetworks adds/updates its state.

> 
> What we do need is the ability to update settings on disk if IWD is sitting idle 
> or connected. Currently if network/network->settings already exists its not 
> possible to update unless IWD disconnects.

I'm not following.

> 
> You mentioned copying over all settings except the security group, but this 
> wouldn't handle the case of DPP (or anything) updating the profile with new 
> credentials. I think we need the l_settings object to be 100% synced with whats 
> on disk (but as you said, network->psk/network->passphrase shouldn't be 
> altered). This then means the entire settings is copied, so its much more 
> efficient to just replace it. Does this make sense?

If the settings are opened, it is too late to alter anything related to security 
since that is used by eapol, ft, netdev, etc.  You might have a chance to apply 
/ re-apply the settings used by netconfig.

Regards,
-Denis

  reply	other threads:[~2023-12-19 16:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-18 14:12 [PATCH v2 1/4] knownnetworks: network: support updating known network settings James Prestwood
2023-12-18 14:12 ` [PATCH v2 2/4] dpp: fix extra settings not being used when connecting James Prestwood
2023-12-18 14:12 ` [PATCH v2 3/4] auto-t: add DPP tests to check extra settings are applied James Prestwood
2023-12-18 14:12 ` [PATCH v2 4/4] auto-t: increase RAM when running with valgrind (UML) James Prestwood
2023-12-19  4:31 ` [PATCH v2 1/4] knownnetworks: network: support updating known network settings Denis Kenzior
2023-12-19 12:57   ` James Prestwood
2023-12-19 16:31     ` Denis Kenzior [this message]
2023-12-19 16:53       ` James Prestwood
2023-12-19 17:46         ` Denis Kenzior
2023-12-19 17:49           ` James Prestwood

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=f2d94ed6-0902-4dcd-bc7a-b7c58e7e61e3@gmail.com \
    --to=denkenz@gmail.com \
    --cc=iwd@lists.linux.dev \
    --cc=prestwoj@gmail.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