Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp556632imu; Fri, 9 Nov 2018 02:09:35 -0800 (PST) X-Google-Smtp-Source: AJdET5fBUnKoRIJmy8lTPYXmtbXn4BYY1KBbzewxiNWokkErX8aZs2oZT296AwDf0KYilC2a86tX X-Received: by 2002:a17:902:1e3:: with SMTP id b90-v6mr5416106plb.117.1541758175456; Fri, 09 Nov 2018 02:09:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541758175; cv=none; d=google.com; s=arc-20160816; b=maYkhRGdrTeb1MWJeqe/b+FF+tAh0xtjIyuMGzTTx30sdLsA8whLa4La8aUlKX611h z2RseDXkUxFHYZIgFsaY0/0wFf2xvWqqlqvgbv5ZKXh/DN71cyzmzhj9R98IaWE6jewL pgrsqwN4Q2eh4Ooa+eIf4u6IEoG7l8x4NpCcAx6rIXPMqWdsrkmUNZ1iNB2/ZOT2YCWT f+PKEkKycNxb/17ICst/e5G00TSSOHH/PeKhODcCWgwE3fBgBIAMYjHB1Ukoru2fY09O B2XEeSvNRSuS9BRqdKUfzK7fFscM/bgBSKnWnL6mHDTa8OzmdzmuPo4W8KfZJfqvJFW5 VsMg== 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=LL8KyBN1jcZZT5M6zbhiUxqDFuCBsyTO3n2w0lqPZEk=; b=bCqsIPtZnQ0JUzGq44ktpZ/6Lb8AmyTGMNTT3V8fiho29zW0kEOSEqGqKMjzHN1/Oh g2EWb7VjSf8J4NLuGPhRJa4TiwretiIzDfSGQ9VErOOOQ46ryh8nHENHDKK3hiC/5Q0z hN1LUC8Fo1fn9O/nG2rxBeOn0oUXmTMDgxgcYNkYO9j4fKl3Vlx2Iw4uiKXZLQ1S8nUn qPf3TVWh+6/6ZoexKgeszoDMSjAQruBn67+5CiBgjba0oWAIqC6AKQklo1sB9osMQ8Nh UqKDgGVK1eYAUNUvNeE1L1htZtqyPrXZJbu2bAJsml593d1x3ucBPjIZntljaC1d/9g+ Ah7A== 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 e133-v6si8753143pfh.289.2018.11.09.02.09.10; Fri, 09 Nov 2018 02:09:35 -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 S1728388AbeKITsS (ORCPT + 99 others); Fri, 9 Nov 2018 14:48:18 -0500 Received: from www262.sakura.ne.jp ([202.181.97.72]:53028 "EHLO www262.sakura.ne.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727653AbeKITsR (ORCPT ); Fri, 9 Nov 2018 14:48:17 -0500 Received: from fsav104.sakura.ne.jp (fsav104.sakura.ne.jp [27.133.134.231]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id wA9A7nKj024467; Fri, 9 Nov 2018 19:07:49 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav104.sakura.ne.jp (F-Secure/fsigk_smtp/530/fsav104.sakura.ne.jp); Fri, 09 Nov 2018 19:07:49 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/530/fsav104.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 wA9A7mv9024433 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NO); Fri, 9 Nov 2018 19:07:48 +0900 (JST) (envelope-from penguin-kernel@i-love.sakura.ne.jp) Subject: Re: UBSAN: Undefined behaviour in mm/page_alloc.c To: Michal Hocko Cc: Kyungtae Kim , akpm@linux-foundation.org, pavel.tatashin@microsoft.com, vbabka@suse.cz, 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: Date: Fri, 9 Nov 2018 19:07:49 +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: <20181109095604.GC5321@dhcp22.suse.cz> 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 18:56, Michal Hocko wrote: > Does this following look better? Yes. >> 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? We after all can't avoid blowing up the kernel even if we don't add BUG_ON(). Stopping with BUG_ON() is saner than NULL pointer dereference messages.