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] [day] [month] [year] [list]
Date:   Wed, 20 Apr 2022 13:25:53 +0500
From:   Muhammad Usama Anjum <usama.anjum@...labora.com>
To:     Gabriel Krisman Bertazi <krisman@...labora.com>
Cc:     usama.anjum@...labora.com,
        Andrew Morton <akpm@...ux-foundation.org>,
        Shuah Khan <shuah@...nel.org>, kernel@...labora.com,
        david@...hat.com, Will Deacon <will@...nel.org>,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        linux-kselftest@...r.kernel.org
Subject: Re: [PATCH V5 2/2] selftests: vm: Add test for Soft-Dirty PTE bit

On 3/19/22 12:23 AM, Gabriel Krisman Bertazi wrote:
>> +static void test_vma_reuse(int pagemap_fd, int pagesize)
>> +{
>> +	char *map, *map2;
>> +
>> +	map = mmap(NULL, pagesize, (PROT_READ | PROT_WRITE), (MAP_PRIVATE | MAP_ANON), -1, 0);
>> +	if (map == MAP_FAILED)
>> +		ksft_exit_fail_msg("mmap failed");
>> +
>> +	clear_softdirty();
>> +
>> +	/* Write to the page before unmapping and map the same size region again to check
>> +	 * if same memory region is gotten next time and if dirty bit is preserved across
>> +	 * this type of allocations.
>> +	 */
> This reads weird.  It should *not* be preserved across different
> mappings.  Also, we are not testing if the same region is reused, we are
> depending on it to test the sd bit.
> 
> /* Ensures the soft-dirty bit is reset accross different mappings on the
> same address.  */
Soft dirty bit is always set for new regions (reused or not). I'll
correct the comment and improve this sub test.

-- 
Muhammad Usama Anjum

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ