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: <C2910936-FDCF-4ECF-B014-D985284B225A@gmail.com>
Date:   Fri, 22 Jul 2022 10:21:00 -0700
From:   Nadav Amit <nadav.amit@...il.com>
To:     David Hildenbrand <david@...hat.com>
Cc:     Peter Xu <peterx@...hat.com>, LKML <linux-kernel@...r.kernel.org>,
        Linux MM <linux-mm@...ck.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Andrea Arcangeli <aarcange@...hat.com>
Subject: Re: [PATCH v3 1/3] mm/mprotect: Fix soft-dirty check in
 can_change_pte_writable()

On Jul 22, 2022, at 12:08 AM, David Hildenbrand <david@...hat.com> wrote:

>> +static inline bool vma_soft_dirty_enabled(struct vm_area_struct *vma)
>> +{
>> +	/*
>> +	 * NOTE: we must check this before VM_SOFTDIRTY on soft-dirty
>> +	 * enablements, because when without soft-dirty being compiled in,
>> +	 * VM_SOFTDIRTY is defined as 0x0, then !(vm_flags & VM_SOFTDIRTY)
>> +	 * will be constantly true.
>> +	 */
>> +	if (!IS_ENABLED(CONFIG_MEM_SOFT_DIRTY))
>> +		return false;
>> +
>> +	/*
>> +	 * Soft-dirty is kind of special: its tracking is enabled when the
>> +	 * vma flags not set.
>> +	 */
>> +	return !(vma->vm_flags & VM_SOFTDIRTY);
>> +}
> 
> That will come in handy in other patches I'm cooking.

clear_refs_write() also comes to mind as well (for consistency; I see no
correctness or performance issue).

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ