All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: linux-kernel@vger.kernel.org
Cc: htejun@gmail.com, akpm@linux-foundation.org, jens.axboe@oracle.com
Subject: [PATCH] Fix kunmap() argument in sg_miter_stop
Date: Sat, 15 Nov 2008 11:27:51 -0800	[thread overview]
Message-ID: <20081115112751.1d38c072@infradead.org> (raw)


>From fd5530ac75a919a20bf7951e90a2b12323e9c0a0 Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
Date: Sat, 15 Nov 2008 11:23:58 -0800
Subject: [PATCH] Fix kunmap() argument in sg_miter_stop

kunmap() takes as argument the struct page that orginally got kmap()'d,
however the sg_miter_stop() function passed it the kernel virtual address
instead, resulting in "kernel BUG at arch/x86/mm/highmem_32.c:115!"

This is moderately popular on kerneloops.org, mostly in interaction with the MMC layer.

Reported-by: kerneloops.org
CC: htejun@gmail.com
CC: stable@kernel.org

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
---
 lib/scatterlist.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/scatterlist.c b/lib/scatterlist.c
index 8d2688f..b7b449d 100644
--- a/lib/scatterlist.c
+++ b/lib/scatterlist.c
@@ -395,7 +395,7 @@ void sg_miter_stop(struct sg_mapping_iter *miter)
 			WARN_ON(!irqs_disabled());
 			kunmap_atomic(miter->addr, KM_BIO_SRC_IRQ);
 		} else
-			kunmap(miter->addr);
+			kunmap(miter->page);
 
 		miter->page = NULL;
 		miter->addr = NULL;
-- 
1.6.0.3


-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

             reply	other threads:[~2008-11-15 19:27 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-15 19:27 Arjan van de Ven [this message]
2008-11-15 20:15 ` [PATCH] Fix kunmap() argument in sg_miter_stop Hugh Dickins
2008-11-15 20:27   ` Arjan van de Ven
2008-11-15 20:39   ` Arjan van de Ven
2008-11-16  5:16     ` Tejun Heo
2008-11-17  8:11       ` Jens Axboe
2008-11-17  8:22         ` Ingo Molnar
2008-11-17  8:30           ` Jens Axboe
2008-11-17  8:50             ` Ingo Molnar
2008-11-17  8:58               ` Jens Axboe
2008-11-17  9:34                 ` Jens Axboe
2008-11-17  9:41                   ` Ingo Molnar
2008-11-17  9:45                     ` Jens Axboe
2008-11-17 11:13                       ` Jens Axboe
2008-11-17 17:08                         ` Jeremy Fitzhardinge
2008-11-17 17:10                           ` Ingo Molnar
2008-11-17 17:15                             ` Jeremy Fitzhardinge
2008-11-17 17:25                               ` Linus Torvalds
2008-11-17 17:35                                 ` Jeremy Fitzhardinge
2008-11-17 18:14                                   ` [PATCH] xen: fix scrub_page() Ingo Molnar
2008-11-17 18:07                                 ` [PATCH] Fix kunmap() argument in sg_miter_stop Jens Axboe
2008-11-17 18:16                                   ` Linus Torvalds
2008-11-17 18:26                                     ` Jens Axboe
2008-11-18  8:27                                       ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081115112751.1d38c072@infradead.org \
    --to=arjan@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=htejun@gmail.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.