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]
Date:   Fri, 26 Feb 2021 13:14:40 +0100
From:   Oscar Salvador <osalvador@...e.de>
To:     David Hildenbrand <david@...hat.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Michal Hocko <mhocko@...nel.org>, VlastimilBabkavbabka@...e.cz,
        pasha.tatashin@...een.com, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org, Anshuman Khandual <anshuman.khandual@....com>
Subject: Re: [PATCH v2 3/7] mm,memory_hotplug: Add kernel boot option to
 enable memmap_on_memory

On Thu, Feb 25, 2021 at 07:25:58PM +0100, David Hildenbrand wrote:
> > +static __meminit int memmap_on_memory_store(const char *val,
> > +					    const struct kernel_param *kp)
> > +{
> > +	/*
> > +	 * Fail silently in case we cannot enable it due to platform constraints.
> > +	 * User can always check whether it is enabled or not via /sys/module.
> > +	 */
> > +	if (!IS_ENABLED(CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE))
> > +		return 0;
> > +
> > +	return param_set_bool(val, kp);
> > +}
> > +module_param_call(memmap_on_memory, memmap_on_memory_store,
> > +		  memmap_on_memory_show, &memmap_on_memory_enabled, 0400);
> 
> Why are other users not allowed to read?

I copied it from the shuffle one. I guess shuffle code made it 0400 for
security reasons.
Since we do not need that here, I will switch it to 0444.

> Might want to add a MODULE_PARM_DESC().

Sure

> As we fail silently already, I'd keep it simple and use a
> 
> module_param(memmap_on_memory, bool, 0444);
> 
> moving the IS_ENABLED(CONFIG_ARCH_MHP_MEMMAP_ON_MEMORY_ENABLE) into the
> runtime check.

You mean moving this check into mhp_supports_memmap_on_memory() check
from patch#1 right?

Makes sense.


-- 
Oscar Salvador
SUSE L3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ