[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH v2] miscutils/seedrng.c: fix <sys/random.h> include error on glibc < 2.25
From:       Steffen Nurpmeso <steffen () sdaoden ! eu>
Date:       2023-02-17 19:57:22
Message-ID: 20230217195722.8JQUt%steffen () sdaoden ! eu
[Download RAW message or body]

Thomas Devoogdt wrote in
 <CACXRmJjuTdoz551xv0Zez2--TWEV-oTZRE+jcv6GiA0ZShRU0g@mail.gmail.com>:
 |Perhaps the whole function should be rewritten to simply fallback to that
 |syscall rather than directly fallback to /dev/random?

Better not.

 |Or should I replace the define (-1) by that syscall?

It was more a well hm joke.  But i have

    fill = su_RANDOM_GETRANDOM_FUN(rdp->b8, a_RANDOM_SEED_BYTES);

coming from

        #define su_RANDOM_GETRANDOM_FUN(B,S) getrandom(B, S, 0)
        #define su_RANDOM_GETRANDOM_H <sys/random.h>' <<\!

or

        #define su_RANDOM_GETRANDOM_FUN(B,S) syscall(SYS_getrandom, B, S, 0)
        #define su_RANDOM_GETRANDOM_H <sys/syscall.h>' <<\!

but configure-time (and user choosable).
I mean, busybox _does_ use syscall(2) in a few places, looking for
SYS_getrandom and trying that would be just one more use case.
Years passed in between the syscall and the glibc.

Having said that, simply going /dev/random (or even /dev/urandom,
possibly, maybe, now i had to check the kernel sources) after
getrandom is imho complication enough for this thing.

--steffen
|
|Der Kragenbaer,                The moon bear,
|der holt sich munter           he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic