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]
Message-ID: <1e1f540c-fe13-e95e-6ecb-4d88c03ac9e7@kernel.org>
Date:   Wed, 10 Jan 2018 10:04:21 -0700
From:   Shuah Khan <shuah@...nel.org>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     Sri Jayaramappa <sjayaram@...mai.com>, stable@...r.kernel.org,
        linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org,
        Shuah Khan <shuahkh@....samsung.com>,
        Shuah Khan <shuah.kh@...sung.com>
Subject: Re: [PATCH] kselftest: fix OOM in memory compaction test

On 01/09/2018 09:47 AM, Shuah Khan wrote:
> On 01/09/2018 09:26 AM, Arnd Bergmann wrote:
>> Running the compaction_test sometimes results in out-of-memory
>> failures. When I debugged this, it turned out that the code to
>> reset the number of hugepages to the initial value is simply
>> broken since we write into an open sysctl file descriptor
>> multiple times without seeking back to the start.
>>
>> Adding the lseek here fixes the problem.
>>
>> Cc: stable@...r.kernel.org
>> Reported-by: Naresh Kamboju <naresh.kamboju@...aro.org>
>> Link: https://bugs.linaro.org/show_bug.cgi?id=3145
>> Signed-off-by: Arnd Bergmann <arnd@...db.de>
>> ---
>>  tools/testing/selftests/vm/compaction_test.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/tools/testing/selftests/vm/compaction_test.c b/tools/testing/selftests/vm/compaction_test.c
>> index a65b016d4c13..1097f04e4d80 100644
>> --- a/tools/testing/selftests/vm/compaction_test.c
>> +++ b/tools/testing/selftests/vm/compaction_test.c
>> @@ -137,6 +137,8 @@ int check_compaction(unsigned long mem_free, unsigned int hugepage_size)
>>  	printf("No of huge pages allocated = %d\n",
>>  	       (atoi(nr_hugepages)));
>>  
>> +	lseek(fd, 0, SEEK_SET);
>> +
>>  	if (write(fd, initial_nr_hugepages, strlen(initial_nr_hugepages))
>>  	    != strlen(initial_nr_hugepages)) {
>>  		perror("Failed to write value to /proc/sys/vm/nr_hugepages\n");
>>
> 
> 
> Thanks for the patch. I will get this into 4.16-rc1
> 

Applied to linux-kselftest next for 4.16-rc1

thanks,
-- Shuah

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ