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: <e8f12df8-3502-691a-a60d-645ac8fbdd65@huawei.com>
Date: Thu, 9 Jan 2025 10:33:03 +0800
From: yukaixiong <yukaixiong@...wei.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
CC: <akpm@...ux-foundation.org>, <mcgrof@...nel.org>,
	<ysato@...rs.sourceforge.jp>, <dalias@...c.org>,
	<glaubitz@...sik.fu-berlin.de>, <luto@...nel.org>, <tglx@...utronix.de>,
	<mingo@...hat.com>, <bp@...en8.de>, <dave.hansen@...ux.intel.com>,
	<hpa@...or.com>, <viro@...iv.linux.org.uk>, <brauner@...nel.org>,
	<jack@...e.cz>, <kees@...nel.org>, <j.granados@...sung.com>,
	<willy@...radead.org>, <Liam.Howlett@...cle.com>, <vbabka@...e.cz>,
	<lorenzo.stoakes@...cle.com>, <trondmy@...nel.org>, <anna@...nel.org>,
	<chuck.lever@...cle.com>, <jlayton@...nel.org>, <neilb@...e.de>,
	<okorniev@...hat.com>, <Dai.Ngo@...cle.com>, <tom@...pey.com>,
	<davem@...emloft.net>, <edumazet@...gle.com>, <kuba@...nel.org>,
	<pabeni@...hat.com>, <paul@...l-moore.com>, <jmorris@...ei.org>,
	<linux-sh@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<linux-fsdevel@...r.kernel.org>, <linux-mm@...ck.org>,
	<linux-nfs@...r.kernel.org>, <netdev@...r.kernel.org>,
	<linux-security-module@...r.kernel.org>, <dhowells@...hat.com>,
	<haifeng.xu@...pee.com>, <baolin.wang@...ux.alibaba.com>,
	<shikemeng@...weicloud.com>, <dchinner@...hat.com>, <bfoster@...hat.com>,
	<souravpanda@...gle.com>, <hannes@...xchg.org>, <rientjes@...gle.com>,
	<pasha.tatashin@...een.com>, <david@...hat.com>, <ryan.roberts@....com>,
	<ying.huang@...el.com>, <yang@...amperecomputing.com>,
	<zev@...ilderbeest.net>, <serge@...lyn.com>, <vegard.nossum@...cle.com>,
	<wangkefeng.wang@...wei.com>
Subject: Re: [PATCH v4 -next 14/15] sh: vdso: move the sysctl to
 arch/sh/kernel/vsyscall/vsyscall.c



On 2025/1/3 19:11, Geert Uytterhoeven wrote:
> Hi Kaixiong,
>
> On Sat, Dec 28, 2024 at 4:07 PM Kaixiong Yu <yukaixiong@...wei.com> wrote:
>> When CONFIG_SUPERH and CONFIG_VSYSCALL are defined,
>> vdso_enabled belongs to arch/sh/kernel/vsyscall/vsyscall.c.
>> So, move it into its own file. After this patch is applied,
>> all sysctls of vm_table would be moved. So, delete vm_table.
>>
>> Signed-off-by: Kaixiong Yu <yukaixiong@...wei.com>
>> Reviewed-by: Kees Cook <kees@...nel.org>
>> ---
>> v4:
>>   - const qualify struct ctl_table vdso_table
> Thanks for your patch!
>
> I gave this a try on landisk, and /proc/sys/vm/vdso_enabled
> disappeared.
>
>> --- a/arch/sh/kernel/vsyscall/vsyscall.c
>> +++ b/arch/sh/kernel/vsyscall/vsyscall.c
>> @@ -55,6 +67,8 @@ int __init vsyscall_init(void)
>>                 &vsyscall_trapa_start,
>>                 &vsyscall_trapa_end - &vsyscall_trapa_start);
>>
>> +       register_sysctl_init("vm", vdso_table);
>      "failed when register_sysctl_sz vdso_table to vm"
>
> Adding some debug prints shows that kzalloc() in
> __register_sysctl_table() fails, presumably because it is called too
> early in the boot process.
>
>> +
>>          return 0;
>>   }
> Moving the call to register_sysctl_init() into its own fs_initcall(),
> like the gmail-whitespace-damaged patch below, fixes that.
>
> --- a/arch/sh/kernel/vsyscall/vsyscall.c
> +++ b/arch/sh/kernel/vsyscall/vsyscall.c
> @@ -67,11 +67,17 @@ int __init vsyscall_init(void)
>                 &vsyscall_trapa_start,
>                 &vsyscall_trapa_end - &vsyscall_trapa_start);
>
> -       register_sysctl_init("vm", vdso_table);
> +       return 0;
> +}
>
> +static int __init vm_sysctl_init(void)
> +{
> +       register_sysctl_init("vm", vdso_table);
>          return 0;
>   }
>
> +fs_initcall(vm_sysctl_init);
> +
>   /* Setup a VMA at program startup for the vsyscall page */
>   int arch_setup_additional_pages(struct linux_binprm *bprm, int uses_interp)
>   {
>
> Gr{oetje,eeting}s,
>
>                          Geert

Thank you so much for your test and fix patch !

I will fix it in patches series v5.

Best ...



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ