[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20121129013320.GA24077@blaptop>
Date: Thu, 29 Nov 2012 10:33:20 +0900
From: Minchan Kim <minchan@...nel.org>
To: Nitin Gupta <ngupta@...are.org>
Cc: Greg KH <greg@...ah.com>,
Seth Jennings <sjenning@...ux.vnet.ibm.com>,
Dan Carpenter <dan.carpenter@...cle.com>,
Sam Hansen <solid.se7en@...il.com>, Tomas M <tomas@...x.org>,
Mihail Kasadjikov <hamer.mk@...il.com>,
Linux Driver Project <devel@...uxdriverproject.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] zram: Prevent use of unmapped buffer
On Wed, Nov 28, 2012 at 02:15:05PM +0900, Minchan Kim wrote:
> Hi Nitin,
>
> On Mon, Nov 26, 2012 at 11:26:07PM -0800, Nitin Gupta wrote:
> > The commit c8f2f0db1 ("zram: Fix handling of incompressible pages")
> > introduced a bug which caused a kunmap()'ed buffer to be used in case
>
> I got confused by the descripton. :(
> The descripton is not right.
> The problem is to access freed memory, not accessing to kunmaped buffer.
>
> partial I/O write.
>
> 1. uncmem = kmalloc
> 2. zram_decompress_page(uncmem)
> 3. memcpy(uncmem, user_mem)
> 4. lzo1x_1_compress(uncmem)
> 5. kfree(uncmem)
> 6. src = uncmem
> 7. memcpy(cmem, src, clen) <----- HIT
>
> > of partial writes where the data was found to be incompressible.
> >
I got it. You shouldn't mention partial write for proper description
because it was usecase for swap-over-zram so it can't make partial write.
Without partial write mention, your description is right but the problem
I mentioned above is another problem for partial write so we need a another
patch. I will cook.
Thanks.
> > This fixes bug 50081:
> > https://bugzilla.kernel.org/show_bug.cgi?id=50081
> >
> > Signed-off-by: Nitin Gupta <ngupta@...are.org>
> > Reported-by: Mihail Kasadjikov <hamer.mk@...il.com>
> > Reported-by: Tomas M <tomas@...x.org>
>
> Good catch! Shame on me. I should have reivewed more carefully. :(
> Please resend it with revised descrption and title.
> I will rebase mh patchset just sent on top of this bug fix patch.
>
> P.S) Sigh, Now code isn't clean due to partial read/write path handling.
> IMHO, sooner or later, we need refactoring.
>
> --
> 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/
--
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