lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZtB3RczHN00XDO52@zx2c4.com>
Date: Thu, 29 Aug 2024 15:27:33 +0200
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: Xi Ruoyao <xry111@...111.site>
Cc: Huacai Chen <chenhuacai@...nel.org>, WANG Xuerui <kernel@...0n.name>,
	linux-crypto@...r.kernel.org, loongarch@...ts.linux.dev,
	linux-kernel@...r.kernel.org, Jinyang He <hejinyang@...ngson.cn>,
	Tiezhu Yang <yangtiezhu@...ngson.cn>, Arnd Bergmann <arnd@...db.de>,
	Thomas Gleixner <tglx@...utronix.de>,
	Christophe Leroy <christophe.leroy@...roup.eu>
Subject: Re: [PATCH v5] LoongArch: vDSO: Wire up getrandom() vDSO
 implementation

One small question just occurred to me:

> +static __always_inline const struct vdso_rng_data *__arch_get_vdso_rng_data(
> +	void)
> +{
> +	return (const struct vdso_rng_data *)(
> +		get_vdso_data() +
> +		VVAR_LOONGARCH_PAGES_START * PAGE_SIZE +
> +		offsetof(struct loongarch_vdso_data, rng_data));
> +}

Did you test this in a TIMENS? On x86, I had to deal with the page
offsets switching around depending on whether there was a TIMENS. I
tested this in my test harness with some basic code like:

       if (argc == 1) {
               if (unshare(CLONE_NEWTIME))
                       panic("unshare(CLONE_NEWTIME)");
               if (!fork()) {
                       if (execl(argv[0], argv[0], "now-in-timens"))
                               panic("execl");
               }
               wait(NULL);
               poweroff();
       }

Because unlike other namespaces, the time one only becomes active after
fork/exec.

But maybe loongarch is more organized and you don't need any special
handling in __arch_get_vdso...data() functions like I needed on x86.
Just thought I should check.

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ