-
-
Notifications
You must be signed in to change notification settings - Fork 808
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
byte-buddy J9 attachment only checks for self-owned directories #1628
Comments
I remember that this is implemented in HotSpot. I assume that this requirement is taken from there but is not implemented. Disabling it by a property seems like a reasonable option as I think that this might be implemented in the future since it is a security concern. I add it. Did you reach out to the J9 team to see if this is planned for the future? |
Milestone should most likely be 1.14.15 as 1.12.14 is already released. |
I had some discussion with the J9 developers and the handling is comparable to Hotspot based JVMs. On Java versions up to including 1.9, the attacher requires the same user that also started the to-be-attached JVM. We have to be a bit smarter here and only omit the file check if we are not root (or not in the root group). In our code, we do know if we are root or not and we also know the version of the target as we do a A normal use case is for the same user and there the check does make sense. |
I remember implementing this by extracting the logic from a Java 8 version of J9 and I did not revisit thereafter. If I remember correctly, HotSpot checks the chmod of the checked file, but chances are that a root-owned file is today accepted as you say. As you said, I think it's hard to discover this from the process. I introduced an argument now that allows to controll this per process id. So if the executing process has knowledge of this, it can supply the override as an argument. |
I noticed that you are not forwarding the |
At least for us the current version won't work as we typically just call |
When testing this, there is a timeout
I suppose because we need to issue the following command |
Okay, on J9, the check for isFileOwnedByUid excludes userid 0
|
Ok, so we need to check if the owners are unequal and change it unless the current id is 0. I can look into it, but I'd appreciate at PR of course. |
I created #1631 to solve the problem. |
@raphw would be great if you can do another release of byte-buddy and then we can close this issue 🥺 |
Just triggered a release. |
We can close this issue. Our smoke tests pass with the 1.14.15 release. Thank you very much for the quick release. |
Hi @raphw ,
we noticed that the attachment on Linux only allows for attachments against directories owned by the current user.
So far we used the normal attachment of the J9 or Semeru JDK and on Java 10+ this has always worked with the root user, even though it is mentioned in the openj9 documentation that this should only work with the current user,
Would it be possible to remove the same user check in VirtualMachine.java?
For testing purpose in our smoke-test environment we added this very basic workaround that disables the same-user check:
instana@9c4990e
We are trying to find out in which environments this limitation is actually true.
The text was updated successfully, but these errors were encountered: