-
Notifications
You must be signed in to change notification settings - Fork 46
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
Fatal error: glibc detected an invalid stdio handle #57
Comments
Some interesting info here Patch in question proposed in https://www.sourceware.org/ml/libc-alpha/2016-08/msg00320.html |
So I went on #glibc to ask how to deal with it but clearly DCE should not tamper with the vtable as it was the goal of the hardening in the first place. So we have to find another way. |
Hence it's not possible to override it as it was done in dce-stdio.cc See direct-code-execution#57 for more information.
it looks like not related to clang support itself, i removed the project label. |
We need to have our own vtable to handle our private syscalls (my_read etc). |
Fixes direct-code-execution#57. Signed-off-by: Hajime Tazaki <[email protected]>
Fixes direct-code-execution#57. Signed-off-by: Hajime Tazaki <[email protected]>
Fixes direct-code-execution#57. Signed-off-by: Hajime Tazaki <[email protected]>
Fixes direct-code-execution#57. Signed-off-by: Hajime Tazaki <[email protected]>
Dear Hajime,
Please, can you provide some instructions how to overcome this issue? I installed DCE using following:
|
@mickeyze I have exactly the same issue. |
Reopening as per @tomhenderson 's mail. This occurs on Ubuntu 18.04. DCE works on Fedora 26: But on Ubuntu 18.04: |
Can confirm. I have the same issue with the current ns-3-dce-dev on: Debian testing (buster) with glibc 2.28-5 Stack trace looks similar as in opening post by @teto :
|
I also got the same error on Ubuntu 18.04. Is there any workaround for this? |
same issue here:
|
Not sure if useful but according to the libio: Implement vtable verification patch https://patchwork.ozlabs.org/patch/633012/
|
I'll written some code to get around this, tnat uses fopencookie instead of messing with the internals of FILE pointers. I'll try to get it published. |
I suggested to Parth (who is working on this) that we keep this issue open for the general issue of newer glibc's failing with this issue, and a similar issue #110 renamed to focus on Ubuntu 20.04-specific concerns. I suggested to Parth that we should explore three general solutions to this vtable verification limitation:
|
@glance- are you able to publish your code? Florian Westphal was recommending this direction to us on the libc-alpha mailing list today. |
Please see Parth's recent post about his attempts to use fopencookie (hopefully there will be follow-up here or on libc-alpha): https://sourceware.org/pipermail/libc-alpha/2021-July/129432.html |
This replaces the vtable mangling with fopencookie instead. It works good enough for our use-cases, but there's still some TODO's in the code. This is to fix direct-code-execution#57
I've how dropped my code in a PR. There's some TODO's / FIXME's left but its working good enough for our use case, and I haven't gotten around to fixing all those and cleaning them up enough to get all the tests running as they should, but works. |
This replaces the vtable mangling with fopencookie instead. It works good enough for our use-cases, but there's still some TODO's in the code. This is to fix direct-code-execution#57
Happening with the clang branch on ubuntu 16.10
Running the tests generates:
"Fatal error: glibc detected an invalid stdio handle\n"
while they used to work
Description of the problem
./waf --cwd=/home/teto/dce --run test-runner --command-template="gdb -ex 'run --suite=dce-process-manager --verbose --tempdir=/tmp/tmp7xpcdjr5 ' --args %s "
There is a similar issue here:
https://bugzilla.redhat.com/show_bug.cgi?id=1361037
with an interesting comment:
One _should_ be using '#include <gnu/lib-names.h>' to get LIBC_SO and then dlopen that, it's the only supported solution,
I'll propose a patch to do that.
The text was updated successfully, but these errors were encountered: