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  linux-cve-announce  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]
Message-ID: <Pine.LNX.4.64.0811152003360.1618@blonde.site>
Date:	Sat, 15 Nov 2008 20:15:15 +0000 (GMT)
From:	Hugh Dickins <hugh@...itas.com>
To:	Arjan van de Ven <arjan@...radead.org>
cc:	linux-kernel@...r.kernel.org, htejun@...il.com,
	akpm@...ux-foundation.org, jens.axboe@...cle.com
Subject: Re: [PATCH] Fix kunmap() argument in sg_miter_stop

On Sat, 15 Nov 2008, Arjan van de Ven wrote:
> >From fd5530ac75a919a20bf7951e90a2b12323e9c0a0 Mon Sep 17 00:00:00 2001
> From: Arjan van de Ven <arjan@...ux.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!"

Your patch looks like a good fix to me, but I don't get how its bug
would manifest as highmem_32.c:115 - that's a check in kunmap_atomic(),
whereas you're fixing a bad address to kunmap().

I'd expect what you're fixing to manifest as an mm/highmem.c:207 -
the BUG_ON(!vaddr) in kunmap_high().  Or have I just got in a
terrible muddle?

Of course, I'd love it to explain mm/highmem.c:319,
but I can't see that either.

Hugh

> 
> This is moderately popular on kerneloops.org, mostly in interaction with the MMC layer.
> 
> Reported-by: kerneloops.org
> CC: htejun@...il.com
> CC: stable@...nel.org
> 
> Signed-off-by: Arjan van de Ven <arjan@...ux.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
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ