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: <ZD2BTZ5qDYgp/46E@casper.infradead.org>
Date:   Mon, 17 Apr 2023 18:26:37 +0100
From:   Matthew Wilcox <willy@...radead.org>
To:     Suren Baghdasaryan <surenb@...gle.com>
Cc:     akpm@...ux-foundation.org, hannes@...xchg.org, mhocko@...e.com,
        josef@...icpanda.com, jack@...e.cz, ldufour@...ux.ibm.com,
        laurent.dufour@...ibm.com, michel@...pinasse.org,
        liam.howlett@...cle.com, jglisse@...gle.com, vbabka@...e.cz,
        minchan@...gle.com, dave@...olabs.net, punit.agrawal@...edance.com,
        lstoakes@...il.com, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, kernel-team@...roid.com
Subject: Re: [PATCH v2 1/1] mm: do not increment pgfault stats when page
 fault handler retries

On Fri, Apr 14, 2023 at 05:08:18PM -0700, Suren Baghdasaryan wrote:
>  	/*
> -	 * We don't do accounting for some specific faults:
> -	 *
> -	 * - Unsuccessful faults (e.g. when the address wasn't valid).  That
> -	 *   includes arch_vma_access_permitted() failing before reaching here.
> -	 *   So this is not a "this many hardware page faults" counter.  We
> -	 *   should use the hw profiling for that.
> -	 *
> -	 * - Incomplete faults (VM_FAULT_RETRY).  They will only be counted
> -	 *   once they're completed.
> +	 * Do not account for incomplete faults (VM_FAULT_RETRY). They will be

I don't think you need the "(VM_FAULT_RETRY)" here.

> @@ -5180,21 +5186,22 @@ static vm_fault_t sanitize_fault_flags(struct vm_area_struct *vma,
>  vm_fault_t handle_mm_fault(struct vm_area_struct *vma, unsigned long address,
>  			   unsigned int flags, struct pt_regs *regs)
>  {
> +	/* Copy vma->vm_mm in case mmap_lock is dropped and vma becomes unstable. */

How about:

	/* If the fault handler drops the mmap_lock, vma may be freed */

> +	struct mm_struct *mm = vma->vm_mm;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ