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: <CAMk6uBmE01EpAw3e8kB9v6tEkU0rAPqt8T7+k54QDzDxtDn7PQ@mail.gmail.com>
Date:	Thu, 28 Jul 2011 18:39:44 +0800
From:	real mz <realmz6@...il.com>
To:	Leo Yan <leoy@...vell.com>
Cc:	linux-arm-kernel@...ts.infradead.org,
	Jean-Christophe PLAGNIOL-VILLARD <plagnioj@...osoft.com>,
	linux-kernel@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>, ying.huang@...el.com
Subject: Re: [PATCH] lib/genalloc: fix gen_pool_virt_to_phys locking

this fix seems already on next tree

http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=blob;f=lib/genalloc.c;h=f352cc42f4f8a58b8e4c8304de32cb31b4e29b67;hb=HEAD


On Tue, Jul 26, 2011 at 3:19 PM, Leo Yan <leoy@...vell.com> wrote:
> The func gen_pool_virt_to_phys will iterate the chunk list;
> if find the correct chunk it should need release pool's lock.
>
> Signed-off-by: Leo Yan <leoy@...vell.com>
> ---
>  lib/genalloc.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/lib/genalloc.c b/lib/genalloc.c
> index 577ddf8..e625df5 100644
> --- a/lib/genalloc.c
> +++ b/lib/genalloc.c
> @@ -92,8 +92,10 @@ phys_addr_t gen_pool_virt_to_phys(struct gen_pool *pool, unsigned long addr)
>        list_for_each(_chunk, &pool->chunks) {
>                chunk = list_entry(_chunk, struct gen_pool_chunk, next_chunk);
>
> -               if (addr >= chunk->start_addr && addr < chunk->end_addr)
> +               if (addr >= chunk->start_addr && addr < chunk->end_addr) {
> +                       read_unlock(&pool->lock);
>                        return chunk->phys_addr + addr - chunk->start_addr;
> +               }
>        }
>        read_unlock(&pool->lock);
>
> --
> 1.7.4.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>
--
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