Subject: + mm-zbud-fix-condition-check-on-allocation-size.patch added to -mm tree To: heesub.shin@xxxxxxxxxxx,bob.liu@xxxxxxxxxx,d.j.shin@xxxxxxxxxxx,sjenning@xxxxxxxxxxxxxxxxxx,sunae.seo@xxxxxxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Thu, 18 Jul 2013 14:20:38 -0700 The patch titled Subject: mm: zbud: fix condition check on allocation size has been added to the -mm tree. Its filename is mm-zbud-fix-condition-check-on-allocation-size.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-zbud-fix-condition-check-on-allocation-size.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-zbud-fix-condition-check-on-allocation-size.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Heesub Shin <heesub.shin@xxxxxxxxxxx> Subject: mm: zbud: fix condition check on allocation size zbud_alloc() incorrectly verifies the size of allocation limit. It should deny the allocation request greater than (PAGE_SIZE - ZHDR_SIZE_ALIGNED - CHUNK_SIZE), not (PAGE_SIZE - ZHDR_SIZE_ALIGNED) which has no remaining spaces for its buddy. There is no point in spending the entire zbud page storing only a single page, since we don't have any benefits. Signed-off-by: Heesub Shin <heesub.shin@xxxxxxxxxxx> Acked-by: Seth Jennings <sjenning@xxxxxxxxxxxxxxxxxx> Cc: Bob Liu <bob.liu@xxxxxxxxxx> Cc: Dongjun Shin <d.j.shin@xxxxxxxxxxx> Cc: Sunae Seo <sunae.seo@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/zbud.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN mm/zbud.c~mm-zbud-fix-condition-check-on-allocation-size mm/zbud.c --- a/mm/zbud.c~mm-zbud-fix-condition-check-on-allocation-size +++ a/mm/zbud.c @@ -257,7 +257,7 @@ int zbud_alloc(struct zbud_pool *pool, i if (size <= 0 || gfp & __GFP_HIGHMEM) return -EINVAL; - if (size > PAGE_SIZE - ZHDR_SIZE_ALIGNED) + if (size > PAGE_SIZE - ZHDR_SIZE_ALIGNED - CHUNK_SIZE) return -ENOSPC; chunks = size_to_chunks(size); spin_lock(&pool->lock); _ Patches currently in -mm which might be from heesub.shin@xxxxxxxxxxx are mm-zbud-fix-condition-check-on-allocation-size.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html