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: <87zgzq89nf.fsf@mail.parknet.co.jp>
Date:   Sat, 27 Feb 2021 12:36:04 +0900
From:   OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] Fix zero_user_segments() with start > end

Matthew Wilcox <willy@...radead.org> writes:

> On Sat, Feb 27, 2021 at 01:11:35AM +0900, OGAWA Hirofumi wrote:
>> zero_user_segments() is used from __block_write_begin_int(), for
>> example like the following
>> 
>> 	zero_user_segments(page, 4096, 1024, 512, 918)
>> 
>> But new zero_user_segments() implements for HIGMEM + TRANSPARENT_HUGEPAGE 
>> doesn't handle "start > end" case correctly, and hits BUG_ON(). (we
>> can fix __block_write_begin_int() instead though, it is the old and
>> multiple usage)
>
> Why don't we just take out the BUG_ON instead?  The function doesn't
> actually do the wrong thing.

end1 is underflow with

		if (start1 >= PAGE_SIZE) {
			start1 -= PAGE_SIZE;
			end1 -= PAGE_SIZE;
		}

>> Also it calls kmap_atomic() unnecessary while start == end == 0.
>
> I'm OK with that.  It always used to do that.

Old one is only one page, so it is always necessary if start1/end1 or
start2/end2 is valid range. But this one is multiple pages, so there are
completely unnecessary pages possibly.

>> Cc: <stable@...r.kernel.org>
>> Signed-off-by: OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>
>
> Fixes: 0060ef3b4e6d ("mm: support THPs in zero_user_segments")

OK.
-- 
OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ