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: <20210407024811.GA2531743@casper.infradead.org>
Date:   Wed, 7 Apr 2021 03:48:11 +0100
From:   Matthew Wilcox <willy@...radead.org>
To:     Michel Lespinasse <michel@...pinasse.org>
Cc:     Linux-MM <linux-mm@...ck.org>,
        Laurent Dufour <ldufour@...ux.ibm.com>,
        Peter Zijlstra <peterz@...radead.org>,
        Michal Hocko <mhocko@...e.com>,
        Rik van Riel <riel@...riel.com>,
        Paul McKenney <paulmck@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Suren Baghdasaryan <surenb@...gle.com>,
        Joel Fernandes <joelaf@...gle.com>,
        Rom Lemarchand <romlem@...gle.com>,
        Linux-Kernel <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH 33/37] mm: enable speculative fault handling only for
 multithreaded user space

On Tue, Apr 06, 2021 at 06:44:58PM -0700, Michel Lespinasse wrote:
> +	/* Only try spf for multithreaded user space faults. */

This comment is misleading ... mm_users will also be incremented for
ptraced programs as well as programs that are having their /proc/$pid/maps
examined, etc.  Maybe:

	/* No need to try spf for single-threaded programs */

Also, please, can we not use an acronym for this feature?  It's not a
speculative page fault.  The page fault is really happening.  We're
trying to handle it under RCU protection (if anything the faultaround
code is the speculative page fault code ...)  This is unlocked page
fault handling, perhaps?

> +	if (!(flags & FAULT_FLAG_USER) || atomic_read(&mm->mm_users) == 1)
> +		goto no_spf;
> +
>  	count_vm_event(SPF_ATTEMPT);
>  	seq = mmap_seq_read_start(mm);
>  	if (seq & 1)
> @@ -1351,6 +1355,7 @@ void do_user_addr_fault(struct pt_regs *regs,
>  
>  spf_abort:
>  	count_vm_event(SPF_ABORT);
> +no_spf:
>  
>  	/*
>  	 * Kernel-mode access to the user address space should only occur
> -- 
> 2.20.1
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ