Re: Use HW random generator to kaslr-seed dtb on uvmm

2025-02-04 Thread Flavio Erlich
Thanks Adam for your prompt response!

On Tue, 4 Feb 2025, 22:16 Adam Lackorzynski,  wrote:

> Hi,
>
> On Tue Feb 04, 2025 at 21:59:24 +0200, Flavio Erlich wrote:
> > Hi,
> >
> > According to Linux documentation, if I want to use kASLR I should add on
> my
> > device tree, on the chosen node a kaslr-seed entry (
> > https://www.kernel.org/doc/Documentation/devicetree/bindings/chosen.txt
> ).
> > I'm running uvmm and I want to use the dt-modify argument to change the
> > value on dtb to a value that comes from an HW random generator at
> runtime.
> > I have written an application which reads a random sequence from the HW.
> > How can I pass the random value from that application and pass the u64
> > value to the ned script which I can use as a seed?
> > I can use the application exit code to read 32-bit and run it twice, but
> > seems to be overkill to do that.
> > I was thinking of sending a newer allocatted Dataspace to the
> application,
> > it will fill it with random data, but I have no idea if it is possible to
> > read this Dataspace and concatenate the result to the arguments to uvmm.
> > Do you have any other suggestions?
>
> Just give uvmm a 'rng' capability talking L4Re::Random protocol and it
> will update the kaslr-seed value in the DT itself. For that your program
> will need to implement a L4Re::Random server.
>
>
>
> Adam
>
___
l4-hackers mailing list -- [email protected]
To unsubscribe send an email to [email protected]


Re: Use HW random generator to kaslr-seed dtb on uvmm

2025-02-04 Thread Adam Lackorzynski
Hi,

On Tue Feb 04, 2025 at 21:59:24 +0200, Flavio Erlich wrote:
> Hi,
> 
> According to Linux documentation, if I want to use kASLR I should add on my
> device tree, on the chosen node a kaslr-seed entry (
> https://www.kernel.org/doc/Documentation/devicetree/bindings/chosen.txt).
> I'm running uvmm and I want to use the dt-modify argument to change the
> value on dtb to a value that comes from an HW random generator at runtime.
> I have written an application which reads a random sequence from the HW.
> How can I pass the random value from that application and pass the u64
> value to the ned script which I can use as a seed?
> I can use the application exit code to read 32-bit and run it twice, but
> seems to be overkill to do that.
> I was thinking of sending a newer allocatted Dataspace to the application,
> it will fill it with random data, but I have no idea if it is possible to
> read this Dataspace and concatenate the result to the arguments to uvmm.
> Do you have any other suggestions?

Just give uvmm a 'rng' capability talking L4Re::Random protocol and it
will update the kaslr-seed value in the DT itself. For that your program
will need to implement a L4Re::Random server.



Adam
___
l4-hackers mailing list -- [email protected]
To unsubscribe send an email to [email protected]


Use HW random generator to kaslr-seed dtb on uvmm

2025-02-04 Thread Flavio Erlich
Hi,

According to Linux documentation, if I want to use kASLR I should add on my
device tree, on the chosen node a kaslr-seed entry (
https://www.kernel.org/doc/Documentation/devicetree/bindings/chosen.txt).
I'm running uvmm and I want to use the dt-modify argument to change the
value on dtb to a value that comes from an HW random generator at runtime.
I have written an application which reads a random sequence from the HW.
How can I pass the random value from that application and pass the u64
value to the ned script which I can use as a seed?
I can use the application exit code to read 32-bit and run it twice, but
seems to be overkill to do that.
I was thinking of sending a newer allocatted Dataspace to the application,
it will fill it with random data, but I have no idea if it is possible to
read this Dataspace and concatenate the result to the arguments to uvmm.
Do you have any other suggestions?


Thanks for your help,
  Flavio
___
l4-hackers mailing list -- [email protected]
To unsubscribe send an email to [email protected]