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  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]
Date:	Wed, 7 Oct 2015 12:44:13 +0800
From:	Hui Zhu <teawater@...il.com>
To:	Minchan Kim <minchan@...nel.org>
Cc:	Hui Zhu <zhuhui@...omi.com>, ngupta@...are.org,
	Linux Memory Management List <linux-mm@...ck.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Sergey Senozhatsky <sergey.senozhatsky@...il.com>
Subject: Re: [PATCH] zsmalloc: fix obj_to_head use page_private(page) as value
 but not pointer

On Tue, Oct 6, 2015 at 9:54 PM, Minchan Kim <minchan@...nel.org> wrote:
> Hello,
>
> On Mon, Oct 05, 2015 at 04:23:01PM +0800, Hui Zhu wrote:
>> In function obj_malloc:
>>       if (!class->huge)
>>               /* record handle in the header of allocated chunk */
>>               link->handle = handle;
>>       else
>>               /* record handle in first_page->private */
>>               set_page_private(first_page, handle);
>> The huge's page save handle to private directly.
>>
>> But in obj_to_head:
>>       if (class->huge) {
>>               VM_BUG_ON(!is_first_page(page));
>>               return page_private(page);
>
> Typo.
>                 return *(unsigned long*)page_private(page);
>
> Please fix the description.
>
>>       } else
>>               return *(unsigned long *)obj;
>> It is used as a pointer.
>>
>> So change obj_to_head use page_private(page) as value but not pointer
>> in obj_to_head.
>
> The reason why there is no problem until now is huge-class page is
> born with ZS_FULL so it couldn't be migrated.
> Therefore, it shouldn't be real bug in practice.
> However, we need this patch for future-work "VM-aware zsmalloced
> page migration" to reduce external fragmentation.
>
>>
>> Signed-off-by: Hui Zhu <zhuhui@...omi.com>
>
> With fixing the comment,
>
> Acked-by: Minchan Kim <minchan@...nel.org>
>
> Thanks for the fix, Hui.
>

Thanks!  I will post a new version.

Best,
Hui

> --
> Kind regards,
> Minchan Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists