qrexec: improve error handling for invalid daemon connection#227
Conversation
|
@marmarek The C changes pass the main tests job . The remaining CI failures seem unrelated to this patch:
|
marmarek
left a comment
There was a problem hiding this comment.
This is not correct solution. The proper solution is finding where that wrong FD is coming from and handling it there. It might be closed at some earlier point, or being invalid from the very beginning (wherever it got initialized - for example if error handling is missing there).
Check return value of connect_unix_socket*() before use to avoid passing invalid file descriptors and triggering EBADF. Fixes QubesOS/qubes-issues#10792
3bce66b to
27e2f98
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #227 +/- ##
==========================================
- Coverage 78.85% 78.82% -0.03%
==========================================
Files 55 55
Lines 10530 10533 +3
==========================================
Hits 8303 8303
- Misses 2227 2230 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
OpenQA test summaryComplete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2026032504-4.3&flavor=pull-requests Test run included the following:
Upload failures
New failures, excluding unstableCompared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2026020304-devel&flavor=update
Failed tests15 failures
Fixed failuresCompared to: https://openqa.qubes-os.org/tests/166096#dependencies 33 fixed
Unstable testsDetailsPerformance TestsPerformance degradation:21 performance degradations
Remaining performance tests:89 tests
|
Details
When
connect_unix_socket()orconnect_unix_socket_by_id()fails,it returns a negative file descriptor. Previously, this value could be
passed directly to functions like
negotiate_connection_params()andsend_service_connect(), which then attempt to operate on it,leading to
EBADF("Bad file descriptor") errors.This patch validates the socket descriptor at the call sites and
prevents further processing if the connection fails.
Result
EBADFerrors during connection setupFixes QubesOS/qubes-issues#10792