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: <b9e88ddf-e0ac-ce81-d6b4-caf70772c455@redhat.com>
Date:   Tue, 25 Oct 2022 09:05:34 +0200
From:   David Hildenbrand <david@...hat.com>
To:     Rafael Mendonca <rafaelmendsr@...il.com>
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        linux-kselftest@...r.kernel.org,
        Andrew Morton <akpm@...ux-foundation.org>,
        Shuah Khan <shuah@...nel.org>,
        Jason Gunthorpe <jgg@...dia.com>,
        John Hubbard <jhubbard@...dia.com>,
        Nadav Amit <namit@...are.com>, Peter Xu <peterx@...hat.com>,
        Andrea Arcangeli <aarcange@...hat.com>,
        Vlastimil Babka <vbabka@...e.cz>,
        Mike Rapoport <rppt@...nel.org>,
        Christoph von Recklinghausen <crecklin@...hat.com>,
        Don Dutile <ddutile@...hat.com>
Subject: Re: [PATCH v1 1/7] selftests/vm: anon_cow: test COW handling of
 anonymous memory

>> +	/* See if we still read the old values via the pipe. */
>> +	for (total = 0; total < transferred; total += cur) {
>> +		cur = read(fds[0], new + total, transferred - total);
>> +		if (cur < 0)
> 
> Hi David,
> I was looking at some coccinelle reports for linux-next and
> saw the following warning for this comparison:
> 
>    WARNING: Unsigned expression compared with zero: cur < 0
> 
> I think 'cur' needs to be of type 'ssize_t' for this comparison to work.
> 
> The same warning is reported for the variable 'transferred' above, and
> also for do_test_iouring() and do_test_vmsplice_in_parent() in
> "selftests/vm: anon_cow: add liburing test cases".
> 

Thanks for reporting! Indeed, we need a signed value.

-- 
Thanks,

David / dhildenb

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ