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]
Date:	Fri, 7 Aug 2009 10:26:32 -0400
From:	Josh Boyer <jwboyer@...il.com>
To:	Adrian Hunter <adrian.hunter@...ia.com>
Cc:	JiSheng Zhang <jszhang3@...il.com>,
	"linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"dwmw2@...radead.org" <dwmw2@...radead.org>,
	"rmk@....linux.org.uk" <rmk@....linux.org.uk>,
	"Bityutskiy Artem (Nokia-D/Helsinki)" <Artem.Bityutskiy@...ia.com>
Subject: Re: [UBI UBIFS] replace vmalloc with kmalloc

On Fri, Aug 07, 2009 at 12:20:03PM +0300, Adrian Hunter wrote:
> JiSheng Zhang wrote:
>> If nandflash driver use DMA to support UBI and UBIFS i/o, there will
>> be panic like
>> the following. This is because UBI and UBIFS use vmalloced buffer
>> somewhere while
>> nandflash driver put the buffer under DMA and DMA support doesn't like vmalloced
>> memory.
>> [  412.369280] UBIFS: default file-system created
>> [  412.374879] Unable to handle kernel NULL pointer dereference at
>> virtual address 00000000
>> [  412.383177] UBIFS: background thread "ubifs_bgt0_0" started, PID 887
>> [  412.389656] pgd = c0004000
>> [  412.392419] [00000000] *pgd=00000000
>> [  412.396117] Internal error: Oops: 817 [#1] PREEMPT
>>
>> Yes, I know kmalloc may fail when memory get fragmented, but I grep the UBI and
>> UBIFS's source, there are six .c files and seven .c files using
>> vmalloc, the function
>> which call vmalloc are all called during the ubi being attached and
>> the volume being
>> mounted. In embedded system, this mainly happen during kernel boot, it
>> should succeed.
>>
>> After replacing vmalloc with kmalloc, ubi and ubifs runs fine on my
>> board. I can alos upload
>> a patch.
>>
>> Comments are welcomed!
>
> vmalloc allows large (> 128KiB) buffers, but kmalloc doesn't.
> So we presently have no choice but to use vmalloc.

You could use get_free_pages to get up to 2MiB, no?

josh
--
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