public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Adrian Bunk <bunk@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>,
	swhiteho@redhat.com, cluster-devel@redhat.com,
	linux-kernel@vger.kernel.org
Subject: Re: gfs2_fh_to_parent() array overflow
Date: Sat, 27 Oct 2007 23:00:39 +0200	[thread overview]
Message-ID: <20071027210039.GA2688@lst.de> (raw)
In-Reply-To: <20071024162626.GJ30533@stusta.de>

On Wed, Oct 24, 2007 at 06:26:26PM +0200, Adrian Bunk wrote:
> The Coverity checker spotted the following array overflow caused by
> commit 34c0d154243dd913c5690ae6ceb9557017429b9c:

The line is a left-over from times when gfs stored the mode of the
inode in the file handle.  It can simply be deleted.  Steve, do you
want a patch for that or could you commit that one-liner directly?

> fs/gfs2/ops_export.c contains:
> 
> <--  snip  -->
> 
> ...
> static struct dentry *gfs2_fh_to_parent(struct super_block *sb, struct fid *fid,
>                 int fh_len, int fh_type)
> {
>         struct gfs2_inum_host parent;
>         __be32 *fh = (__force __be32 *)fid->raw;  <------------
> 
>         switch (fh_type) {
>         case GFS2_LARGE_FH_SIZE:
>         case GFS2_OLD_FH_SIZE:
>                 parent.no_formal_ino = ((u64)be32_to_cpu(fh[4])) << 32;
>                 parent.no_formal_ino |= be32_to_cpu(fh[5]);
>                 parent.no_addr = ((u64)be32_to_cpu(fh[6])) << 32;
>                                                    ^^^^^
>                 parent.no_addr |= be32_to_cpu(fh[7]);
> ...                                           ^^^^^
> 
> <--  snip  -->
> 
> 
> cu
> Adrian
> 
> -- 
> 
>        "Is there not promise of rain?" Ling Tan asked suddenly out
>         of the darkness. There had been need of rain for many days.
>        "Only a promise," Lao Er said.
>                                        Pearl S. Buck - Dragon Seed
---end quoted text---

  reply	other threads:[~2007-10-27 21:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-24 16:26 gfs2_fh_to_parent() array overflow Adrian Bunk
2007-10-27 21:00 ` Christoph Hellwig [this message]
2007-10-29  9:11   ` Steven Whitehouse
2008-02-13 21:31     ` Adrian Bunk
2008-02-14 10:44       ` Steven Whitehouse

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=20071027210039.GA2688@lst.de \
    --to=hch@lst.de \
    --cc=bunk@kernel.org \
    --cc=cluster-devel@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=swhiteho@redhat.com \
    /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