From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BEB27C47247 for ; Sat, 9 May 2020 13:41:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A781221655 for ; Sat, 9 May 2020 13:41:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727783AbgEINl5 (ORCPT ); Sat, 9 May 2020 09:41:57 -0400 Received: from netrider.rowland.org ([192.131.102.5]:36917 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726782AbgEINl4 (ORCPT ); Sat, 9 May 2020 09:41:56 -0400 Received: (qmail 4958 invoked by uid 500); 9 May 2020 09:41:55 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 9 May 2020 09:41:55 -0400 Date: Sat, 9 May 2020 09:41:55 -0400 (EDT) From: Alan Stern X-X-Sender: stern@netrider.rowland.org To: Thomas Gleixner cc: Greg KH , syzbot , , , , , , , , , , , , , Subject: Re: WARNING in memtype_reserve In-Reply-To: <87wo5l4ecm.fsf@nanos.tec.linutronix.de> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 9 May 2020, Thomas Gleixner wrote: > Greg KH 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? Alan Stern