Hi,
Attached is an updated patch, where I have updated/modified dnsrand_next to
int from uint16_t, so that it is the same as local_id (even though local_id
does discard the upper 16/...bits), just in case there is some issue in
some combination of buildtools/endieness/...
In future / Other possibilities:
In case reading /dev/urandom is considered to be too much overhead or
leading to eating up of entropy in the system from other users perspective
or so, one could change to a two level logic, where /dev/urandom is read
once every 128 or 256 dns queries to (re)set the seed for the random prng
call. And in turn use the random c call for getting the dns query id. As
the random prng is reseeded every 128 or 256 calls, so I am lazily assuming
that its state cant be leaked from such a short run, to allow anyone to
predict the id, before reseeding.
--
Keep ;-)
HanishKVC
Hi,
The ARM implementation of memset has a bug when the fill-value is negative or outside the [0, 255] range. To reproduce:
int main() {
char array[256];
memset(array, -5, 256);
for (int i = 0; i < 256; ++i) {
printf("%d, ", (int)array[i]);
}
return 0;
}
This is supposed to fill the array with int8 values -5, -5, -5, ... . On ARM, this does not work because the implementation assumes the high bytes of the fill-value argument are already zero. However in this test case they are filled with 1-bits. The other implementations that I checked (aarch64 and x86_64) do not have this problem: they first convert the fill-value to an unsigned byte following the specification of memset.
With GCC one can use `memset(ptr, (-5 & 0xFF), size)` as a workaround, but for clang users that does not work: clang optimizes the `& 0xFF` away because it assumes that memset will do it.
How to fix/patch:
In this file: https://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/libc/string/arm/mems…
Before line 35 (lsl) insert this: uxtb r1, r1
Before line 71 (orr) insert this: uxtb a2, a2
Best regards,
Tom
Hi Tom,
Tom Bannink wrote,
> Hi uClibc-ng developers,
>
> I've stumbled across a bug in the implementation of `lrint` in uClibc-ng. I'm
> not sure where to report this so I'm sending this email. Please let me know if
> I can submit an issue on a bugtracker somewhere. I tried to post an issue on
> the gitlab page (https://gogs.waldemar-brodkorb.de/oss/uclibc-ng/issues) but it
> seems I cannot make an account there.
>
> The bug is simple to reproduce: `lrint(0.5)` and `lrint(-0.5)` should return 0
> (or +-1 depending on the rounding mode) but instead they return 2 and -2
> respectively.
>
> The faulty code is the block at lines 55-64 of this file: https://
> cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/libm/s_lrint.c
> Note that the `lround` function works fine and has very similar code: https://
> cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/tree/libm/s_lround.c
>
> Let me know if you need more information.
Can you provide a simple test case for the issue?
best regards
Waldemar
----- Forwarded message from Nozomi Networks Labs Advisory <labs-advisory(a)nozominetworks.com> -----
Date: Fri, 11 Mar 2022 16:42:40 +0100
From: Nozomi Networks Labs Advisory <labs-advisory(a)nozominetworks.com>
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.0
To: devel(a)uclibc-ng.org, wbx(a)uclibc-ng.org
Subject: Vulnerability in uClibc-ng
Hello,
we are trying to contact you in order to handle and resolve a vulnerability
that we found, that is affecting all versions of uClibc-ng, and that we
submitted to ICS-CERT.
Can you confirm that you received an email asking you to participate to the
related VINCE (CERT/CC Vulnerability Information and Coordination Environment)
vulnerability case?
In case you would like to switch to encrypted GPG communications, you may find
our key attached to this email.
Best regards,
Andrea Palanca
pub rsa4096 2021-01-21 [SC] [expires: 2025-01-20]
8B8C7C296AEC8BD654FF69A6797E06A000A77236
uid Nozomi Networks Labs Advisory <labs-advisory(a)nozominetworks.com>
sub rsa4096 2021-01-21 [E] [expires: 2025-01-20]
----- End forwarded message -----
Hello Andrea,
Nozomi Networks Labs Advisory wrote,
> Hello,
>
> we are trying to contact you in order to handle and resolve a vulnerability
> that we found, that is affecting all versions of uClibc-ng, and that we
> submitted to ICS-CERT.
>
> Can you confirm that you received an email asking you to participate to the
> related VINCE (CERT/CC Vulnerability Information and Coordination
> Environment) vulnerability case?
Yes.
> In case you would like to switch to encrypted GPG communications, you may
> find our key attached to this email.
No, best thing is to discuss the vulnerability here on the mailing
list. Unfortunately I wasn't able to fix the issue by myself and
hope someone from the rather small community will step up.
So sent all dirty details to this list.
best regards
Waldemar