Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp414633ybk; Sat, 9 May 2020 06:44:48 -0700 (PDT) X-Google-Smtp-Source: APiQypKcK7uIXt8UCS/F8mrh+zffS661n+Y679NtVWM9Fo9rzCDtKnucBBKX75V85A08inodKs/q X-Received: by 2002:a17:906:dbf6:: with SMTP id yd22mr5235645ejb.231.1589031888519; Sat, 09 May 2020 06:44:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589031888; cv=none; d=google.com; s=arc-20160816; b=wlre3Kdg+FumaA2I9DQKJyf4f00Rd4nWW6qhgI8zt10ZD4Aqk32ZO8xxgxT4bYnKai vGQ5H+4Az9KVVCcaBTQ1AlGIoH2qr3rpHUUYfcCE5PONs6809+TrrK0CvuNHvoiubWJ+ 8NiZcEzIXp3+IAyZAfIFRaq+qC+oefKa+nED82WeH8ITKOeVaOAJyXJrywE4MC0sZ2XH 6mGfA1A1GKOaFRdyN3H/rsuyrRnpcpUuN8ABoVbXG6Us9k+W1R/OWc2y3mtMtnZDX26S BXqaMS+gXe+nQxeTwqJfU+FsyMVaTurZcnC2MkeL16XwmuN4Q+dxKBNrvLAAsvP5zLs0 6A2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=aQRHwWO/2s1/nBr4dyLQXKkXFT+BIsAaRQbaeoTAido=; b=foxigGVq3HLMbZcYQhfckkbsvjpQH1hOWBVx7BkcwUonW6L5B/iKmVZd0QQzDGLUu3 97c8iKyhJI+rj06vPp8jqDYn1k+Q9+tUrWok9RhoIPtG695k3NOBGV1D1ent+GgXEdVc Ufep7ccVLUQMPW87Pun7reWnn+9S1HF2xEcmyDBHa7TFulSn2SZZNqEMS9cCIuGButxQ 1I7CmszgN1dNCi5AawLtD038a6WA0bGN/MkhLDQZ+AOCpq76a4DCPM+6xLjmtx9ROANM bssuoS2ueIRRP+ybaNljPLq4xLDJ712NCHUvcKRgY7WbqUSzMZ/4aEbiP0AhfwiawBKd BKTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q11si23177edr.152.2020.05.09.06.44.14; Sat, 09 May 2020 06:44:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727111AbgEINl4 (ORCPT + 99 others); Sat, 9 May 2020 09:41:56 -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