linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: "Andrey Borzenkov" <arvidjaar@mail.ru>
Cc: linux-kernel@vger.kernel.org, webvenza@libero.it
Subject: Re: 2.6.0-test1 devfs question
Date: Mon, 28 Jul 2003 00:22:16 -0700	[thread overview]
Message-ID: <20030728002216.4c3afb60.akpm@osdl.org> (raw)
In-Reply-To: <E19h2CQ-0009YQ-00.arvidjaar-mail-ru@f12.mail.ru>

"Andrey Borzenkov" <arvidjaar@mail.ru> wrote:
>
> the bug is almost for sure in init/do_mount_devfs.c:read_dir; it
>  allocates static buffer of size at most 2**MAX_ORDER and tries to
>  read the whole dir at once.

Yes, that function is buggy.

diff -puN init/do_mounts_devfs.c~read_dir-fix init/do_mounts_devfs.c
--- 25/init/do_mounts_devfs.c~read_dir-fix	2003-07-28 00:21:40.000000000 -0700
+++ 25-akpm/init/do_mounts_devfs.c	2003-07-28 00:21:40.000000000 -0700
@@ -54,7 +54,7 @@ static void * __init read_dir(char *path
 	if (fd < 0)
 		return NULL;
 
-	for (size = 1 << 9; size <= (1 << MAX_ORDER); size <<= 1) {
+	for (size = 1 << 9; size <= (PAGE_SIZE << MAX_ORDER); size <<= 1) {
 		void *p = kmalloc(size, GFP_KERNEL);
 		int n;
 		if (!p)

_


  reply	other threads:[~2003-07-28  7:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-28  7:13 2.6.0-test1 devfs question "Andrey Borzenkov" 
2003-07-28  7:22 ` Andrew Morton [this message]
2003-07-28 15:59   ` [BUG SQUISHED] " Daniele Venzano
  -- strict thread matches above, loose matches on Subject: below --
2003-07-26 19:51 Andrey Borzenkov
2003-07-26 20:50 ` Andrew Morton
2003-07-26 22:30   ` Andrey Borzenkov
2003-07-27  8:58     ` Daniele Venzano
2003-07-25 18:53 Balram Adlakha
2003-07-26 10:45 ` Wiktor Wodecki
     [not found]   ` <20030726175214.GA2535@localhost.localdomain>
     [not found]     ` <20030726183750.GB789@gmx.de>
     [not found]       ` <20030726201919.GA5166@localhost.localdomain>
2003-07-26 20:35         ` Wiktor Wodecki
2003-07-25 11:08 Wiktor Wodecki
2003-07-25 11:18 ` Wiktor Wodecki
2003-07-26 11:12 ` Daniele Venzano
2003-07-26 18:25   ` Andrew Morton
2003-07-27 11:17     ` Alan Cox

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=20030728002216.4c3afb60.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=arvidjaar@mail.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=webvenza@libero.it \
    /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 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).