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]
Date:   Wed, 13 May 2020 18:21:39 +0200
From:   Thomas Gleixner <tglx@...utronix.de>
To:     Alan Stern <stern@...land.harvard.edu>
Cc:     Greg KH <gregkh@...uxfoundation.org>,
        syzbot <syzbot+353be47c9ce21b68b7ed@...kaller.appspotmail.com>,
        bp@...en8.de, dave.hansen@...ux.intel.com,
        dmitry.torokhov@...il.com, ebiederm@...ssion.com, hpa@...or.com,
        jeremy.linton@....com, linux-kernel@...r.kernel.org,
        linux-usb@...r.kernel.org, luto@...nel.org, mingo@...hat.com,
        peterz@...radead.org, syzkaller-bugs@...glegroups.com,
        x86@...nel.org
Subject: Re: WARNING in memtype_reserve

Alan Stern <stern@...land.harvard.edu> writes:
> On Sat, 9 May 2020, Thomas Gleixner wrote:
>
>> Greg KH <gregkh@...uxfoundation.org> writes:
>> > On Sat, May 09, 2020 at 12:20:14AM -0700, syzbot wrote:
>> >> memtype_reserve failed: [mem 0xffffffffff000-0x00008fff], req write-back
>> >> WARNING: CPU: 1 PID: 7025 at arch/x86/mm/pat/memtype.c:589 memtype_reserve+0x69f/0x820 arch/x86/mm/pat/memtype.c:589
>> >
>> > So should memtype_reserve() not do a WARN if given invalid parameters as
>> > it can be triggered by userspace requests?
>> >
>> > A normal "invalid request" debug line is probably all that is needed,
>> > right?
>> 
>> I disagree. The callsite espcially if user space triggerable should not
>> attempt to ask for a reservation where start > end:
>> 
>>   >> memtype_reserve failed: [mem 0xffffffffff000-0x00008fff], req write-back
>> 
>> The real question is which part of the call chain is responsible for
>> this. That needs to be fixed.
>
> What about all the other ways in which a reservation request could be
> invalid?  The MM core already checks for these; what point is there in
> duplicating these checks in many places higher up the call chain?

Defensive programming rule #1: Check crap early but have the check which
ultimatively catches it at the last possible place as well.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ