-
Notifications
You must be signed in to change notification settings - Fork 21
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
Split proxy/client serials based on lower bit #57
Split proxy/client serials based on lower bit #57
Conversation
aa36e27
to
5816eaf
Compare
What changes with this is that clients can re-use serials. I can't guarantee that this doesn't has potential security implications since I'm not familiar enough with the codebase. |
5816eaf
to
b76beeb
Compare
b76beeb
to
23581ea
Compare
23581ea
to
d36e8b0
Compare
Thanks for writing a patch! |
225133d
to
184b2ce
Compare
184b2ce
to
779235e
Compare
LGTM but we should definitely get another review in. |
779235e
to
935eeda
Compare
Separation between messages created by client and proxy was ensured by requiring the client to use monotonically increasing serials and adding an offset to distinguish the client message from proxy messages. The requirement to only send messages with increasing serials cannot be ensured by libraries godbus or zbus. This commit instead reserves the high-bit=0 space for client messages and the high-bit=1 for messages created by the proxy. This gets rid of any serial translation mechanism and the requirement for increasing serials. However, it limits the possible values of serials available to the client to about half of the usual maximum value. Closes flatpak#46
935eeda
to
4f081c7
Compare
Rebased due to merge conflict. |
Some minor comments from me, but otherwise this looks good to me. |
Well, one more comment: Maybe MAX_CLIENT_SERIAL can be made much much larger. We're only emitting "fake" requests at the beginning of the session when setting up the view of bus names, so thre is never going to be 2^31 of them. I think MAX_CLIIENT_SERIAL should be set to something like |
Don't split via lower bit of the serial but instead use a much higher number for MAX_CLIENT_SERIAL since there are very few fake requests we need to do.
I have changed the code to #define MAX_CLIENT_SERIAL (G_MAXUINT32 - 65536) |
lgtm |
Separation between messages created by client and proxy was ensured by
requiring the client to use monotonically increasing serials and adding
an offset to distinguish the client message from proxy messages.
The requirement to only send messages with increasing serials cannot be
ensured by libraries godbus or zbus.
This commit instead reserves the lower_bit=0 space for client messages
and the lower_bit=1 for messages created by the proxy. This gets rid of
any serial translation mechanism and the requirement for increasing serials.
However, it limits the possible values of serials available to the client
to about half of the usual maximum value.
Closes #46