linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* zram: fix invalid memory references during disk write
@ 2012-11-30  6:45 Nitin Gupta
  2012-11-30  6:58 ` Nitin Gupta
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Nitin Gupta @ 2012-11-30  6:45 UTC (permalink / raw)
  To: Greg KH
  Cc: Jerome Marchand, Minchan Kim, Seth Jennings,
	Konrad Rzeszutek Wilk, Dan Carpenter, Sam Hansen,
	Linux Driver Project, linux-kernel

Fixes a bug introduced by commit c8f2f0db1 ("zram: Fix handling
of incompressible pages") which caused invalid memory references
during disk write. Invalid references could occur in two cases:
 - Incoming data expands on compression: In this case, reference was
made to kunmap()'ed bio page.
 - Partial (non PAGE_SIZE) write with incompressible data: In this
case, reference was made to a kfree()'ed buffer.

Fixes bug 50081:
https://bugzilla.kernel.org/show_bug.cgi?id=50081

Upstream commit ID: c8f2f0d: zram: Fix handling of incompressible pages
Apply to versions: 3.6.5, 3.6.6, 3.6.7, 3.6.8

Cc: <stable@vger.kernel.org> # staging-next: 37b51fd: zram: factor-out
				# zram_decompress_page() function
Signed-off-by: Nitin Gupta <ngupta@vflare.org>
Reported-by: Mihail Kasadjikov <hamer.mk@gmail.com>
Reported-by: Tomas M <tomas@slax.org>
Reviewed-by: Minchan Kim <minchan@kernel.org>
---
 drivers/staging/zram/zram_drv.c |   39 ++++++++++++++++++++++++---------------
 1 file changed, 24 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
index fb4a7c9..f2a73bd 100644
--- a/drivers/staging/zram/zram_drv.c
+++ b/drivers/staging/zram/zram_drv.c
@@ -265,7 +265,7 @@ out_cleanup:
 static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
 			   int offset)
 {
-	int ret;
+	int ret = 0;
 	size_t clen;
 	unsigned long handle;
 	struct page *page;
@@ -286,10 +286,8 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
 			goto out;
 		}
 		ret = zram_decompress_page(zram, uncmem, index);
-		if (ret) {
-			kfree(uncmem);
+		if (ret)
 			goto out;
-		}
 	}

 	/*
@@ -302,16 +300,18 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,

 	user_mem = kmap_atomic(page);

-	if (is_partial_io(bvec))
+	if (is_partial_io(bvec)) {
 		memcpy(uncmem + offset, user_mem + bvec->bv_offset,
 		       bvec->bv_len);
-	else
+		kunmap_atomic(user_mem);
+		user_mem = NULL;
+	} else {
 		uncmem = user_mem;
+	}

 	if (page_zero_filled(uncmem)) {
-		kunmap_atomic(user_mem);
-		if (is_partial_io(bvec))
-			kfree(uncmem);
+		if (!is_partial_io(bvec))
+			kunmap_atomic(user_mem);
 		zram_stat_inc(&zram->stats.pages_zero);
 		zram_set_flag(zram, index, ZRAM_ZERO);
 		ret = 0;
@@ -321,9 +321,11 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
 	ret = lzo1x_1_compress(uncmem, PAGE_SIZE, src, &clen,
 			       zram->compress_workmem);

-	kunmap_atomic(user_mem);
-	if (is_partial_io(bvec))
-			kfree(uncmem);
+	if (!is_partial_io(bvec)) {
+		kunmap_atomic(user_mem);
+		user_mem = NULL;
+		uncmem = NULL;
+	}

 	if (unlikely(ret != LZO_E_OK)) {
 		pr_err("Compression failed! err=%d\n", ret);
@@ -332,8 +334,10 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,

 	if (unlikely(clen > max_zpage_size)) {
 		zram_stat_inc(&zram->stats.bad_compress);
-		src = uncmem;
 		clen = PAGE_SIZE;
+		src = NULL;
+		if (is_partial_io(bvec))
+			src = uncmem;
 	}

 	handle = zs_malloc(zram->mem_pool, clen);
@@ -345,7 +349,11 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
 	}
 	cmem = zs_map_object(zram->mem_pool, handle, ZS_MM_WO);

+	if ((clen == PAGE_SIZE) && !is_partial_io(bvec))
+		src = kmap_atomic(page);
 	memcpy(cmem, src, clen);
+	if ((clen == PAGE_SIZE) && !is_partial_io(bvec))
+		kunmap_atomic(src);

 	zs_unmap_object(zram->mem_pool, handle);

@@ -358,9 +366,10 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
 	if (clen <= PAGE_SIZE / 2)
 		zram_stat_inc(&zram->stats.good_compress);

-	return 0;
-
 out:
+	if (is_partial_io(bvec))
+		kfree(uncmem);
+
 	if (ret)
 		zram_stat64_inc(zram, &zram->stats.failed_writes);
 	return ret;
--
1.7.10.4


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: zram: fix invalid memory references during disk write
  2012-11-30  6:45 zram: fix invalid memory references during disk write Nitin Gupta
@ 2012-11-30  6:58 ` Nitin Gupta
  2012-12-08  0:50 ` Nitin Gupta
  2012-12-11 18:27 ` Greg KH
  2 siblings, 0 replies; 18+ messages in thread
From: Nitin Gupta @ 2012-11-30  6:58 UTC (permalink / raw)
  To: Greg KH
  Cc: Jerome Marchand, Minchan Kim, Seth Jennings,
	Konrad Rzeszutek Wilk, Dan Carpenter, Sam Hansen,
	Linux Driver Project, linux-kernel, stable

(somehow mail didn't go to the stable email alias and [PATCH] prefix was 
not added. CC'ed stable now)

On 11/29/2012 10:45 PM, Nitin Gupta wrote:
> Fixes a bug introduced by commit c8f2f0db1 ("zram: Fix handling
> of incompressible pages") which caused invalid memory references
> during disk write. Invalid references could occur in two cases:
>   - Incoming data expands on compression: In this case, reference was
> made to kunmap()'ed bio page.
>   - Partial (non PAGE_SIZE) write with incompressible data: In this
> case, reference was made to a kfree()'ed buffer.
>
> Fixes bug 50081:
> https://bugzilla.kernel.org/show_bug.cgi?id=50081
>
> Upstream commit ID: c8f2f0d: zram: Fix handling of incompressible pages
> Apply to versions: 3.6.5, 3.6.6, 3.6.7, 3.6.8
>
> Cc: <stable@vger.kernel.org> # staging-next: 37b51fd: zram: factor-out
> 				# zram_decompress_page() function
> Signed-off-by: Nitin Gupta <ngupta@vflare.org>
> Reported-by: Mihail Kasadjikov <hamer.mk@gmail.com>
> Reported-by: Tomas M <tomas@slax.org>
> Reviewed-by: Minchan Kim <minchan@kernel.org>
> ---
>   drivers/staging/zram/zram_drv.c |   39 ++++++++++++++++++++++++---------------
>   1 file changed, 24 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
> index fb4a7c9..f2a73bd 100644
> --- a/drivers/staging/zram/zram_drv.c
> +++ b/drivers/staging/zram/zram_drv.c
> @@ -265,7 +265,7 @@ out_cleanup:
>   static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
>   			   int offset)
>   {
> -	int ret;
> +	int ret = 0;
>   	size_t clen;
>   	unsigned long handle;
>   	struct page *page;
> @@ -286,10 +286,8 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
>   			goto out;
>   		}
>   		ret = zram_decompress_page(zram, uncmem, index);
> -		if (ret) {
> -			kfree(uncmem);
> +		if (ret)
>   			goto out;
> -		}
>   	}
>
>   	/*
> @@ -302,16 +300,18 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
>
>   	user_mem = kmap_atomic(page);
>
> -	if (is_partial_io(bvec))
> +	if (is_partial_io(bvec)) {
>   		memcpy(uncmem + offset, user_mem + bvec->bv_offset,
>   		       bvec->bv_len);
> -	else
> +		kunmap_atomic(user_mem);
> +		user_mem = NULL;
> +	} else {
>   		uncmem = user_mem;
> +	}
>
>   	if (page_zero_filled(uncmem)) {
> -		kunmap_atomic(user_mem);
> -		if (is_partial_io(bvec))
> -			kfree(uncmem);
> +		if (!is_partial_io(bvec))
> +			kunmap_atomic(user_mem);
>   		zram_stat_inc(&zram->stats.pages_zero);
>   		zram_set_flag(zram, index, ZRAM_ZERO);
>   		ret = 0;
> @@ -321,9 +321,11 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
>   	ret = lzo1x_1_compress(uncmem, PAGE_SIZE, src, &clen,
>   			       zram->compress_workmem);
>
> -	kunmap_atomic(user_mem);
> -	if (is_partial_io(bvec))
> -			kfree(uncmem);
> +	if (!is_partial_io(bvec)) {
> +		kunmap_atomic(user_mem);
> +		user_mem = NULL;
> +		uncmem = NULL;
> +	}
>
>   	if (unlikely(ret != LZO_E_OK)) {
>   		pr_err("Compression failed! err=%d\n", ret);
> @@ -332,8 +334,10 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
>
>   	if (unlikely(clen > max_zpage_size)) {
>   		zram_stat_inc(&zram->stats.bad_compress);
> -		src = uncmem;
>   		clen = PAGE_SIZE;
> +		src = NULL;
> +		if (is_partial_io(bvec))
> +			src = uncmem;
>   	}
>
>   	handle = zs_malloc(zram->mem_pool, clen);
> @@ -345,7 +349,11 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
>   	}
>   	cmem = zs_map_object(zram->mem_pool, handle, ZS_MM_WO);
>
> +	if ((clen == PAGE_SIZE) && !is_partial_io(bvec))
> +		src = kmap_atomic(page);
>   	memcpy(cmem, src, clen);
> +	if ((clen == PAGE_SIZE) && !is_partial_io(bvec))
> +		kunmap_atomic(src);
>
>   	zs_unmap_object(zram->mem_pool, handle);
>
> @@ -358,9 +366,10 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
>   	if (clen <= PAGE_SIZE / 2)
>   		zram_stat_inc(&zram->stats.good_compress);
>
> -	return 0;
> -
>   out:
> +	if (is_partial_io(bvec))
> +		kfree(uncmem);
> +
>   	if (ret)
>   		zram_stat64_inc(zram, &zram->stats.failed_writes);
>   	return ret;
> --
> 1.7.10.4
>


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: zram: fix invalid memory references during disk write
  2012-11-30  6:45 zram: fix invalid memory references during disk write Nitin Gupta
  2012-11-30  6:58 ` Nitin Gupta
@ 2012-12-08  0:50 ` Nitin Gupta
  2012-12-08 19:47   ` Greg KH
  2012-12-11 18:27 ` Greg KH
  2 siblings, 1 reply; 18+ messages in thread
From: Nitin Gupta @ 2012-12-08  0:50 UTC (permalink / raw)
  To: Greg KH
  Cc: Jerome Marchand, Minchan Kim, Seth Jennings,
	Konrad Rzeszutek Wilk, Dan Carpenter, Sam Hansen,
	Linux Driver Project, linux-kernel, stable

On Thu, Nov 29, 2012 at 10:45 PM, Nitin Gupta <ngupta@vflare.org> wrote:
> Fixes a bug introduced by commit c8f2f0db1 ("zram: Fix handling
> of incompressible pages") which caused invalid memory references
> during disk write. Invalid references could occur in two cases:
>  - Incoming data expands on compression: In this case, reference was
> made to kunmap()'ed bio page.
>  - Partial (non PAGE_SIZE) write with incompressible data: In this
> case, reference was made to a kfree()'ed buffer.
>
> Fixes bug 50081:
> https://bugzilla.kernel.org/show_bug.cgi?id=50081
>
> Upstream commit ID: c8f2f0d: zram: Fix handling of incompressible pages
> Apply to versions: 3.6.5, 3.6.6, 3.6.7, 3.6.8
>

Greg: can you please apply these patches to above stable versions
and also 3.6.9?

Thanks,
Nitin

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: zram: fix invalid memory references during disk write
  2012-12-08  0:50 ` Nitin Gupta
@ 2012-12-08 19:47   ` Greg KH
  0 siblings, 0 replies; 18+ messages in thread
From: Greg KH @ 2012-12-08 19:47 UTC (permalink / raw)
  To: Nitin Gupta
  Cc: Jerome Marchand, Minchan Kim, Seth Jennings,
	Konrad Rzeszutek Wilk, Dan Carpenter, Sam Hansen,
	Linux Driver Project, linux-kernel, stable

On Fri, Dec 07, 2012 at 04:50:37PM -0800, Nitin Gupta wrote:
> On Thu, Nov 29, 2012 at 10:45 PM, Nitin Gupta <ngupta@vflare.org> wrote:
> > Fixes a bug introduced by commit c8f2f0db1 ("zram: Fix handling
> > of incompressible pages") which caused invalid memory references
> > during disk write. Invalid references could occur in two cases:
> >  - Incoming data expands on compression: In this case, reference was
> > made to kunmap()'ed bio page.
> >  - Partial (non PAGE_SIZE) write with incompressible data: In this
> > case, reference was made to a kfree()'ed buffer.
> >
> > Fixes bug 50081:
> > https://bugzilla.kernel.org/show_bug.cgi?id=50081
> >
> > Upstream commit ID: c8f2f0d: zram: Fix handling of incompressible pages
> > Apply to versions: 3.6.5, 3.6.6, 3.6.7, 3.6.8
> >
> 
> Greg: can you please apply these patches to above stable versions
> and also 3.6.9?

Hm, sorry, I thought this was for the 3.7 tree, I'll queue this up for
the next round of 3.6-stable patches.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: zram: fix invalid memory references during disk write
  2012-11-30  6:45 zram: fix invalid memory references during disk write Nitin Gupta
  2012-11-30  6:58 ` Nitin Gupta
  2012-12-08  0:50 ` Nitin Gupta
@ 2012-12-11 18:27 ` Greg KH
  2012-12-13  4:30   ` Nitin Gupta
  2012-12-18 21:12   ` Nitin Gupta
  2 siblings, 2 replies; 18+ messages in thread
From: Greg KH @ 2012-12-11 18:27 UTC (permalink / raw)
  To: Nitin Gupta
  Cc: Jerome Marchand, Minchan Kim, Seth Jennings,
	Konrad Rzeszutek Wilk, Dan Carpenter, Sam Hansen,
	Linux Driver Project, linux-kernel

On Thu, Nov 29, 2012 at 10:45:09PM -0800, Nitin Gupta wrote:
> Fixes a bug introduced by commit c8f2f0db1 ("zram: Fix handling
> of incompressible pages") which caused invalid memory references
> during disk write. Invalid references could occur in two cases:
>  - Incoming data expands on compression: In this case, reference was
> made to kunmap()'ed bio page.
>  - Partial (non PAGE_SIZE) write with incompressible data: In this
> case, reference was made to a kfree()'ed buffer.
> 
> Fixes bug 50081:
> https://bugzilla.kernel.org/show_bug.cgi?id=50081
> 
> Upstream commit ID: c8f2f0d: zram: Fix handling of incompressible pages
> Apply to versions: 3.6.5, 3.6.6, 3.6.7, 3.6.8
> 
> Cc: <stable@vger.kernel.org> # staging-next: 37b51fd: zram: factor-out
> 				# zram_decompress_page() function
> Signed-off-by: Nitin Gupta <ngupta@vflare.org>
> Reported-by: Mihail Kasadjikov <hamer.mk@gmail.com>
> Reported-by: Tomas M <tomas@slax.org>
> Reviewed-by: Minchan Kim <minchan@kernel.org>
> ---
>  drivers/staging/zram/zram_drv.c |   39 ++++++++++++++++++++++++---------------
>  1 file changed, 24 insertions(+), 15 deletions(-)

This patch fails to apply to 3.6.10:

patching file drivers/staging/zram/zram_drv.c
Hunk #1 succeeded at 282 (offset 17 lines).
Hunk #2 FAILED at 286.
Hunk #3 succeeded at 319 (offset 17 lines).
Hunk #4 succeeded at 340 (offset 17 lines).
Hunk #5 succeeded at 353 (offset 17 lines).
Hunk #6 succeeded at 368 (offset 17 lines).
Hunk #7 succeeded at 385 (offset 17 lines).
1 out of 7 hunks FAILED -- saving rejects to file drivers/staging/zram/zram_drv.c.rej

Please redo this patch and resend it if you wish for it to be applied to
the 3.6-stable tree.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: zram: fix invalid memory references during disk write
  2012-12-11 18:27 ` Greg KH
@ 2012-12-13  4:30   ` Nitin Gupta
  2012-12-18 21:12   ` Nitin Gupta
  1 sibling, 0 replies; 18+ messages in thread
From: Nitin Gupta @ 2012-12-13  4:30 UTC (permalink / raw)
  To: Greg KH
  Cc: Jerome Marchand, Minchan Kim, Seth Jennings,
	Konrad Rzeszutek Wilk, Dan Carpenter, Sam Hansen,
	Linux Driver Project, linux-kernel

On 12/11/2012 10:27 AM, Greg KH wrote:
> On Thu, Nov 29, 2012 at 10:45:09PM -0800, Nitin Gupta wrote:
>> Fixes a bug introduced by commit c8f2f0db1 ("zram: Fix handling
>> of incompressible pages") which caused invalid memory references
>> during disk write. Invalid references could occur in two cases:
>>  - Incoming data expands on compression: In this case, reference was
>> made to kunmap()'ed bio page.
>>  - Partial (non PAGE_SIZE) write with incompressible data: In this
>> case, reference was made to a kfree()'ed buffer.
>>
>> Fixes bug 50081:
>> https://bugzilla.kernel.org/show_bug.cgi?id=50081
>>
>> Upstream commit ID: c8f2f0d: zram: Fix handling of incompressible pages
>> Apply to versions: 3.6.5, 3.6.6, 3.6.7, 3.6.8
>>
>> Cc: <stable@vger.kernel.org> # staging-next: 37b51fd: zram: factor-out
>> 				# zram_decompress_page() function
>> Signed-off-by: Nitin Gupta <ngupta@vflare.org>
>> Reported-by: Mihail Kasadjikov <hamer.mk@gmail.com>
>> Reported-by: Tomas M <tomas@slax.org>
>> Reviewed-by: Minchan Kim <minchan@kernel.org>
>> ---
>>  drivers/staging/zram/zram_drv.c |   39 ++++++++++++++++++++++++---------------
>>  1 file changed, 24 insertions(+), 15 deletions(-)
> 
> This patch fails to apply to 3.6.10:
> 
> patching file drivers/staging/zram/zram_drv.c
> Hunk #1 succeeded at 282 (offset 17 lines).
> Hunk #2 FAILED at 286.
> Hunk #3 succeeded at 319 (offset 17 lines).
> Hunk #4 succeeded at 340 (offset 17 lines).
> Hunk #5 succeeded at 353 (offset 17 lines).
> Hunk #6 succeeded at 368 (offset 17 lines).
> Hunk #7 succeeded at 385 (offset 17 lines).
> 1 out of 7 hunks FAILED -- saving rejects to file drivers/staging/zram/zram_drv.c.rej
> 
> Please redo this patch and resend it if you wish for it to be applied to
> the 3.6-stable tree.
>

Please apply 37b51fd ("zram: factor-out zram_decompress_page()
function") before applying this patch. I also mentioned this in the
changelog description above in the format as specified in
stable_kernel_rules.txt but looks like I misunderstood that doc.

Thanks,
Nitin



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: zram: fix invalid memory references during disk write
  2012-12-11 18:27 ` Greg KH
  2012-12-13  4:30   ` Nitin Gupta
@ 2012-12-18 21:12   ` Nitin Gupta
  2012-12-19  3:49     ` Greg KH
  1 sibling, 1 reply; 18+ messages in thread
From: Nitin Gupta @ 2012-12-18 21:12 UTC (permalink / raw)
  To: Greg KH
  Cc: Jerome Marchand, Minchan Kim, Seth Jennings,
	Konrad Rzeszutek Wilk, Dan Carpenter, Sam Hansen,
	Linux Driver Project, linux-kernel, stable

On Tue, Dec 11, 2012 at 10:27 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Thu, Nov 29, 2012 at 10:45:09PM -0800, Nitin Gupta wrote:
>> Fixes a bug introduced by commit c8f2f0db1 ("zram: Fix handling
>> of incompressible pages") which caused invalid memory references
>> during disk write. Invalid references could occur in two cases:
>>  - Incoming data expands on compression: In this case, reference was
>> made to kunmap()'ed bio page.
>>  - Partial (non PAGE_SIZE) write with incompressible data: In this
>> case, reference was made to a kfree()'ed buffer.
>>
>> Fixes bug 50081:
>> https://bugzilla.kernel.org/show_bug.cgi?id=50081
>>
>> Upstream commit ID: c8f2f0d: zram: Fix handling of incompressible pages
>> Apply to versions: 3.6.5, 3.6.6, 3.6.7, 3.6.8
>>
>> Cc: <stable@vger.kernel.org> # staging-next: 37b51fd: zram: factor-out
>>                               # zram_decompress_page() function
>> Signed-off-by: Nitin Gupta <ngupta@vflare.org>
>> Reported-by: Mihail Kasadjikov <hamer.mk@gmail.com>
>> Reported-by: Tomas M <tomas@slax.org>
>> Reviewed-by: Minchan Kim <minchan@kernel.org>
>> ---
>>  drivers/staging/zram/zram_drv.c |   39 ++++++++++++++++++++++++---------------
>>  1 file changed, 24 insertions(+), 15 deletions(-)
>
> This patch fails to apply to 3.6.10:
>
> patching file drivers/staging/zram/zram_drv.c
> Hunk #1 succeeded at 282 (offset 17 lines).
> Hunk #2 FAILED at 286.
> Hunk #3 succeeded at 319 (offset 17 lines).
> Hunk #4 succeeded at 340 (offset 17 lines).
> Hunk #5 succeeded at 353 (offset 17 lines).
> Hunk #6 succeeded at 368 (offset 17 lines).
> Hunk #7 succeeded at 385 (offset 17 lines).
> 1 out of 7 hunks FAILED -- saving rejects to file drivers/staging/zram/zram_drv.c.rej
>
> Please redo this patch and resend it if you wish for it to be applied to
> the 3.6-stable tree.
>
>

Please apply this patch to stable tree asap.

As mentioned in changelog above, this patch depends on 37b51fd: zram: factor-out
zram_decompress_page() function. You will not get any rejects after
this patch is
applied.

 - Nitin

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: zram: fix invalid memory references during disk write
  2012-12-18 21:12   ` Nitin Gupta
@ 2012-12-19  3:49     ` Greg KH
  2012-12-19  7:21       ` Nitin Gupta
  0 siblings, 1 reply; 18+ messages in thread
From: Greg KH @ 2012-12-19  3:49 UTC (permalink / raw)
  To: Nitin Gupta
  Cc: Jerome Marchand, Minchan Kim, Seth Jennings,
	Konrad Rzeszutek Wilk, Dan Carpenter, Sam Hansen,
	Linux Driver Project, linux-kernel, stable

On Tue, Dec 18, 2012 at 01:12:05PM -0800, Nitin Gupta wrote:
> On Tue, Dec 11, 2012 at 10:27 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Thu, Nov 29, 2012 at 10:45:09PM -0800, Nitin Gupta wrote:
> >> Fixes a bug introduced by commit c8f2f0db1 ("zram: Fix handling
> >> of incompressible pages") which caused invalid memory references
> >> during disk write. Invalid references could occur in two cases:
> >>  - Incoming data expands on compression: In this case, reference was
> >> made to kunmap()'ed bio page.
> >>  - Partial (non PAGE_SIZE) write with incompressible data: In this
> >> case, reference was made to a kfree()'ed buffer.
> >>
> >> Fixes bug 50081:
> >> https://bugzilla.kernel.org/show_bug.cgi?id=50081
> >>
> >> Upstream commit ID: c8f2f0d: zram: Fix handling of incompressible pages
> >> Apply to versions: 3.6.5, 3.6.6, 3.6.7, 3.6.8
> >>
> >> Cc: <stable@vger.kernel.org> # staging-next: 37b51fd: zram: factor-out
> >>                               # zram_decompress_page() function
> >> Signed-off-by: Nitin Gupta <ngupta@vflare.org>
> >> Reported-by: Mihail Kasadjikov <hamer.mk@gmail.com>
> >> Reported-by: Tomas M <tomas@slax.org>
> >> Reviewed-by: Minchan Kim <minchan@kernel.org>
> >> ---
> >>  drivers/staging/zram/zram_drv.c |   39 ++++++++++++++++++++++++---------------
> >>  1 file changed, 24 insertions(+), 15 deletions(-)
> >
> > This patch fails to apply to 3.6.10:
> >
> > patching file drivers/staging/zram/zram_drv.c
> > Hunk #1 succeeded at 282 (offset 17 lines).
> > Hunk #2 FAILED at 286.
> > Hunk #3 succeeded at 319 (offset 17 lines).
> > Hunk #4 succeeded at 340 (offset 17 lines).
> > Hunk #5 succeeded at 353 (offset 17 lines).
> > Hunk #6 succeeded at 368 (offset 17 lines).
> > Hunk #7 succeeded at 385 (offset 17 lines).
> > 1 out of 7 hunks FAILED -- saving rejects to file drivers/staging/zram/zram_drv.c.rej
> >
> > Please redo this patch and resend it if you wish for it to be applied to
> > the 3.6-stable tree.
> >
> >
> 
> Please apply this patch to stable tree asap.

3.6 is now end-of-life, there will not be any more releases for that
kernel series anymore, sorry.

greg k-h

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: zram: fix invalid memory references during disk write
  2012-12-19  3:49     ` Greg KH
@ 2012-12-19  7:21       ` Nitin Gupta
  2012-12-19 15:08         ` Greg KH
  0 siblings, 1 reply; 18+ messages in thread
From: Nitin Gupta @ 2012-12-19  7:21 UTC (permalink / raw)
  To: Greg KH
  Cc: Jerome Marchand, Minchan Kim, Seth Jennings,
	Konrad Rzeszutek Wilk, Dan Carpenter, Sam Hansen,
	Linux Driver Project, linux-kernel, stable

On 12/18/2012 07:49 PM, Greg KH wrote:
> On Tue, Dec 18, 2012 at 01:12:05PM -0800, Nitin Gupta wrote:
>> On Tue, Dec 11, 2012 at 10:27 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
>>> On Thu, Nov 29, 2012 at 10:45:09PM -0800, Nitin Gupta wrote:
>>>> Fixes a bug introduced by commit c8f2f0db1 ("zram: Fix handling
>>>> of incompressible pages") which caused invalid memory references
>>>> during disk write. Invalid references could occur in two cases:
>>>>  - Incoming data expands on compression: In this case, reference was
>>>> made to kunmap()'ed bio page.
>>>>  - Partial (non PAGE_SIZE) write with incompressible data: In this
>>>> case, reference was made to a kfree()'ed buffer.
>>>>
>>>> Fixes bug 50081:
>>>> https://bugzilla.kernel.org/show_bug.cgi?id=50081
>>>>
>>>> Upstream commit ID: c8f2f0d: zram: Fix handling of incompressible pages
>>>> Apply to versions: 3.6.5, 3.6.6, 3.6.7, 3.6.8
>>>>
>>>> Cc: <stable@vger.kernel.org> # staging-next: 37b51fd: zram: factor-out
>>>>                               # zram_decompress_page() function
>>>> Signed-off-by: Nitin Gupta <ngupta@vflare.org>
>>>> Reported-by: Mihail Kasadjikov <hamer.mk@gmail.com>
>>>> Reported-by: Tomas M <tomas@slax.org>
>>>> Reviewed-by: Minchan Kim <minchan@kernel.org>
>>>> ---
>>>>  drivers/staging/zram/zram_drv.c |   39 ++++++++++++++++++++++++---------------
>>>>  1 file changed, 24 insertions(+), 15 deletions(-)
>>>
>>> This patch fails to apply to 3.6.10:
>>>
>>> patching file drivers/staging/zram/zram_drv.c
>>> Hunk #1 succeeded at 282 (offset 17 lines).
>>> Hunk #2 FAILED at 286.
>>> Hunk #3 succeeded at 319 (offset 17 lines).
>>> Hunk #4 succeeded at 340 (offset 17 lines).
>>> Hunk #5 succeeded at 353 (offset 17 lines).
>>> Hunk #6 succeeded at 368 (offset 17 lines).
>>> Hunk #7 succeeded at 385 (offset 17 lines).
>>> 1 out of 7 hunks FAILED -- saving rejects to file drivers/staging/zram/zram_drv.c.rej
>>>
>>> Please redo this patch and resend it if you wish for it to be applied to
>>> the 3.6-stable tree.
>>>
>>>
>>
>> Please apply this patch to stable tree asap.
> 
> 3.6 is now end-of-life, there will not be any more releases for that
> kernel series anymore, sorry.
> 

Then please apply to 3.7.

Nitin



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: zram: fix invalid memory references during disk write
  2012-12-19  7:21       ` Nitin Gupta
@ 2012-12-19 15:08         ` Greg KH
  2012-12-19 15:53           ` Nitin Gupta
  0 siblings, 1 reply; 18+ messages in thread
From: Greg KH @ 2012-12-19 15:08 UTC (permalink / raw)
  To: Nitin Gupta
  Cc: Seth Jennings, Jerome Marchand, Konrad Rzeszutek Wilk,
	linux-kernel, stable, Minchan Kim, Linux Driver Project,
	Dan Carpenter

On Tue, Dec 18, 2012 at 11:21:28PM -0800, Nitin Gupta wrote:
> On 12/18/2012 07:49 PM, Greg KH wrote:
> > On Tue, Dec 18, 2012 at 01:12:05PM -0800, Nitin Gupta wrote:
> >> On Tue, Dec 11, 2012 at 10:27 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> >>> On Thu, Nov 29, 2012 at 10:45:09PM -0800, Nitin Gupta wrote:
> >>>> Fixes a bug introduced by commit c8f2f0db1 ("zram: Fix handling
> >>>> of incompressible pages") which caused invalid memory references
> >>>> during disk write. Invalid references could occur in two cases:
> >>>>  - Incoming data expands on compression: In this case, reference was
> >>>> made to kunmap()'ed bio page.
> >>>>  - Partial (non PAGE_SIZE) write with incompressible data: In this
> >>>> case, reference was made to a kfree()'ed buffer.
> >>>>
> >>>> Fixes bug 50081:
> >>>> https://bugzilla.kernel.org/show_bug.cgi?id=50081
> >>>>
> >>>> Upstream commit ID: c8f2f0d: zram: Fix handling of incompressible pages
> >>>> Apply to versions: 3.6.5, 3.6.6, 3.6.7, 3.6.8
> >>>>
> >>>> Cc: <stable@vger.kernel.org> # staging-next: 37b51fd: zram: factor-out
> >>>>                               # zram_decompress_page() function
> >>>> Signed-off-by: Nitin Gupta <ngupta@vflare.org>
> >>>> Reported-by: Mihail Kasadjikov <hamer.mk@gmail.com>
> >>>> Reported-by: Tomas M <tomas@slax.org>
> >>>> Reviewed-by: Minchan Kim <minchan@kernel.org>
> >>>> ---
> >>>>  drivers/staging/zram/zram_drv.c |   39 ++++++++++++++++++++++++---------------
> >>>>  1 file changed, 24 insertions(+), 15 deletions(-)
> >>>
> >>> This patch fails to apply to 3.6.10:
> >>>
> >>> patching file drivers/staging/zram/zram_drv.c
> >>> Hunk #1 succeeded at 282 (offset 17 lines).
> >>> Hunk #2 FAILED at 286.
> >>> Hunk #3 succeeded at 319 (offset 17 lines).
> >>> Hunk #4 succeeded at 340 (offset 17 lines).
> >>> Hunk #5 succeeded at 353 (offset 17 lines).
> >>> Hunk #6 succeeded at 368 (offset 17 lines).
> >>> Hunk #7 succeeded at 385 (offset 17 lines).
> >>> 1 out of 7 hunks FAILED -- saving rejects to file drivers/staging/zram/zram_drv.c.rej
> >>>
> >>> Please redo this patch and resend it if you wish for it to be applied to
> >>> the 3.6-stable tree.
> >>>
> >>>
> >>
> >> Please apply this patch to stable tree asap.
> > 
> > 3.6 is now end-of-life, there will not be any more releases for that
> > kernel series anymore, sorry.
> > 
> 
> Then please apply to 3.7.

That is impossible to do so, for the obvious reason.

greg k-h

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: zram: fix invalid memory references during disk write
  2012-12-19 15:08         ` Greg KH
@ 2012-12-19 15:53           ` Nitin Gupta
  2012-12-19 16:17             ` Greg KH
  0 siblings, 1 reply; 18+ messages in thread
From: Nitin Gupta @ 2012-12-19 15:53 UTC (permalink / raw)
  To: Greg KH
  Cc: Seth Jennings, Jerome Marchand, Konrad Rzeszutek Wilk,
	linux-kernel, stable, Minchan Kim, Linux Driver Project,
	Dan Carpenter

On 12/19/2012 07:08 AM, Greg KH wrote:
> On Tue, Dec 18, 2012 at 11:21:28PM -0800, Nitin Gupta wrote:
>> On 12/18/2012 07:49 PM, Greg KH wrote:
>>> On Tue, Dec 18, 2012 at 01:12:05PM -0800, Nitin Gupta wrote:
>>>> On Tue, Dec 11, 2012 at 10:27 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
>>>>> On Thu, Nov 29, 2012 at 10:45:09PM -0800, Nitin Gupta wrote:
>>>>>> Fixes a bug introduced by commit c8f2f0db1 ("zram: Fix handling
>>>>>> of incompressible pages") which caused invalid memory references
>>>>>> during disk write. Invalid references could occur in two cases:
>>>>>>  - Incoming data expands on compression: In this case, reference was
>>>>>> made to kunmap()'ed bio page.
>>>>>>  - Partial (non PAGE_SIZE) write with incompressible data: In this
>>>>>> case, reference was made to a kfree()'ed buffer.
>>>>>>
>>>>>> Fixes bug 50081:
>>>>>> https://bugzilla.kernel.org/show_bug.cgi?id=50081
>>>>>>
>>>>>> Upstream commit ID: c8f2f0d: zram: Fix handling of incompressible pages
>>>>>> Apply to versions: 3.6.5, 3.6.6, 3.6.7, 3.6.8
>>>>>>
>>>>>> Cc: <stable@vger.kernel.org> # staging-next: 37b51fd: zram: factor-out
>>>>>>                               # zram_decompress_page() function
>>>>>> Signed-off-by: Nitin Gupta <ngupta@vflare.org>
>>>>>> Reported-by: Mihail Kasadjikov <hamer.mk@gmail.com>
>>>>>> Reported-by: Tomas M <tomas@slax.org>
>>>>>> Reviewed-by: Minchan Kim <minchan@kernel.org>
>>>>>> ---
>>>>>>  drivers/staging/zram/zram_drv.c |   39 ++++++++++++++++++++++++---------------
>>>>>>  1 file changed, 24 insertions(+), 15 deletions(-)
>>>>>
>>>>> This patch fails to apply to 3.6.10:
>>>>>
>>>>> patching file drivers/staging/zram/zram_drv.c
>>>>> Hunk #1 succeeded at 282 (offset 17 lines).
>>>>> Hunk #2 FAILED at 286.
>>>>> Hunk #3 succeeded at 319 (offset 17 lines).
>>>>> Hunk #4 succeeded at 340 (offset 17 lines).
>>>>> Hunk #5 succeeded at 353 (offset 17 lines).
>>>>> Hunk #6 succeeded at 368 (offset 17 lines).
>>>>> Hunk #7 succeeded at 385 (offset 17 lines).
>>>>> 1 out of 7 hunks FAILED -- saving rejects to file drivers/staging/zram/zram_drv.c.rej
>>>>>
>>>>> Please redo this patch and resend it if you wish for it to be applied to
>>>>> the 3.6-stable tree.
>>>>>
>>>>>
>>>>
>>>> Please apply this patch to stable tree asap.
>>>
>>> 3.6 is now end-of-life, there will not be any more releases for that
>>> kernel series anymore, sorry.
>>>
>>
>> Then please apply to 3.7.
> 
> That is impossible to do so, for the obvious reason.
> 

I meant to include it in whatever 3.7.x is released in future. Or put it
in staging, so it may eventually make it to mainline (by 3.8?).


Nitin


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: zram: fix invalid memory references during disk write
  2012-12-19 15:53           ` Nitin Gupta
@ 2012-12-19 16:17             ` Greg KH
  2012-12-19 17:21               ` Nitin Gupta
  0 siblings, 1 reply; 18+ messages in thread
From: Greg KH @ 2012-12-19 16:17 UTC (permalink / raw)
  To: Nitin Gupta
  Cc: Seth Jennings, Jerome Marchand, Konrad Rzeszutek Wilk,
	linux-kernel, stable, Minchan Kim, Linux Driver Project,
	Dan Carpenter

On Wed, Dec 19, 2012 at 07:53:36AM -0800, Nitin Gupta wrote:
> On 12/19/2012 07:08 AM, Greg KH wrote:
> > On Tue, Dec 18, 2012 at 11:21:28PM -0800, Nitin Gupta wrote:
> >> On 12/18/2012 07:49 PM, Greg KH wrote:
> >>> On Tue, Dec 18, 2012 at 01:12:05PM -0800, Nitin Gupta wrote:
> >>>> On Tue, Dec 11, 2012 at 10:27 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> >>>>> On Thu, Nov 29, 2012 at 10:45:09PM -0800, Nitin Gupta wrote:
> >>>>>> Fixes a bug introduced by commit c8f2f0db1 ("zram: Fix handling
> >>>>>> of incompressible pages") which caused invalid memory references
> >>>>>> during disk write. Invalid references could occur in two cases:
> >>>>>>  - Incoming data expands on compression: In this case, reference was
> >>>>>> made to kunmap()'ed bio page.
> >>>>>>  - Partial (non PAGE_SIZE) write with incompressible data: In this
> >>>>>> case, reference was made to a kfree()'ed buffer.
> >>>>>>
> >>>>>> Fixes bug 50081:
> >>>>>> https://bugzilla.kernel.org/show_bug.cgi?id=50081
> >>>>>>
> >>>>>> Upstream commit ID: c8f2f0d: zram: Fix handling of incompressible pages
> >>>>>> Apply to versions: 3.6.5, 3.6.6, 3.6.7, 3.6.8
> >>>>>>
> >>>>>> Cc: <stable@vger.kernel.org> # staging-next: 37b51fd: zram: factor-out
> >>>>>>                               # zram_decompress_page() function
> >>>>>> Signed-off-by: Nitin Gupta <ngupta@vflare.org>
> >>>>>> Reported-by: Mihail Kasadjikov <hamer.mk@gmail.com>
> >>>>>> Reported-by: Tomas M <tomas@slax.org>
> >>>>>> Reviewed-by: Minchan Kim <minchan@kernel.org>
> >>>>>> ---
> >>>>>>  drivers/staging/zram/zram_drv.c |   39 ++++++++++++++++++++++++---------------
> >>>>>>  1 file changed, 24 insertions(+), 15 deletions(-)
> >>>>>
> >>>>> This patch fails to apply to 3.6.10:
> >>>>>
> >>>>> patching file drivers/staging/zram/zram_drv.c
> >>>>> Hunk #1 succeeded at 282 (offset 17 lines).
> >>>>> Hunk #2 FAILED at 286.
> >>>>> Hunk #3 succeeded at 319 (offset 17 lines).
> >>>>> Hunk #4 succeeded at 340 (offset 17 lines).
> >>>>> Hunk #5 succeeded at 353 (offset 17 lines).
> >>>>> Hunk #6 succeeded at 368 (offset 17 lines).
> >>>>> Hunk #7 succeeded at 385 (offset 17 lines).
> >>>>> 1 out of 7 hunks FAILED -- saving rejects to file drivers/staging/zram/zram_drv.c.rej
> >>>>>
> >>>>> Please redo this patch and resend it if you wish for it to be applied to
> >>>>> the 3.6-stable tree.
> >>>>>
> >>>>>
> >>>>
> >>>> Please apply this patch to stable tree asap.
> >>>
> >>> 3.6 is now end-of-life, there will not be any more releases for that
> >>> kernel series anymore, sorry.
> >>>
> >>
> >> Then please apply to 3.7.
> > 
> > That is impossible to do so, for the obvious reason.
> > 
> 
> I meant to include it in whatever 3.7.x is released in future. Or put it
> in staging, so it may eventually make it to mainline (by 3.8?).

{sigh}

Please think for a moment for how it would be impossible for me to add
this patch to either the 3.7-stable tree, or the 3.8 tree, _again_.

greg k-h

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: zram: fix invalid memory references during disk write
  2012-12-19 16:17             ` Greg KH
@ 2012-12-19 17:21               ` Nitin Gupta
  2012-12-19 17:39                 ` Mitch Harder
  0 siblings, 1 reply; 18+ messages in thread
From: Nitin Gupta @ 2012-12-19 17:21 UTC (permalink / raw)
  To: Greg KH
  Cc: Seth Jennings, Jerome Marchand, Konrad Rzeszutek Wilk,
	linux-kernel, stable, Minchan Kim, Linux Driver Project,
	Dan Carpenter

On 12/19/2012 08:17 AM, Greg KH wrote:
> On Wed, Dec 19, 2012 at 07:53:36AM -0800, Nitin Gupta wrote:
>> On 12/19/2012 07:08 AM, Greg KH wrote:
>>> On Tue, Dec 18, 2012 at 11:21:28PM -0800, Nitin Gupta wrote:
>>>> On 12/18/2012 07:49 PM, Greg KH wrote:
>>>>> On Tue, Dec 18, 2012 at 01:12:05PM -0800, Nitin Gupta wrote:
>>>>>> On Tue, Dec 11, 2012 at 10:27 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
>>>>>>> On Thu, Nov 29, 2012 at 10:45:09PM -0800, Nitin Gupta wrote:
>>>>>>>> Fixes a bug introduced by commit c8f2f0db1 ("zram: Fix handling
>>>>>>>> of incompressible pages") which caused invalid memory references
>>>>>>>> during disk write. Invalid references could occur in two cases:
>>>>>>>>  - Incoming data expands on compression: In this case, reference was
>>>>>>>> made to kunmap()'ed bio page.
>>>>>>>>  - Partial (non PAGE_SIZE) write with incompressible data: In this
>>>>>>>> case, reference was made to a kfree()'ed buffer.
>>>>>>>>
>>>>>>>> Fixes bug 50081:
>>>>>>>> https://bugzilla.kernel.org/show_bug.cgi?id=50081
>>>>>>>>
>>>>>>>> Upstream commit ID: c8f2f0d: zram: Fix handling of incompressible pages
>>>>>>>> Apply to versions: 3.6.5, 3.6.6, 3.6.7, 3.6.8
>>>>>>>>
>>>>>>>> Cc: <stable@vger.kernel.org> # staging-next: 37b51fd: zram: factor-out
>>>>>>>>                               # zram_decompress_page() function
>>>>>>>> Signed-off-by: Nitin Gupta <ngupta@vflare.org>
>>>>>>>> Reported-by: Mihail Kasadjikov <hamer.mk@gmail.com>
>>>>>>>> Reported-by: Tomas M <tomas@slax.org>
>>>>>>>> Reviewed-by: Minchan Kim <minchan@kernel.org>
>>>>>>>> ---
>>>>>>>>  drivers/staging/zram/zram_drv.c |   39 ++++++++++++++++++++++++---------------
>>>>>>>>  1 file changed, 24 insertions(+), 15 deletions(-)
>>>>>>>
>>>>>>> This patch fails to apply to 3.6.10:
>>>>>>>
>>>>>>> patching file drivers/staging/zram/zram_drv.c
>>>>>>> Hunk #1 succeeded at 282 (offset 17 lines).
>>>>>>> Hunk #2 FAILED at 286.
>>>>>>> Hunk #3 succeeded at 319 (offset 17 lines).
>>>>>>> Hunk #4 succeeded at 340 (offset 17 lines).
>>>>>>> Hunk #5 succeeded at 353 (offset 17 lines).
>>>>>>> Hunk #6 succeeded at 368 (offset 17 lines).
>>>>>>> Hunk #7 succeeded at 385 (offset 17 lines).
>>>>>>> 1 out of 7 hunks FAILED -- saving rejects to file drivers/staging/zram/zram_drv.c.rej
>>>>>>>
>>>>>>> Please redo this patch and resend it if you wish for it to be applied to
>>>>>>> the 3.6-stable tree.
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> Please apply this patch to stable tree asap.
>>>>>
>>>>> 3.6 is now end-of-life, there will not be any more releases for that
>>>>> kernel series anymore, sorry.
>>>>>
>>>>
>>>> Then please apply to 3.7.
>>>
>>> That is impossible to do so, for the obvious reason.
>>>
>>
>> I meant to include it in whatever 3.7.x is released in future. Or put it
>> in staging, so it may eventually make it to mainline (by 3.8?).
> 
> {sigh}
> 
> Please think for a moment for how it would be impossible for me to add
> this patch to either the 3.7-stable tree, or the 3.8 tree, _again_.
>  

I'm simply not getting it, I'm sorry, I must be missing something
obvious -- what's really the problem with this: "whenever 3.8 is
released, sometime in the future, just make sure that this fix is
included in it" ?  Also, what's stopping it from staging, at least?

Nitin


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: zram: fix invalid memory references during disk write
  2012-12-19 17:21               ` Nitin Gupta
@ 2012-12-19 17:39                 ` Mitch Harder
  2012-12-20 22:48                   ` Nitin Gupta
  2013-01-14 19:19                   ` Greg KH
  0 siblings, 2 replies; 18+ messages in thread
From: Mitch Harder @ 2012-12-19 17:39 UTC (permalink / raw)
  To: Nitin Gupta
  Cc: Greg KH, Seth Jennings, Jerome Marchand, Konrad Rzeszutek Wilk,
	linux-kernel, stable, Minchan Kim, Linux Driver Project,
	Dan Carpenter

On Wed, Dec 19, 2012 at 11:21 AM, Nitin Gupta <ngupta@vflare.org> wrote:
> On 12/19/2012 08:17 AM, Greg KH wrote:
>> On Wed, Dec 19, 2012 at 07:53:36AM -0800, Nitin Gupta wrote:
>>> On 12/19/2012 07:08 AM, Greg KH wrote:
>>>> On Tue, Dec 18, 2012 at 11:21:28PM -0800, Nitin Gupta wrote:
>>>>> On 12/18/2012 07:49 PM, Greg KH wrote:
>>>>>> On Tue, Dec 18, 2012 at 01:12:05PM -0800, Nitin Gupta wrote:
>>>>>>> On Tue, Dec 11, 2012 at 10:27 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
>>>>>>>> On Thu, Nov 29, 2012 at 10:45:09PM -0800, Nitin Gupta wrote:
>>>>>>>>> Fixes a bug introduced by commit c8f2f0db1 ("zram: Fix handling
>>>>>>>>> of incompressible pages") which caused invalid memory references
>>>>>>>>> during disk write. Invalid references could occur in two cases:
>>>>>>>>>  - Incoming data expands on compression: In this case, reference was
>>>>>>>>> made to kunmap()'ed bio page.
>>>>>>>>>  - Partial (non PAGE_SIZE) write with incompressible data: In this
>>>>>>>>> case, reference was made to a kfree()'ed buffer.
>>>>>>>>>
>>>>>>>>> Fixes bug 50081:
>>>>>>>>> https://bugzilla.kernel.org/show_bug.cgi?id=50081
>>>>>>>>>
>>>>>>>>> Upstream commit ID: c8f2f0d: zram: Fix handling of incompressible pages
>>>>>>>>> Apply to versions: 3.6.5, 3.6.6, 3.6.7, 3.6.8
>>>>>>>>>
>>>>>>>>> Cc: <stable@vger.kernel.org> # staging-next: 37b51fd: zram: factor-out
>>>>>>>>>                               # zram_decompress_page() function
>>>>>>>>> Signed-off-by: Nitin Gupta <ngupta@vflare.org>
>>>>>>>>> Reported-by: Mihail Kasadjikov <hamer.mk@gmail.com>
>>>>>>>>> Reported-by: Tomas M <tomas@slax.org>
>>>>>>>>> Reviewed-by: Minchan Kim <minchan@kernel.org>
>>>>>>>>> ---
>>>>>>>>>  drivers/staging/zram/zram_drv.c |   39 ++++++++++++++++++++++++---------------
>>>>>>>>>  1 file changed, 24 insertions(+), 15 deletions(-)
>>>>>>>>
>>>>>>>> This patch fails to apply to 3.6.10:
>>>>>>>>
>>>>>>>> patching file drivers/staging/zram/zram_drv.c
>>>>>>>> Hunk #1 succeeded at 282 (offset 17 lines).
>>>>>>>> Hunk #2 FAILED at 286.
>>>>>>>> Hunk #3 succeeded at 319 (offset 17 lines).
>>>>>>>> Hunk #4 succeeded at 340 (offset 17 lines).
>>>>>>>> Hunk #5 succeeded at 353 (offset 17 lines).
>>>>>>>> Hunk #6 succeeded at 368 (offset 17 lines).
>>>>>>>> Hunk #7 succeeded at 385 (offset 17 lines).
>>>>>>>> 1 out of 7 hunks FAILED -- saving rejects to file drivers/staging/zram/zram_drv.c.rej
>>>>>>>>
>>>>>>>> Please redo this patch and resend it if you wish for it to be applied to
>>>>>>>> the 3.6-stable tree.
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>> Please apply this patch to stable tree asap.
>>>>>>
>>>>>> 3.6 is now end-of-life, there will not be any more releases for that
>>>>>> kernel series anymore, sorry.
>>>>>>
>>>>>
>>>>> Then please apply to 3.7.
>>>>
>>>> That is impossible to do so, for the obvious reason.
>>>>
>>>
>>> I meant to include it in whatever 3.7.x is released in future. Or put it
>>> in staging, so it may eventually make it to mainline (by 3.8?).
>>
>> {sigh}
>>
>> Please think for a moment for how it would be impossible for me to add
>> this patch to either the 3.7-stable tree, or the 3.8 tree, _again_.
>>
>
> I'm simply not getting it, I'm sorry, I must be missing something
> obvious -- what's really the problem with this: "whenever 3.8 is
> released, sometime in the future, just make sure that this fix is
> included in it" ?  Also, what's stopping it from staging, at least?
>

Greg:

I think there is still some residual confusion from the mix of patches
sent out for this issue.

You appear to be saying that this patch as well as "37b51fd: zram:
factor-out  zram_decompress_page() function" have already been
applied.

But I do not see either patch in 3.7.0 or in your message for
"3.7.1-stable review"

I see the "37b51fd: zram: factor-out  zram_decompress_page() function"
patch in Linus' tree for 3.8_rc, but not the patch discussed in this
thread.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: zram: fix invalid memory references during disk write
  2012-12-19 17:39                 ` Mitch Harder
@ 2012-12-20 22:48                   ` Nitin Gupta
  2013-01-14 19:19                   ` Greg KH
  1 sibling, 0 replies; 18+ messages in thread
From: Nitin Gupta @ 2012-12-20 22:48 UTC (permalink / raw)
  To: Mitch Harder
  Cc: Greg KH, Seth Jennings, Jerome Marchand, Konrad Rzeszutek Wilk,
	linux-kernel, stable, Minchan Kim, Linux Driver Project,
	Dan Carpenter

On Wed, Dec 19, 2012 at 9:39 AM, Mitch Harder
<mitch.harder@sabayonlinux.org> wrote:
> On Wed, Dec 19, 2012 at 11:21 AM, Nitin Gupta <ngupta@vflare.org> wrote:
>> On 12/19/2012 08:17 AM, Greg KH wrote:
>>> On Wed, Dec 19, 2012 at 07:53:36AM -0800, Nitin Gupta wrote:
>>>> On 12/19/2012 07:08 AM, Greg KH wrote:
>>>>> On Tue, Dec 18, 2012 at 11:21:28PM -0800, Nitin Gupta wrote:
>>>>>> On 12/18/2012 07:49 PM, Greg KH wrote:
>>>>>>> On Tue, Dec 18, 2012 at 01:12:05PM -0800, Nitin Gupta wrote:
>>>>>>>> On Tue, Dec 11, 2012 at 10:27 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
>>>>>>>>> On Thu, Nov 29, 2012 at 10:45:09PM -0800, Nitin Gupta wrote:
>>>>>>>>>> Fixes a bug introduced by commit c8f2f0db1 ("zram: Fix handling
>>>>>>>>>> of incompressible pages") which caused invalid memory references
>>>>>>>>>> during disk write. Invalid references could occur in two cases:
>>>>>>>>>>  - Incoming data expands on compression: In this case, reference was
>>>>>>>>>> made to kunmap()'ed bio page.
>>>>>>>>>>  - Partial (non PAGE_SIZE) write with incompressible data: In this
>>>>>>>>>> case, reference was made to a kfree()'ed buffer.
>>>>>>>>>>
>>>>>>>>>> Fixes bug 50081:
>>>>>>>>>> https://bugzilla.kernel.org/show_bug.cgi?id=50081
>>>>>>>>>>
>>>>>>>>>> Upstream commit ID: c8f2f0d: zram: Fix handling of incompressible pages
>>>>>>>>>> Apply to versions: 3.6.5, 3.6.6, 3.6.7, 3.6.8
>>>>>>>>>>
>>>>>>>>>> Cc: <stable@vger.kernel.org> # staging-next: 37b51fd: zram: factor-out
>>>>>>>>>>                               # zram_decompress_page() function
>>>>>>>>>> Signed-off-by: Nitin Gupta <ngupta@vflare.org>
>>>>>>>>>> Reported-by: Mihail Kasadjikov <hamer.mk@gmail.com>
>>>>>>>>>> Reported-by: Tomas M <tomas@slax.org>
>>>>>>>>>> Reviewed-by: Minchan Kim <minchan@kernel.org>
>>>>>>>>>> ---
>>>>>>>>>>  drivers/staging/zram/zram_drv.c |   39 ++++++++++++++++++++++++---------------
>>>>>>>>>>  1 file changed, 24 insertions(+), 15 deletions(-)
>>>>>>>>>
>>>>>>>>> This patch fails to apply to 3.6.10:
>>>>>>>>>
>>>>>>>>> patching file drivers/staging/zram/zram_drv.c
>>>>>>>>> Hunk #1 succeeded at 282 (offset 17 lines).
>>>>>>>>> Hunk #2 FAILED at 286.
>>>>>>>>> Hunk #3 succeeded at 319 (offset 17 lines).
>>>>>>>>> Hunk #4 succeeded at 340 (offset 17 lines).
>>>>>>>>> Hunk #5 succeeded at 353 (offset 17 lines).
>>>>>>>>> Hunk #6 succeeded at 368 (offset 17 lines).
>>>>>>>>> Hunk #7 succeeded at 385 (offset 17 lines).
>>>>>>>>> 1 out of 7 hunks FAILED -- saving rejects to file drivers/staging/zram/zram_drv.c.rej
>>>>>>>>>
>>>>>>>>> Please redo this patch and resend it if you wish for it to be applied to
>>>>>>>>> the 3.6-stable tree.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>> Please apply this patch to stable tree asap.
>>>>>>>
>>>>>>> 3.6 is now end-of-life, there will not be any more releases for that
>>>>>>> kernel series anymore, sorry.
>>>>>>>
>>>>>>
>>>>>> Then please apply to 3.7.
>>>>>
>>>>> That is impossible to do so, for the obvious reason.
>>>>>
>>>>
>>>> I meant to include it in whatever 3.7.x is released in future. Or put it
>>>> in staging, so it may eventually make it to mainline (by 3.8?).
>>>
>>> {sigh}
>>>
>>> Please think for a moment for how it would be impossible for me to add
>>> this patch to either the 3.7-stable tree, or the 3.8 tree, _again_.
>>>
>>
>> I'm simply not getting it, I'm sorry, I must be missing something
>> obvious -- what's really the problem with this: "whenever 3.8 is
>> released, sometime in the future, just make sure that this fix is
>> included in it" ?  Also, what's stopping it from staging, at least?
>>
>
> Greg:
>
> I think there is still some residual confusion from the mix of patches
> sent out for this issue.
>
> You appear to be saying that this patch as well as "37b51fd: zram:
> factor-out  zram_decompress_page() function" have already been
> applied.
>
> But I do not see either patch in 3.7.0 or in your message for
> "3.7.1-stable review"
>
> I see the "37b51fd: zram: factor-out  zram_decompress_page() function"
> patch in Linus' tree for 3.8_rc, but not the patch discussed in this
> thread.

Yes, both staging and linus' tree HEAD now contains the
"37b51fd: zram: factor-out  zram_decompress_page() function" patch.
So, all that's need to be done is to apply this patch only.

Since this patch is really critical for zram, please let me know how to
move forward and get it included.

Thanks,
Nitin

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: zram: fix invalid memory references during disk write
  2012-12-19 17:39                 ` Mitch Harder
  2012-12-20 22:48                   ` Nitin Gupta
@ 2013-01-14 19:19                   ` Greg KH
  2013-01-15  0:48                     ` Nitin Gupta
  1 sibling, 1 reply; 18+ messages in thread
From: Greg KH @ 2013-01-14 19:19 UTC (permalink / raw)
  To: Mitch Harder
  Cc: Nitin Gupta, Seth Jennings, Jerome Marchand,
	Konrad Rzeszutek Wilk, linux-kernel, stable, Minchan Kim,
	Linux Driver Project, Dan Carpenter

On Wed, Dec 19, 2012 at 11:39:15AM -0600, Mitch Harder wrote:
> On Wed, Dec 19, 2012 at 11:21 AM, Nitin Gupta <ngupta@vflare.org> wrote:
> > On 12/19/2012 08:17 AM, Greg KH wrote:
> >> On Wed, Dec 19, 2012 at 07:53:36AM -0800, Nitin Gupta wrote:
> >>> On 12/19/2012 07:08 AM, Greg KH wrote:
> >>>> On Tue, Dec 18, 2012 at 11:21:28PM -0800, Nitin Gupta wrote:
> >>>>> On 12/18/2012 07:49 PM, Greg KH wrote:
> >>>>>> On Tue, Dec 18, 2012 at 01:12:05PM -0800, Nitin Gupta wrote:
> >>>>>>> On Tue, Dec 11, 2012 at 10:27 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> >>>>>>>> On Thu, Nov 29, 2012 at 10:45:09PM -0800, Nitin Gupta wrote:
> >>>>>>>>> Fixes a bug introduced by commit c8f2f0db1 ("zram: Fix handling
> >>>>>>>>> of incompressible pages") which caused invalid memory references
> >>>>>>>>> during disk write. Invalid references could occur in two cases:
> >>>>>>>>>  - Incoming data expands on compression: In this case, reference was
> >>>>>>>>> made to kunmap()'ed bio page.
> >>>>>>>>>  - Partial (non PAGE_SIZE) write with incompressible data: In this
> >>>>>>>>> case, reference was made to a kfree()'ed buffer.
> >>>>>>>>>
> >>>>>>>>> Fixes bug 50081:
> >>>>>>>>> https://bugzilla.kernel.org/show_bug.cgi?id=50081
> >>>>>>>>>
> >>>>>>>>> Upstream commit ID: c8f2f0d: zram: Fix handling of incompressible pages
> >>>>>>>>> Apply to versions: 3.6.5, 3.6.6, 3.6.7, 3.6.8
> >>>>>>>>>
> >>>>>>>>> Cc: <stable@vger.kernel.org> # staging-next: 37b51fd: zram: factor-out
> >>>>>>>>>                               # zram_decompress_page() function
> >>>>>>>>> Signed-off-by: Nitin Gupta <ngupta@vflare.org>
> >>>>>>>>> Reported-by: Mihail Kasadjikov <hamer.mk@gmail.com>
> >>>>>>>>> Reported-by: Tomas M <tomas@slax.org>
> >>>>>>>>> Reviewed-by: Minchan Kim <minchan@kernel.org>
> >>>>>>>>> ---
> >>>>>>>>>  drivers/staging/zram/zram_drv.c |   39 ++++++++++++++++++++++++---------------
> >>>>>>>>>  1 file changed, 24 insertions(+), 15 deletions(-)
> >>>>>>>>
> >>>>>>>> This patch fails to apply to 3.6.10:
> >>>>>>>>
> >>>>>>>> patching file drivers/staging/zram/zram_drv.c
> >>>>>>>> Hunk #1 succeeded at 282 (offset 17 lines).
> >>>>>>>> Hunk #2 FAILED at 286.
> >>>>>>>> Hunk #3 succeeded at 319 (offset 17 lines).
> >>>>>>>> Hunk #4 succeeded at 340 (offset 17 lines).
> >>>>>>>> Hunk #5 succeeded at 353 (offset 17 lines).
> >>>>>>>> Hunk #6 succeeded at 368 (offset 17 lines).
> >>>>>>>> Hunk #7 succeeded at 385 (offset 17 lines).
> >>>>>>>> 1 out of 7 hunks FAILED -- saving rejects to file drivers/staging/zram/zram_drv.c.rej
> >>>>>>>>
> >>>>>>>> Please redo this patch and resend it if you wish for it to be applied to
> >>>>>>>> the 3.6-stable tree.
> >>>>>>>>
> >>>>>>>>
> >>>>>>>
> >>>>>>> Please apply this patch to stable tree asap.
> >>>>>>
> >>>>>> 3.6 is now end-of-life, there will not be any more releases for that
> >>>>>> kernel series anymore, sorry.
> >>>>>>
> >>>>>
> >>>>> Then please apply to 3.7.
> >>>>
> >>>> That is impossible to do so, for the obvious reason.
> >>>>
> >>>
> >>> I meant to include it in whatever 3.7.x is released in future. Or put it
> >>> in staging, so it may eventually make it to mainline (by 3.8?).
> >>
> >> {sigh}
> >>
> >> Please think for a moment for how it would be impossible for me to add
> >> this patch to either the 3.7-stable tree, or the 3.8 tree, _again_.
> >>
> >
> > I'm simply not getting it, I'm sorry, I must be missing something
> > obvious -- what's really the problem with this: "whenever 3.8 is
> > released, sometime in the future, just make sure that this fix is
> > included in it" ?  Also, what's stopping it from staging, at least?
> >
> 
> Greg:
> 
> I think there is still some residual confusion from the mix of patches
> sent out for this issue.
> 
> You appear to be saying that this patch as well as "37b51fd: zram:
> factor-out  zram_decompress_page() function" have already been
> applied.
> 
> But I do not see either patch in 3.7.0 or in your message for
> "3.7.1-stable review"
> 
> I see the "37b51fd: zram: factor-out  zram_decompress_page() function"
> patch in Linus' tree for 3.8_rc, but not the patch discussed in this
> thread.

Ok, I'm totally confused.

Please, can someone tell me _exactly_ what commits they wish to see
applied to the 3.7-stable tree.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: zram: fix invalid memory references during disk write
  2013-01-14 19:19                   ` Greg KH
@ 2013-01-15  0:48                     ` Nitin Gupta
  2013-01-15 12:33                       ` Greg KH
  0 siblings, 1 reply; 18+ messages in thread
From: Nitin Gupta @ 2013-01-15  0:48 UTC (permalink / raw)
  To: Greg KH
  Cc: Mitch Harder, Seth Jennings, Jerome Marchand,
	Konrad Rzeszutek Wilk, linux-kernel, stable, Minchan Kim,
	Linux Driver Project, Dan Carpenter

On Mon, Jan 14, 2013 at 11:19 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Wed, Dec 19, 2012 at 11:39:15AM -0600, Mitch Harder wrote:
>> On Wed, Dec 19, 2012 at 11:21 AM, Nitin Gupta <ngupta@vflare.org> wrote:
>> > On 12/19/2012 08:17 AM, Greg KH wrote:
>> >> On Wed, Dec 19, 2012 at 07:53:36AM -0800, Nitin Gupta wrote:
>> >>> On 12/19/2012 07:08 AM, Greg KH wrote:
>> >>>> On Tue, Dec 18, 2012 at 11:21:28PM -0800, Nitin Gupta wrote:
>> >>>>> On 12/18/2012 07:49 PM, Greg KH wrote:
>> >>>>>> On Tue, Dec 18, 2012 at 01:12:05PM -0800, Nitin Gupta wrote:
>> >>>>>>> On Tue, Dec 11, 2012 at 10:27 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
>> >>>>>>>> On Thu, Nov 29, 2012 at 10:45:09PM -0800, Nitin Gupta wrote:
>> >>>>>>>>> Fixes a bug introduced by commit c8f2f0db1 ("zram: Fix handling
>> >>>>>>>>> of incompressible pages") which caused invalid memory references
>> >>>>>>>>> during disk write. Invalid references could occur in two cases:
>> >>>>>>>>>  - Incoming data expands on compression: In this case, reference was
>> >>>>>>>>> made to kunmap()'ed bio page.
>> >>>>>>>>>  - Partial (non PAGE_SIZE) write with incompressible data: In this
>> >>>>>>>>> case, reference was made to a kfree()'ed buffer.
>> >>>>>>>>>
>> >>>>>>>>> Fixes bug 50081:
>> >>>>>>>>> https://bugzilla.kernel.org/show_bug.cgi?id=50081
>> >>>>>>>>>
>> >>>>>>>>> Upstream commit ID: c8f2f0d: zram: Fix handling of incompressible pages
>> >>>>>>>>> Apply to versions: 3.6.5, 3.6.6, 3.6.7, 3.6.8
>> >>>>>>>>>
>> >>>>>>>>> Cc: <stable@vger.kernel.org> # staging-next: 37b51fd: zram: factor-out
>> >>>>>>>>>                               # zram_decompress_page() function
>> >>>>>>>>> Signed-off-by: Nitin Gupta <ngupta@vflare.org>
>> >>>>>>>>> Reported-by: Mihail Kasadjikov <hamer.mk@gmail.com>
>> >>>>>>>>> Reported-by: Tomas M <tomas@slax.org>
>> >>>>>>>>> Reviewed-by: Minchan Kim <minchan@kernel.org>
>> >>>>>>>>> ---
>> >>>>>>>>>  drivers/staging/zram/zram_drv.c |   39 ++++++++++++++++++++++++---------------
>> >>>>>>>>>  1 file changed, 24 insertions(+), 15 deletions(-)
>> >>>>>>>>
>> >>>>>>>> This patch fails to apply to 3.6.10:
>> >>>>>>>>
>> >>>>>>>> patching file drivers/staging/zram/zram_drv.c
>> >>>>>>>> Hunk #1 succeeded at 282 (offset 17 lines).
>> >>>>>>>> Hunk #2 FAILED at 286.
>> >>>>>>>> Hunk #3 succeeded at 319 (offset 17 lines).
>> >>>>>>>> Hunk #4 succeeded at 340 (offset 17 lines).
>> >>>>>>>> Hunk #5 succeeded at 353 (offset 17 lines).
>> >>>>>>>> Hunk #6 succeeded at 368 (offset 17 lines).
>> >>>>>>>> Hunk #7 succeeded at 385 (offset 17 lines).
>> >>>>>>>> 1 out of 7 hunks FAILED -- saving rejects to file drivers/staging/zram/zram_drv.c.rej
>> >>>>>>>>
>> >>>>>>>> Please redo this patch and resend it if you wish for it to be applied to
>> >>>>>>>> the 3.6-stable tree.
>> >>>>>>>>
>> >>>>>>>>
>> >>>>>>>
>> >>>>>>> Please apply this patch to stable tree asap.
>> >>>>>>
>> >>>>>> 3.6 is now end-of-life, there will not be any more releases for that
>> >>>>>> kernel series anymore, sorry.
>> >>>>>>
>> >>>>>
>> >>>>> Then please apply to 3.7.
>> >>>>
>> >>>> That is impossible to do so, for the obvious reason.
>> >>>>
>> >>>
>> >>> I meant to include it in whatever 3.7.x is released in future. Or put it
>> >>> in staging, so it may eventually make it to mainline (by 3.8?).
>> >>
>> >> {sigh}
>> >>
>> >> Please think for a moment for how it would be impossible for me to add
>> >> this patch to either the 3.7-stable tree, or the 3.8 tree, _again_.
>> >>
>> >
>> > I'm simply not getting it, I'm sorry, I must be missing something
>> > obvious -- what's really the problem with this: "whenever 3.8 is
>> > released, sometime in the future, just make sure that this fix is
>> > included in it" ?  Also, what's stopping it from staging, at least?
>> >
>>
>> Greg:
>>
>> I think there is still some residual confusion from the mix of patches
>> sent out for this issue.
>>
>> You appear to be saying that this patch as well as "37b51fd: zram:
>> factor-out  zram_decompress_page() function" have already been
>> applied.
>>
>> But I do not see either patch in 3.7.0 or in your message for
>> "3.7.1-stable review"
>>
>> I see the "37b51fd: zram: factor-out  zram_decompress_page() function"
>> patch in Linus' tree for 3.8_rc, but not the patch discussed in this
>> thread.
>
> Ok, I'm totally confused.
>
> Please, can someone tell me _exactly_ what commits they wish to see
> applied to the 3.7-stable tree.
>
> thanks,
>
> greg k-h

These two needs to be applied to 3.7-stable:

1) 37b51fd: "staging: zram: factor-out zram_decompress_page() function"

and then...

2) 397c606: "staging: zram: fix invalid memory references during disk write"


Thanks,
Nitin

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: zram: fix invalid memory references during disk write
  2013-01-15  0:48                     ` Nitin Gupta
@ 2013-01-15 12:33                       ` Greg KH
  0 siblings, 0 replies; 18+ messages in thread
From: Greg KH @ 2013-01-15 12:33 UTC (permalink / raw)
  To: Nitin Gupta
  Cc: Mitch Harder, Seth Jennings, Jerome Marchand,
	Konrad Rzeszutek Wilk, linux-kernel, stable, Minchan Kim,
	Linux Driver Project, Dan Carpenter

On Mon, Jan 14, 2013 at 04:48:18PM -0800, Nitin Gupta wrote:
> On Mon, Jan 14, 2013 at 11:19 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Wed, Dec 19, 2012 at 11:39:15AM -0600, Mitch Harder wrote:
> >> On Wed, Dec 19, 2012 at 11:21 AM, Nitin Gupta <ngupta@vflare.org> wrote:
> >> > On 12/19/2012 08:17 AM, Greg KH wrote:
> >> >> On Wed, Dec 19, 2012 at 07:53:36AM -0800, Nitin Gupta wrote:
> >> >>> On 12/19/2012 07:08 AM, Greg KH wrote:
> >> >>>> On Tue, Dec 18, 2012 at 11:21:28PM -0800, Nitin Gupta wrote:
> >> >>>>> On 12/18/2012 07:49 PM, Greg KH wrote:
> >> >>>>>> On Tue, Dec 18, 2012 at 01:12:05PM -0800, Nitin Gupta wrote:
> >> >>>>>>> On Tue, Dec 11, 2012 at 10:27 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> >> >>>>>>>> On Thu, Nov 29, 2012 at 10:45:09PM -0800, Nitin Gupta wrote:
> >> >>>>>>>>> Fixes a bug introduced by commit c8f2f0db1 ("zram: Fix handling
> >> >>>>>>>>> of incompressible pages") which caused invalid memory references
> >> >>>>>>>>> during disk write. Invalid references could occur in two cases:
> >> >>>>>>>>>  - Incoming data expands on compression: In this case, reference was
> >> >>>>>>>>> made to kunmap()'ed bio page.
> >> >>>>>>>>>  - Partial (non PAGE_SIZE) write with incompressible data: In this
> >> >>>>>>>>> case, reference was made to a kfree()'ed buffer.
> >> >>>>>>>>>
> >> >>>>>>>>> Fixes bug 50081:
> >> >>>>>>>>> https://bugzilla.kernel.org/show_bug.cgi?id=50081
> >> >>>>>>>>>
> >> >>>>>>>>> Upstream commit ID: c8f2f0d: zram: Fix handling of incompressible pages
> >> >>>>>>>>> Apply to versions: 3.6.5, 3.6.6, 3.6.7, 3.6.8
> >> >>>>>>>>>
> >> >>>>>>>>> Cc: <stable@vger.kernel.org> # staging-next: 37b51fd: zram: factor-out
> >> >>>>>>>>>                               # zram_decompress_page() function
> >> >>>>>>>>> Signed-off-by: Nitin Gupta <ngupta@vflare.org>
> >> >>>>>>>>> Reported-by: Mihail Kasadjikov <hamer.mk@gmail.com>
> >> >>>>>>>>> Reported-by: Tomas M <tomas@slax.org>
> >> >>>>>>>>> Reviewed-by: Minchan Kim <minchan@kernel.org>
> >> >>>>>>>>> ---
> >> >>>>>>>>>  drivers/staging/zram/zram_drv.c |   39 ++++++++++++++++++++++++---------------
> >> >>>>>>>>>  1 file changed, 24 insertions(+), 15 deletions(-)
> >> >>>>>>>>
> >> >>>>>>>> This patch fails to apply to 3.6.10:
> >> >>>>>>>>
> >> >>>>>>>> patching file drivers/staging/zram/zram_drv.c
> >> >>>>>>>> Hunk #1 succeeded at 282 (offset 17 lines).
> >> >>>>>>>> Hunk #2 FAILED at 286.
> >> >>>>>>>> Hunk #3 succeeded at 319 (offset 17 lines).
> >> >>>>>>>> Hunk #4 succeeded at 340 (offset 17 lines).
> >> >>>>>>>> Hunk #5 succeeded at 353 (offset 17 lines).
> >> >>>>>>>> Hunk #6 succeeded at 368 (offset 17 lines).
> >> >>>>>>>> Hunk #7 succeeded at 385 (offset 17 lines).
> >> >>>>>>>> 1 out of 7 hunks FAILED -- saving rejects to file drivers/staging/zram/zram_drv.c.rej
> >> >>>>>>>>
> >> >>>>>>>> Please redo this patch and resend it if you wish for it to be applied to
> >> >>>>>>>> the 3.6-stable tree.
> >> >>>>>>>>
> >> >>>>>>>>
> >> >>>>>>>
> >> >>>>>>> Please apply this patch to stable tree asap.
> >> >>>>>>
> >> >>>>>> 3.6 is now end-of-life, there will not be any more releases for that
> >> >>>>>> kernel series anymore, sorry.
> >> >>>>>>
> >> >>>>>
> >> >>>>> Then please apply to 3.7.
> >> >>>>
> >> >>>> That is impossible to do so, for the obvious reason.
> >> >>>>
> >> >>>
> >> >>> I meant to include it in whatever 3.7.x is released in future. Or put it
> >> >>> in staging, so it may eventually make it to mainline (by 3.8?).
> >> >>
> >> >> {sigh}
> >> >>
> >> >> Please think for a moment for how it would be impossible for me to add
> >> >> this patch to either the 3.7-stable tree, or the 3.8 tree, _again_.
> >> >>
> >> >
> >> > I'm simply not getting it, I'm sorry, I must be missing something
> >> > obvious -- what's really the problem with this: "whenever 3.8 is
> >> > released, sometime in the future, just make sure that this fix is
> >> > included in it" ?  Also, what's stopping it from staging, at least?
> >> >
> >>
> >> Greg:
> >>
> >> I think there is still some residual confusion from the mix of patches
> >> sent out for this issue.
> >>
> >> You appear to be saying that this patch as well as "37b51fd: zram:
> >> factor-out  zram_decompress_page() function" have already been
> >> applied.
> >>
> >> But I do not see either patch in 3.7.0 or in your message for
> >> "3.7.1-stable review"
> >>
> >> I see the "37b51fd: zram: factor-out  zram_decompress_page() function"
> >> patch in Linus' tree for 3.8_rc, but not the patch discussed in this
> >> thread.
> >
> > Ok, I'm totally confused.
> >
> > Please, can someone tell me _exactly_ what commits they wish to see
> > applied to the 3.7-stable tree.
> >
> > thanks,
> >
> > greg k-h
> 
> These two needs to be applied to 3.7-stable:
> 
> 1) 37b51fd: "staging: zram: factor-out zram_decompress_page() function"
> 
> and then...
> 
> 2) 397c606: "staging: zram: fix invalid memory references during disk write"

Thanks, that makes sense.

But note, until today, I could not have done this at all, as the last
commit here was not in Linus's tree.  So I was right to be confused,
there was nothing I could do at the time.

Please be more careful in the future, developer's time is limited,
causing confusion doesn't help.

greg k-h

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2013-01-15 12:32 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-30  6:45 zram: fix invalid memory references during disk write Nitin Gupta
2012-11-30  6:58 ` Nitin Gupta
2012-12-08  0:50 ` Nitin Gupta
2012-12-08 19:47   ` Greg KH
2012-12-11 18:27 ` Greg KH
2012-12-13  4:30   ` Nitin Gupta
2012-12-18 21:12   ` Nitin Gupta
2012-12-19  3:49     ` Greg KH
2012-12-19  7:21       ` Nitin Gupta
2012-12-19 15:08         ` Greg KH
2012-12-19 15:53           ` Nitin Gupta
2012-12-19 16:17             ` Greg KH
2012-12-19 17:21               ` Nitin Gupta
2012-12-19 17:39                 ` Mitch Harder
2012-12-20 22:48                   ` Nitin Gupta
2013-01-14 19:19                   ` Greg KH
2013-01-15  0:48                     ` Nitin Gupta
2013-01-15 12:33                       ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).