xserver icon indicating copy to clipboard operation
xserver copied to clipboard

Race condition in xf86ParsePciBusString

Open GermanAizek opened this issue 1 month ago • 8 comments

Version

25.0.0.X Release

Description

@metux, I'm sorry that I haven't updated my PRs for a long time, I came back and found one flaw in xorg and xlibre server.

Incidient report here: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1850

GermanAizek avatar Nov 13 '25 16:11 GermanAizek

Since the Xserver is (mostly) single-threaded (except for input thread), this issue is theoretical - for now.

OTOH, at some point in the future, we'd like to go multi-threaded. But there's still a lot work to do for that.

This isn't an actual bug (ie. something's broken), but more a sloppy programming practice. So I'd welcome PRs for cleaning that up.

metux avatar Nov 14 '25 11:11 metux

This isn't an actual bug (ie. something's broken), but more a sloppy programming practice. So I'd welcome PRs for cleaning that up.

I made a patch in issue, do you mean convert it to PR?

Image

GermanAizek avatar Nov 15 '25 02:11 GermanAizek

@GermanAizek

0001-xf86pciBus-replace-on-thread-safe-strtok_r-in-xf86Pa.patch

Thank you for reporting the code cleanup request. Could you please open a pull request at Pull requests · X11Libre/xserver for your patch?

callmetango avatar Nov 15 '25 23:11 callmetango

@GermanAizek

0001-xf86pciBus-replace-on-thread-safe-strtok_r-in-xf86Pa.patch

Thank you for reporting the code cleanup request. Could you please open a pull request at Pull requests · X11Libre/xserver for your patch?

PR with patch changes: https://github.com/X11Libre/xserver/pull/1415

GermanAizek avatar Nov 16 '25 02:11 GermanAizek

@metux,

Xorg team did not appreciate writing thread-safe code.

Do you consider it necessary to ensure security against such attacks in the XLibre project?

Image

GermanAizek avatar Nov 21 '25 01:11 GermanAizek

Feel free submit patches :)

metux avatar Nov 21 '25 09:11 metux

Feel free submit patches :)

PR done here: https://github.com/X11Libre/xserver/pull/1415

GermanAizek avatar Nov 22 '25 01:11 GermanAizek