-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
fortify-headers: fix inconsistent time_t version of ppoll #12575
fortify-headers: fix inconsistent time_t version of ppoll #12575
Conversation
That is...quite the bug. |
@neheb |
I found two forks on Github: Alpine Linux [1, 2] are aware of the issue and removed
[1] chimera-linux/fortify-headers@6700b69 |
This looks interesting. Did you report this upstream? Is it worth to adapt this fortify header check to work with 64 bit time? |
Yes, I also invited sin (the author of fortify-headers) to join our discussion, in my e-mail.
Likely not. See the links from my previous comment. In [1] they disabled it with
|
Bug: fortify/poll.h includes poll.h, which redirects ppoll to __ppoll_time64 if the _REDIR_TIME64 macro is 1. Then fortify/poll.h will #undef ppoll and use the 32 bit version. Fix: we should not do this when _REDIR_TIME64 is 1. [1] https://forum.openwrt.org/t/idle-cpu-usage-of-usbmuxd/140331/15 [2] openwrt#12574 Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
9b298b5
to
ddfe567
Compare
I would like to backport this to 22.03 soon if we do not see any fallout in master. For this change to apply we have to recompile the affected applications, we can do this by increasing the I compiled a simple application:
Without this change it results in this:
With this change applied it results in this:
The |
Do you need me to backport this patch to 22.03 or will you take care of it?
Can you tell the build-bot to rebuild everything? Does it happen periodically and how often?
I have experience with ARM assembler. Good enough that I wrote nano RTOS. But the code you listed is for another CPU and I don't understand it. Perhaps if you compile it for WRT3200ACM? I can also try building your C code, but right now I need to finish a review for a patch to the |
I was talking about this fallout. ;-)
The build bot will automatically rebuild all packages, but opkg will not update them as log as the version did not change. When I find some time I will build all packages from the feed and grep for ppoll. We should anyway wait till the SDKs were build.
This was for MIPS32r2 CPU. The new code now links the 64 bit version of the function. |
Nice instincts. I am learning to appreciate the tight compiler options because it allows issues to be identified earlier.
ok
I learned about the
Thanks for confirming! |
@hauke |
fortify/poll.h includes poll.h, which redirects the ppoll sys call to __ppoll_time64, if the _REDIR_TIME64 macro is 1. Then fortify/poll.h will #undef ppoll and use the 32 bit version, which is inconsistent. Taken from: openwrt/openwrt#12575
Bug:
fortify/poll.h
includespoll.h
, which redirects theppoll
sys call to__ppoll_time64
,if the
_REDIR_TIME64
macro is 1. Thenfortify/poll.h
will#undef ppoll
and use the 32 bit version, which is inconsistent.Fix: we should not do this when
_REDIR_TIME64
is 1.[1] https://forum.openwrt.org/t/idle-cpu-usage-of-usbmuxd/140331/15
[2] #12574
Host tested: macOS 12.6.5
Targets tested: TP-Link TL-WR1043ND v4, WRT3200ACM
@Ansuel @hauke @nbd168 @mpratt14 @1715173329 @jow- @ldir-EDB0