Linux NFS development
 help / color / mirror / Atom feed
From: Olaf Kirch <okir@suse.de>
To: akpm@suse.de
Cc: nfs@lists.sourceforge.net, Marcus Meissner <meissner@suse.de>
Subject: [PATCH] groups_alloc(0) badness
Date: Tue, 6 Apr 2004 15:43:30 +0200	[thread overview]
Message-ID: <20040406134330.GE29906@suse.de> (raw)

Hi,

We're looking into an nfsd oops that is caused by a corrupted
group_info struct. I haven't nailed down the exact cause of
the oops, but Marcus Meissner pointed out one problem in
the current groups_alloc code.

When we do groups_alloc(0), which can happen e.g. in the nfsd
code, the code allocates a group_info struct with _no_ space for
group_info->blocks. Nevertheless it proceeds to set 
group_info->blocks[0] = group_info->small_block, clobbering whatever is
after the group_info block.

Here's a pseudo-diff to kernel/sys.c:groups_alloc:
------------------------------------------------------------------

        nblocks = (gidsetsize/NGROUPS_PER_BLOCK) +
            (gidsetsize%NGROUPS_PER_BLOCK?1:0);
+	if (unlikely(nblocks == 0))
+		nblocks = 1
        group_info = kmalloc(sizeof(*group_info) + nblocks*sizeof(gid_t *),
            GFP_USER);
        if (!group_info)

------------------------------------------------------------------

Cheers
Olaf
-- 
Olaf Kirch     |  The Hardware Gods hate me.
okir@suse.de   |
---------------+ 


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

                 reply	other threads:[~2004-04-06 13:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20040406134330.GE29906@suse.de \
    --to=okir@suse.de \
    --cc=akpm@suse.de \
    --cc=meissner@suse.de \
    --cc=nfs@lists.sourceforge.net \
    /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