lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5fbb67aa-9651-6fb8-4339-a74ac53acb33@huawei.com>
Date:   Mon, 27 Sep 2021 11:06:27 +0800
From:   Kefeng Wang <wangkefeng.wang@...wei.com>
To:     Matthew Wilcox <willy@...radead.org>
CC:     <shakeelb@...gle.com>, <vbabka@...e.cz>,
        Christoph Lameter <cl@...ux.com>,
        Pekka Enberg <penberg@...nel.org>,
        David Rientjes <rientjes@...gle.com>,
        Joonsoo Kim <iamjoonsoo.kim@....com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        <linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH resend] slub: Add back check for free nonslab objects


On 2021/9/27 10:42, Matthew Wilcox wrote:
> On Mon, Sep 27, 2021 at 10:15:38AM +0800, Kefeng Wang wrote:
>> Commit ("0937502af7c9 slub: Add check for kfree() of non slab objects.")
>> add the ability, which should be needed in any configs to catch the
>> invalid free, they even could be potential issue, eg, memory corruption,
>> use after free and double-free, so replace VM_BUG_ON_PAGE to WARN_ON, and
>> add dump_page() to help use to debug the issue.
> Is dump_page() really the best way to catch such a thing?  I would have
> thought that printing the address of 'object' would be more helpful.

With no vmcore, dump_page() do help us to find a memory corruption issue.

We could add 'object ' address print too.

>
>> @@ -3522,7 +3522,8 @@ static inline void free_nonslab_page(struct page *page, void *object)
>>   {
>>   	unsigned int order = compound_order(page);
>>   
>> -	VM_BUG_ON_PAGE(!PageCompound(page), page);
>> +	if (WARN_ON(!PageCompound(page)))
>> +		dump_page(page, "invalid free nonslab page");
> .
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ