[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1c05b986-e8bb-2ec1-7c81-06b7cfe50f94@nvidia.com>
Date: Mon, 5 Sep 2022 17:49:23 -0700
From: John Hubbard <jhubbard@...dia.com>
To: "Huang, Shaoqin" <shaoqin.huang@...el.com>,
"Edgecombe, Rick P" <rick.p.edgecombe@...el.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"pasha.tatashin@...een.com" <pasha.tatashin@...een.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm: Check writable zero page in page table check
On 9/5/22 17:24, Huang, Shaoqin wrote:
>
>
> On 9/6/2022 2:50 AM, Edgecombe, Rick P wrote:
>> On Sat, 2022-09-03 at 10:13 +0800, Huang, Shaoqin wrote:
>>>> + BUG_ON(is_zero_pfn(pfn) && rw);
>>>> +
>>>
>>> Why we need use BUG_ON() here? Based on [1], we should avoid to use
>>> the
>>> BUG_ON() due to it will panic the machine.
>>>
>>> [1]:
>>> https://lore.kernel.org/lkml/20220824163100.224449-1-david@redhat.com/
>>
>> Yea, you are probably right. All the rest of this checker uses BUG_ON()
>> though. Maybe they should all be something else? Just felt weird to
>> have this be the only check that is different.
>>
>> I don't have any objections to changing it to WARN_ON(). Should I
>> switch the rest of the checks here while I'm at it?
>
> Yes. I think in most situation, WARN_ON() or WARN_ON_ONCE() is ok.
>
+1 for WARN_ON_ONCE(), and also for changing the other cases as you find
them, yes.
thanks,
--
John Hubbard
NVIDIA
Powered by blists - more mailing lists