Skip to content

Fix self lockout on VDE socket#554

Open
Janrupf wants to merge 1 commit into
open-simh:masterfrom
Janrupf:vde-fix
Open

Fix self lockout on VDE socket#554
Janrupf wants to merge 1 commit into
open-simh:masterfrom
Janrupf:vde-fix

Conversation

@Janrupf
Copy link
Copy Markdown

@Janrupf Janrupf commented May 19, 2026

SIMH seems to somewhat quietly lock itself out of its own VDE socket because it sets the permission bits to all zero. I found some resources saying SIMH needs to run as root to use VDE, which seems to also stem from this problem. Now it works without running as root

@pmetzger
Copy link
Copy Markdown

Weird because this effect seems to contradict the VDE documentation but testing shows the patch is indeed correct. I applied it to ZIMH in this commit; I have no control over the SIMH repository. I used mode 0600 as it appears there was no need to give the socket an execute bit.

@Janrupf
Copy link
Copy Markdown
Author

Janrupf commented May 21, 2026

Ah whoops, you are right on the permission bits. I think I just had the 7 there for testing and then forgot to change it. Fixed that now

@Janrupf
Copy link
Copy Markdown
Author

Janrupf commented May 21, 2026

Regarding the VDE documentation, @pmetzger where would you say it contradicts it? I think its worded a bit weirdly with "[...] has been left for backwards compatibility", but it only explicitly mentions that the open args can be set to NULL (in which case VDE would apply mode 0700, interestingly enough also including the executable bit...), but not that they can be zeroed or are ignored.

I'm considering making a PR at VDE to maybe ignore the mode if its set to zero since I don't see how that would ever be useful, but arguably VDE shouldn't work around bugs in applications.

@pmetzger
Copy link
Copy Markdown

pmetzger commented May 21, 2026

The documentation seemed to indicate to me that zero meant defaults would be applied.

Anyway, it's rare that I've seen such a simple fix completely correct a problem. Thank you for bringing it to everyone's attention. I hope SIMH also applies it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants