Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp920688lqo; Wed, 8 May 2024 21:51:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUATisW3CixU0d5B2EuZdsp9r85s4n8vF5CgFO6DHPT52BtUdiHsoYkbi6YZDuEJGCJYpwJ/ourONvvHl+bkjfdYREjfH5Cav8CMnfZ4A== X-Google-Smtp-Source: AGHT+IHSzNv3LvHmfgAajB954VVwzz4PHqcRbag7p0OIldn+s+qDqGOGHgZnqLilqeA6SQ4iQ3OO X-Received: by 2002:a05:620a:2226:b0:792:bf69:a799 with SMTP id af79cd13be357-792bf69ace8mr50854085a.6.1715230293513; Wed, 08 May 2024 21:51:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715230293; cv=pass; d=google.com; s=arc-20160816; b=k3IPb2Tjh/yj6VcyQLDhBhCGW+zAYDCiVsYtKnmh4qwAGn+50345DJfXKDlwIbkGhn cY2bDguTq0KkixXWFuBPHI1q4LFx6CxMxE0x+tC42hwFF8/kGMt3pRMjUg8nA5aUGREV 82d70F9Dulfw4zbtoIS+eSEDTuiiq/iZIpQ7aauSVb7leP2kz67oqEJPZsHpBBr4TXp3 tFPEu9PHtvkBYSrStApQAUyfrBJC/yba3Q3EXwagHAP8OG0J9fClrGqKZY+Ik8+LHlNF lXLyRnub4vjIGFRQVMoWiQ0oP02OmWqfnPsZC+Vl7+YCtdgIDJiobiA1uXAiMQu51AMq MtAg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=RaN5985F7FCduVrYhbHTOUfpVUxqMFRtvYN9eBGKgx4=; fh=VsZ3z3Wera8bvvzHlKobSJ0i0hzfbDt9JqZHV7HGhbM=; b=swe/BuLO2nrxcEgNLcOxYfZWY0rn+Us5+4prL4RiUsbMst5R2CKMSgFZJSTw4Knk5M 4ZNWJgbSq+F04vIpQy8Vy9Ko2bzN4ikL+bLVmlFTlw/e98a05kYpsFAybfdZcz4Xl5hr rwpY3AjzCJ2a3Xy5595+ooVFOmsjfNO6rMjtLb8N8EY9EEvcS6PyJLEOzDp7aHVSzcWl xZ6IDFbj1TC8h+K6n+BuxBHbly9es3RDh40yjLN6dx9sfrfngTc5Y4pUc2gaLbLNg5Wa TJay5qY+0//yOiiWR+I7LxG2cKDg7aLWW60fxmQEyYOsw0bBVonrxEjjytNbhSFkoxDu /WJw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=TXK3jkUV; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-174138-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174138-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-792bf36638dsi57577185a.675.2024.05.08.21.51.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 21:51:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174138-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=TXK3jkUV; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-174138-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174138-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 40F201C22248 for ; Thu, 9 May 2024 04:51:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 426D5149011; Thu, 9 May 2024 04:51:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="TXK3jkUV" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2117513C8EE for ; Thu, 9 May 2024 04:51:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715230280; cv=none; b=q5ufOJXCUOrqjBv6ALG2BxMAfqre9TMr56Lpd6pzxLRvY+kvxJsw+X/soDRLFlmXM4FcILOBMBnjQBw+n4XkxfkcZY0ps7jNA97kqAIw74IMo75gsrRcWDHQeSPsIFDLfSIXkCnwJdNTmhBDCb7xxtL32+tGJl/Z41Lm7cZknfA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715230280; c=relaxed/simple; bh=TDHK2pVj8mJUImJM5hiP5PVl2dpC7PhPEcQWT//QlKQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XTud0KaAAMJoAfDynO8wxf87YB6GUiZfOkM6dJBTBc6ftXCud8157Jjcbt59LqoOpydDayoY8aoWm1RzixNhh+byXlYVi71kdGoGJRbYz9yAQPyFRZg7PyP58HrKe3NSjsuWvM46HQK8NTU2QTT8PtRlebVcYPsP9zwzp6nGxi8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=TXK3jkUV; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bombadil.srs.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=RaN5985F7FCduVrYhbHTOUfpVUxqMFRtvYN9eBGKgx4=; b=TXK3jkUVA6GFKp6bn67mzx5jZz D2KALZM05btPADagOJbnT/k+0uIxFXiMzTmxD6sBFAtI5bdtOf9jgr54MpVzqt6mdnSZ65tV/vkN1 OcXdcEvfyS+vR3Ur+8gn9XMhzHAo1ce+J9qc9hCKHaXnEaVPDDUVGoh0XYjINiJN3yOqofq4M4NeH b33qnKTfM9kDtLcNHWViJ5kEI5yDVDWqK3XRvGg2a296rSock9iZfgnC5HwbqJq1jOFdedraJTzTp F4SLlC1iw0IxV1piJNh4wx15Xktgy90pAnwN4DgGk45yyWWnok/vRC7hC25pd5IKQ8TjlyCMfHQ+o e7sbHNfw==; Received: from hch by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4vkR-00000000Lth-2TLR; Thu, 09 May 2024 04:51:15 +0000 Date: Wed, 8 May 2024 21:51:15 -0700 From: Christoph Hellwig To: Hailong Liu Cc: Gao Xiang , akpm@linux-foundation.org, Michal Hocko , urezki@gmail.com, hch@infradead.org, lstoakes@gmail.com, 21cnbao@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, xiang@kernel.org, chao@kernel.org, Oven Subject: Re: [RFC PATCH] mm/vmalloc: fix vmalloc which may return null if called with __GFP_NOFAIL Message-ID: References: <20240508125808.28882-1-hailong.liu@oppo.com> <404add29-2d3f-45db-9103-0c5b66fb254e@linux.alibaba.com> <20240508144321.ymnhn54daaabalhe@oppo.com> <90a127e5-d884-44b5-bb76-773a7485c2f1@linux.alibaba.com> <20240508153136.x4rxildsgza234uv@oppo.com> <52f9e300-4ab9-43c1-abae-cbe3da27e5b0@linux.alibaba.com> <20240509013059.vegko7dlty7vppy5@oppo.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240509013059.vegko7dlty7vppy5@oppo.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html On Thu, May 09, 2024 at 09:30:59AM +0800, Hailong Liu wrote: > I’m not suggesting that erofs would cause a memleak. What I mean is > that if kvmalloc is invoked with __GFP_NOFAIL, it must ensure a non-NULL > return, even in scenarios where memory leaks caused by other processes > result in the inability to allocate a page. In such a situation, it > should result in “Kernel panic - not syncing: System is deadlocked > on memory”. Yes. __GFP_NOFAIL is a contract that says never ever return NULL. The callers will generally not handle a NULL return and blindly dereference it, leading to all kinds of nasty security issues. Note that deadlocking would be nice, but at least it is just a denial of service and not a possible privilege escalation.