-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix NULL ptr deref in ipc_describe_workspace
#8868
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
When hot-plugging monitor(s) `ipc_json_describe_workspace` can end up dereferencing a NULL ptr in `wlr_output->name`. Here we simply check that it is set. While this is probably a race and just checking that it is not NULL before accessing it won't fully solve the race, it should make it substantially more rare. Mostly addresses swaywm#8747
|
I would prefer to find the root cause of this NULL pointer instead of adding a workaround. |
|
Sure, don't disagree, but absent someone having time to dig into it probably worth at least making sway stable. |
|
Any update here? |
|
Would still prefer to find the root cause rather than merge this. |
|
If no one has time to dig into the root cause it still might presumably be preferrable to merge this so that at least sway is stable on impacted devices. A broken sway seems worse than a workaround for a bug. |
|
If a workaround is merged, it removes any incentive to find the root cause. |
|
If impacted users migrate off of sway, it also removes any incentive to fix the issue :p |
The fact remains that adding a NULL check for a field that can never be NULL isn't a fix. The value should be set by the backend at the very start, and when destroyed it is simply free'd, not NULL'd. It could possibly be a use-after-free/dangling pointer of (I don't have a reproduction of this issue myself.) |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
@njdom24, that sounds like a different issue. My guess would be that |
When hot-plugging monitor(s)
ipc_json_describe_workspacecan end up dereferencing a NULL ptr inwlr_output->name. Here we simply check that it is set.While this is probably a race and just checking that it is not NULL before accessing it won't fully solve the race, it should make it substantially more rare.
Mostly addresses #8747