public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: mitya@school.ioffe.ru (Dmitry Baryshkov)
To: linux-kernel@vger.kernel.org
Cc: James Morris <jmorris@redhat.com>, mason@suse.com, jeffm@suse.com
Subject: Re: 2.6.7-rc2: open() hangs on ReiserFS with SELinux enabled
Date: Fri, 4 Jun 2004 16:00:02 +0400	[thread overview]
Message-ID: <20040604120002.GB18344@school.ioffe.ru> (raw)
In-Reply-To: <1086291991.19025.55.camel@moss-spartans.epoch.ncsc.mil>

Hello,
On Thu, Jun 03, 2004 at 03:46:31PM -0400, Stephen Smalley wrote:
> On Thu, 2004-06-03 at 10:09, Stephen Smalley wrote:
> 
> Actually, that last part may be a red herring, since reiserfs_write_lock
> is simply a macro for lock_kernel.  The more immediate concern is
> avoiding the inode->i_op->getxattr call from SELinux on the xattr
> directory inode.  reiserfs xattr code would need to call a new security
> hook to mark the xattr root directory inode in some manner, so that
> subsequent security_d_instantiate calls on the per-object subdirectories
> could be identified by SELinux, and it could then just set the SID on
> the incore inode to a well-defined value and not call
> inode->i_op->getxattr for those inodes.

Here is a patch, based on discussion with Stephen Smalley, that fixes
the problem for me. As private files don't have xattrs,
reiserfs_getxattr should return early for them, thus not trying to lock anything.
-- 
With best wishes
Dmitry Baryshkov

diff -pur linux-2.6.7-rc2-orig/fs/reiserfs/xattr.c linux-2.6.7-rc2/fs/reiserfs/xattr.c
--- linux-2.6.7-rc2-orig/fs/reiserfs/xattr.c	2004-06-04 00:22:25.000000000 +0400
+++ linux-2.6.7-rc2/fs/reiserfs/xattr.c	2004-06-04 10:13:00.000000000 +0400
@@ -944,6 +944,16 @@ reiserfs_getxattr (struct dentry *dentry
 {
     struct reiserfs_xattr_handler *xah = find_xattr_handler_prefix (name);
     int err;
+    struct dentry *dpar;
+
+    dpar = dget_parent(dentry);
+    if (is_reiserfs_priv_object (dentry->d_inode) ||
+        (dpar && is_reiserfs_priv_object (dpar->d_inode)))
+    {
+	    dput(dpar);
+	    return -ENODATA;
+    }
+    dput(dpar);
 
     if (!xah || !reiserfs_xattrs(dentry->d_sb) ||
         get_inode_sd_version (dentry->d_inode) == STAT_DATA_V1)


  reply	other threads:[~2004-06-04 12:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-02 17:48 2.6.7-rc2: open() hangs on ReiserFS with SELinux enabled Dmitry Baryshkov
2004-06-02 18:40 ` Stephen Smalley
2004-06-03  8:36   ` Dmitry Baryshkov
2004-06-03 14:09     ` Stephen Smalley
2004-06-03 19:46       ` Stephen Smalley
2004-06-04 12:00         ` Dmitry Baryshkov [this message]
2004-06-02 18:48 ` Valdis.Kletnieks

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=20040604120002.GB18344@school.ioffe.ru \
    --to=mitya@school.ioffe.ru \
    --cc=jeffm@suse.com \
    --cc=jmorris@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mason@suse.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