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:   Tue, 28 Nov 2023 15:07:38 +0100
From:   Michal Hocko <mhocko@...e.com>
To:     Gregory Price <gourry.memverge@...il.com>
Cc:     linux-mm@...ck.org, linux-doc@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, linux-api@...r.kernel.org,
        linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org,
        akpm@...ux-foundation.org, arnd@...db.de, tglx@...utronix.de,
        luto@...nel.org, mingo@...hat.com, bp@...en8.de,
        dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
        tj@...nel.org, ying.huang@...el.com,
        Gregory Price <gregory.price@...verge.com>
Subject: Re: [RFC PATCH 05/11] mm/mempolicy: modify set_mempolicy_home_node
 to take a task argument

On Wed 22-11-23 16:11:54, Gregory Price wrote:
[...]
> +
> +	/*
> +	 * Behavior when task == current allows a task modifying itself
> +	 * to bypass the check in get_task_mm and acquire the mm directly
> +	 */
> +	if (task == current) {
> +		mm = task->mm;
> +		mmget(mm);
> +	} else
> +		mm = get_task_mm(task);

Similar question as in the previous patch. When is a kthread legit to do
manipulate borrowed mm memory policy?

> +
> +	if (!mm)
> +		return -ENODEV;

Is this an expected error? No mm means task dying and mm has been
already released. Should we simply return ESRCH wouldbe a better error
code IMO. This should never happen for the current task so it sould be
safe to add.

-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ