fakechroot
fakechroot copied to clipboard
check return value of dladdr
dladdr
leave unchanged for info
(on Linux), when it returns error (0).
This can be checked easily with following C code, which causes a segmentation fault before this change.
#define _GNU_SOURCE
#include <dlfcn.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char** argv)
{
Dl_info info;
memset(&info, 0xfe, sizeof(info)); /* fill with inaccessible address */
dladdr(NULL, &info);
return 0;
}
Any way this could get applied?
@rdp Which distro are you using? You might have more luck approaching the package maintainers of your distro and ask them if they can apply that patch.
Ahh its unmaintained #84 durn...
@josch Ubuntu so maybe you could help? :)
I'm the package maintainer in Debian. So I can apply this fix and then Ubuntu will (hopefully) copy it over from Debian unstable for the jammy release. I am not a Ubuntu developer, so I cannot directly make changes there.
@rdp I now added the changes from this pull request to the version that Debian ships. It should end up in Ubuntu at some point as well.
@lugia-kun I also added a test case using your code above. Please consider adding the test case to this pull request as well: https://sources.debian.org/src/fakechroot/2.20.1+ds-1/debian/patches/0008-check-return-value-of-dladdr.patch/
Thanks!
On Thu, Nov 11, 2021 at 1:05 PM josch @.***> wrote:
@rdp https://github.com/rdp I now added the changes from this pull request to the version that Debian ships. It should end up in Ubuntu at some point as well.
@lugia-kun https://github.com/lugia-kun I also added a test case using your code above. Please consider adding the test case to this pull request as well: https://sources.debian.org/src/fakechroot/2.20.1+ds-1/debian/patches/0008-check-return-value-of-dladdr.patch/
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dex4er/fakechroot/pull/70#issuecomment-966588898, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADBUHZZRXHPYFYGG3KOVDULQO2FANCNFSM4MXCJ7WA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Fixes crystal-lang/crystal#9209
Thanks for adding a test case.
Hi @lugia-kun, could you mark test/t/dladdr.t
as executable with chmod +x test/t/dladdr.t
and add this change to this pull request? Thanks!