Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp570056imu; Fri, 9 Nov 2018 02:26:26 -0800 (PST) X-Google-Smtp-Source: AJdET5cTgDf8t5vtJnmlS+mTk+VugBRmCcBIRIZDQbCYohVWmB6iwevBGzpx6SW0dAS4SX0GeI7R X-Received: by 2002:a62:440e:: with SMTP id r14-v6mr4759004pfa.185.1541759186471; Fri, 09 Nov 2018 02:26:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541759186; cv=none; d=google.com; s=arc-20160816; b=yJVr+7o3+yBv3AltmIisChNpLCIgrwz2yNg8kXvGrPt/+wuyVPM2AgGvVFfFNKtFMd LyV/2oeRWdwUKxOEVhCEgROwnBqh8GWLz11J4mMyLISSZ6thPgmhx7umUmwnSZoftB13 0lOzyvftLkmWzyO6akjqr0+XXjW1zAXyyKlFpiu/OsCUHRY9ntFjILqZQAuTlqNeBeYa 7GJUQYbuZcievWJM0t6ipS7/lR6QDqX4rbmsxL65Alkw/y340+8PB+1v5rMpMp0XMaxZ OUGDT6qvFCSNvQ0Ro43pxhxEpRHDTYw7j/vGGdCbFXakzqYSaRhrJReaU7ekb/4o7OWe x59g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=HT+4ZgOlRqhuuc4Z1LXYdcs31MAQfGwa9AQLiIwHGCg=; b=j6+PFhuUawnHMfuy1PDe9bRj7exJ6Fw4+r50g7zpHFYh1nQysC7XwcLklB22OhxLSL Jd5VdeZNo8+HmJRFLPPXkzsHk3DHrFCIn8k42HEEDGAhHnfG3IvRgsZ6A7J6rrlRNdS0 WwbbdYDFOv9AY7Wwjyz1xkO/ds7TxRyznxENG4iQNGQ06SgWrGOSLFxlw+P7ayepsXg5 x11zEBhphmTXOCxEyWSsmx13GseuGEnVh2c8wcDWutR4wcybDCda4f2NkNIhHOg+a3Xp SrmAJ03cuVKBODSCUp5Z+GnuYWrfQFkWndgV366sb8Gv3OPjSi49TnqZx7iLGIjFP3HU YBNg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j6-v6si6110152pgb.62.2018.11.09.02.26.07; Fri, 09 Nov 2018 02:26:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727742AbeKIUFS (ORCPT + 99 others); Fri, 9 Nov 2018 15:05:18 -0500 Received: from www262.sakura.ne.jp ([202.181.97.72]:64413 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727532AbeKIUFS (ORCPT ); Fri, 9 Nov 2018 15:05:18 -0500 Received: from fsav106.sakura.ne.jp (fsav106.sakura.ne.jp [27.133.134.233]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id wA9AOlDo038770; Fri, 9 Nov 2018 19:24:47 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav106.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav106.sakura.ne.jp); Fri, 09 Nov 2018 19:24:47 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav106.sakura.ne.jp) Received: from [192.168.1.8] (softbank060157065137.bbtec.net [60.157.65.137]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id wA9AOlqs038760 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NO); Fri, 9 Nov 2018 19:24:47 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: UBSAN: Undefined behaviour in mm/page_alloc.c To: Vlastimil Babka , Michal Hocko Cc: Kyungtae Kim , akpm@linux-foundation.org, pavel.tatashin@microsoft.com, osalvador@suse.de, rppt@linux.vnet.ibm.com, aaron.lu@intel.com, iamjoonsoo.kim@lge.com, alexander.h.duyck@linux.intel.com, mgorman@techsingularity.net, lifeasageek@gmail.com, threeearcat@gmail.com, syzkaller@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Konstantin Khlebnikov References: <20181109084353.GA5321@dhcp22.suse.cz> <20181109095604.GC5321@dhcp22.suse.cz> From: Tetsuo Handa Message-ID: <9e17d033-b2ab-3edb-ae0b-90d4f713e55b@i-love.sakura.ne.jp> Date: Fri, 9 Nov 2018 19:24:48 +0900 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/11/09 19:10, Vlastimil Babka wrote:>>>> + * reclaim >= MAX_ORDER areas which will never succeed. Callers may >>>> + * be using allocators in order of preference for an area that is >>>> + * too large. >>>> + */ >>>> + if (order >= MAX_ORDER) { >>> >>> Also, why not to add BUG_ON(gfp_mask & __GFP_NOFAIL); here? >> >> Because we do not want to blow up the kernel just because of a stupid >> usage of the allocator. Can you think of an example where it would >> actually make any sense? >> >> I would argue that such a theoretical abuse would blow up on an >> unchecked NULL ptr access. Isn't that enough? > > Agreed. > If someone has written a module with __GFP_NOFAIL for an architecture where PAGE_SIZE == 2048KB, and someone else tried to use that module on another architecture where PAGE_SIZE == 4KB. You are saying that triggering NULL pointer dereference is a fault of that user's ignorance about MM. You are saying that everyone knows internal of MM. Sad...