Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3665452yba; Tue, 23 Apr 2019 07:38:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqyLtp9O7E0KPINFN/+akCZRG68ZbtrccxEFA/1tM9Q7Lx2xBqwnzVABZZMpmVCmeRd5eROr X-Received: by 2002:a17:902:31c3:: with SMTP id x61mr26236417plb.143.1556030287947; Tue, 23 Apr 2019 07:38:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556030287; cv=none; d=google.com; s=arc-20160816; b=lJwrDoPjjQUBbINtwOcZAvqFWJDJgRdI1ikhWCnhnYnUgHUiU7Ax/h4cuLNwXOelxe O6fow8Mw7USGm20doU1vtcg7dLhFrs9H53OCxAd4c+O9r9UGJKrxgpHo+J+QxFJ7LwMt iNt7QWp4RVgSZGXqNek6Q6yqvG5wTD/syLgSKOXD8r120b/PSbkPc4iJHvI+zV4YbTeP kCLsnh+hiyaT5cO76E9NuaqcfL6VCAJjDTayLd7IfOeHWQtsujPzY6PbRlptnhJmg/+6 EOLln1U7UmNCS/wg7+7JLbSa+3+OdOkz/fFMec7XlmRts9WW/ZQ9mfc9Z6DXR+Pm4f4o 1HHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=k/G2KUsFtfhv1I5sxjAd5L+a3It5LAnKQGLM+DApu38=; b=TMzXOv+ATatcMNXcm7jrVYmIlQLhzJjBkiMcu2ScI26gb2jyYmmeAtd8VOq7ANyXlv jVf7ZUwPKUkpwppCrB8FmREs9pjVgNqcfE+TqgDqBjmcqqEDNFmpPfQYj449Lm7TSm1h PRhDtvw/h0g+sIH9HBaPwIHqvMo7UwBoAjoti7JTUvULELXweKfMklF5uCZ7PbYS7/TI +SMHXWjN44upuanCXbv8DUs4sL93RX8yF/ytT30pQSZ3bKOvkF5w6fa0m0QJRWSsXRuA KX0X85/yx2ovnFIearxN87ZrGiy9Y85rq4Y4qcrt5MKuSuYFXH3lU4/w82fgY7GQhSyo CvZQ== 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 f64si16257765plf.258.2019.04.23.07.37.51; Tue, 23 Apr 2019 07:38:07 -0700 (PDT) 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 S1727827AbfDWOfo (ORCPT + 99 others); Tue, 23 Apr 2019 10:35:44 -0400 Received: from outbound-smtp15.blacknight.com ([46.22.139.232]:52065 "EHLO outbound-smtp15.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726421AbfDWOfn (ORCPT ); Tue, 23 Apr 2019 10:35:43 -0400 Received: from mail.blacknight.com (unknown [81.17.254.11]) by outbound-smtp15.blacknight.com (Postfix) with ESMTPS id 15F711C1E0C for ; Tue, 23 Apr 2019 15:35:42 +0100 (IST) Received: (qmail 9400 invoked from network); 23 Apr 2019 14:35:41 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[37.228.225.79]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 23 Apr 2019 14:35:41 -0000 Date: Tue, 23 Apr 2019 15:35:40 +0100 From: Mel Gorman To: Andrey Ryabinin Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] mm/page_alloc: avoid potential NULL pointer dereference Message-ID: <20190423143540.GQ18914@techsingularity.net> References: <20190423120806.3503-1-aryabinin@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20190423120806.3503-1-aryabinin@virtuozzo.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 23, 2019 at 03:08:05PM +0300, Andrey Ryabinin wrote: > ac.preferred_zoneref->zone passed to alloc_flags_nofragment() can be NULL. > 'zone' pointer unconditionally derefernced in alloc_flags_nofragment(). > Bail out on NULL zone to avoid potential crash. > Currently we don't see any crashes only because alloc_flags_nofragment() > has another bug which allows compiler to optimize away all accesses to > 'zone'. > > Fixes: 6bb154504f8b ("mm, page_alloc: spread allocations across zones before introducing fragmentation") > Signed-off-by: Andrey Ryabinin Acked-by: Mel Gorman -- Mel Gorman SUSE Labs