Re: [PATCH v9] seedrng: import SeedRNG utility for kernel RNG seed files

2022-04-29 Thread Denys Vlasenko
On Fri, Apr 29, 2022 at 6:57 PM Jason A. Donenfeld wrote: > On Fri, Apr 29, 2022 at 6:04 PM Denys Vlasenko > wrote: > > On Wed, Apr 27, 2022 at 6:55 PM Jason A. Donenfeld wrote: > > > On Wed, Apr 27, 2022 at 06:15:50PM +0200, Denys Vlasenko wrote: > > > > if ((unlink(filename) < 0 ||

Re: [PATCH v9] seedrng: import SeedRNG utility for kernel RNG seed files

2022-04-29 Thread Bernhard Reutner-Fischer
On Fri, 29 Apr 2022 18:35:54 +0200 Denys Vlasenko wrote: > Even partial removal of these complicated error paths > cuts down the size by ~10% It's one of those situations where all you would really want is spend 100b in the kernel to "credit" seed. Be it via /sys or the first bit of the write

Re: [PATCH v9] seedrng: import SeedRNG utility for kernel RNG seed files

2022-04-29 Thread Steffen Nurpmeso
Denys Vlasenko wrote in : ... |Even partial removal of these complicated error paths |cuts down the size by ~10% A bit off topic but i personally am still thinking, really, that people would rather be reenabled to do what they did for long. ports/core/rc/rc ^e3afe2298e (Johannes Winkelmann

[PATCH v2] seedrng: limit poolsize to 256 bytes and document flock() and fsync() usage

2022-04-29 Thread Jason A. Donenfeld
Rather than having getrandom() be called in a loop that handles EINTR -- which would require more code bloat -- we just limit the maximum seed size to 256 bytes, which the kernel guarantees won't be interrupted. Additionally document the flock() and fsync() usage so that somebody doesn't remove

Re: [PATCH v9] seedrng: import SeedRNG utility for kernel RNG seed files

2022-04-29 Thread Jason A. Donenfeld
On Fri, Apr 29, 2022 at 6:36 PM Denys Vlasenko wrote: > Even partial removal of these complicated error paths > cuts down the size by ~10% You know if you just cut out all of the actual code but made it still print the same status messages, you could cut out like 90% of the size... It turns out,

Re: [PATCH v9] seedrng: import SeedRNG utility for kernel RNG seed files

2022-04-29 Thread Jason A. Donenfeld
Hi Denys, On Fri, Apr 29, 2022 at 6:04 PM Denys Vlasenko wrote: > On Wed, Apr 27, 2022 at 6:55 PM Jason A. Donenfeld wrote: > > On Wed, Apr 27, 2022 at 06:15:50PM +0200, Denys Vlasenko wrote: > > > if ((unlink(filename) < 0 || fsync(dfd) < 0) && seed_len) { > > >

Re: [PATCH v9] seedrng: import SeedRNG utility for kernel RNG seed files

2022-04-29 Thread Denys Vlasenko
On Fri, Apr 29, 2022 at 6:04 PM Denys Vlasenko wrote: > On Wed, Apr 27, 2022 at 6:55 PM Jason A. Donenfeld wrote: > > On Wed, Apr 27, 2022 at 06:15:50PM +0200, Denys Vlasenko wrote: > > > if ((unlink(filename) < 0 || fsync(dfd) < 0) && seed_len) { > > >

RE: [PATCH v9] seedrng: import SeedRNG utility for kernel RNG seed files

2022-04-29 Thread David Laight
From: Denys Vlasenko > Sent: 29 April 2022 17:17 > > On Wed, Apr 27, 2022 at 6:55 PM Jason A. Donenfeld wrote: > > On Wed, Apr 27, 2022 at 06:15:50PM +0200, Denys Vlasenko wrote: > > > Can we replace all [s]size_t's with ints/unsigneds? We do not expect > > > random pools anywhere near 4

Re: [PATCH v9] seedrng: import SeedRNG utility for kernel RNG seed files

2022-04-29 Thread Denys Vlasenko
On Wed, Apr 27, 2022 at 6:55 PM Jason A. Donenfeld wrote: > On Wed, Apr 27, 2022 at 06:15:50PM +0200, Denys Vlasenko wrote: > > Can we replace all [s]size_t's with ints/unsigneds? We do not expect > > random pools anywhere near 4 gigabytes... > > Probably that's fine. Is the advantage to tossing

Re: [PATCH v9] seedrng: import SeedRNG utility for kernel RNG seed files

2022-04-29 Thread Denys Vlasenko
On Wed, Apr 27, 2022 at 6:55 PM Jason A. Donenfeld wrote: > On Wed, Apr 27, 2022 at 06:15:50PM +0200, Denys Vlasenko wrote: > > if ((unlink(filename) < 0 || fsync(dfd) < 0) && seed_len) { > > bb_perror_msg("can't%s seed", " remove"); > > return -1; > >

ACE + TAO with buildroot - GLIBC_2.28 not found

2022-04-29 Thread Earthquake
Hi, intergrating ACE was successfull with https://patchwork.ozlabs.org/project/buildroot/patch/20210413134139.13281-1-matthew.we...@rockwellcollins.com/ ACE lib is built. When I integrate TAO in the ace.mk TAO_LIBRARIES += TAO_IDL TAO_LIBRARIEs += tao/PortableServer $(foreach

Re: [PATCH v9] seedrng: import SeedRNG utility for kernel RNG seed files

2022-04-29 Thread Jason A. Donenfeld
On Wed, Apr 27, 2022 at 6:55 PM Jason A. Donenfeld wrote: > 3) Limit the poolsize to 256 bytes (by changing the MAX_SEED_LEN enum >value to 256 instead of 512). I implemented this, and > > if (dfd < 0 || flock(dfd, LOCK_EX) < 0) > > bb_perror_msg_and_die("can't %s

[PATCH] seedrng: limit poolsize to 256 bytes and document flock() usage

2022-04-29 Thread Jason A. Donenfeld
Rather than having getrandom() be called in a loop that handles EINTR -- which would require more code bloat -- we just limit the maximum seed size to 256 bytes, which the kernel guarantees won't be interrupted. Additionally document the flock() usage so that somebody doesn't remove it. Cc: Denys