login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
November
»
29
Re: [PATCH] fs: call security_d_instantiate in d_obtain_alias V2
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Josef Bacik
Subject:
Re: [PATCH] fs: call security_d_instantiate in d_obtain_alias V2
Date: Monday, November 29, 2010 - 1:41 pm
On Thu, Nov 18, 2010 at 08:52:55PM -0500, Josef Bacik wrote:
quoted text
> While trying to track down some NFS problems with BTRFS, I kept noticing I was > getting -EACCESS for no apparent reason. Eric Paris and printk() helped me > figure out that it was SELinux that was giving me grief, with the following > denial > > type=AVC msg=audit(1290013638.413:95): avc: denied { 0x800000 } for pid=1772 > comm="nfsd" name="" dev=sda1 ino=256 scontext=system_u:system_r:kernel_t:s0 > tcontext=system_u:object_r:unlabeled_t:s0 tclass=file > > Turns out this is because in d_obtain_alias if we can't find an alias we create > one and do all the normal instantiation stuff, but we don't do the > security_d_instantiate. > > Usually we are protected from getting a hashed dentry that hasn't yet run > security_d_instantiate() by the parent's i_mutex, but obviously this isn't an > option there, so in order to deal with the case that a second thread comes in > and finds our new dentry before we get to run security_d_instantiate(), we go > ahead and call it if we find a dentry already. Eric assures me that this is ok > as the code checks to see if the dentry has been initialized already so calling > security_d_instantiate() against the same dentry multiple times is ok. With > this patch I'm no longer getting errant -EACCESS values. > > Signed-off-by: Josef Bacik <josef@redhat.com> > --- > V1->V2: > -added second security_d_instantiate() call > > fs/dcache.c | 3 +++ > 1 files changed, 3 insertions(+), 0 deletions(-) > > diff --git a/fs/dcache.c b/fs/dcache.c > index 23702a9..119d489 100644 > --- a/fs/dcache.c > +++ b/fs/dcache.c > @@ -1201,9 +1201,12 @@ struct dentry *d_obtain_alias(struct inode *inode) > spin_unlock(&tmp->d_lock); > > spin_unlock(&dcache_lock); > + security_d_instantiate(tmp, inode); > return tmp; > > out_iput: > + if (res && !IS_ERR(res)) > + security_d_instantiate(res, inode); > iput(inode); > return res; > } > -- > 1.6.6.1 >
Hey Al, I forgot to cc you directly, is this ok with you, and if it is would you mind picking it up? Thanks, Josef --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] fs: call security_d_instantiate in d_obtain_alias V2
, Josef Bacik
, (Thu Nov 18, 6:52 pm)
Re: [PATCH] fs: call security_d_instantiate in d_obtain_al ...
, J. Bruce Fields
, (Fri Nov 19, 3:35 pm)
Re: [PATCH] fs: call security_d_instantiate in d_obtain_al ...
, J. Bruce Fields
, (Sat Nov 20, 7:59 pm)
Re: [PATCH] fs: call security_d_instantiate in d_obtain_al ...
, Josef Bacik
, (Sun Nov 21, 8:44 am)
Re: [PATCH] fs: call security_d_instantiate in d_obtain_al ...
, Josef Bacik
, (Mon Nov 29, 1:41 pm)
Re: [PATCH] fs: call security_d_instantiate in d_obtain_al ...
, Eric Sandeen
, (Fri Dec 17, 1:45 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Paul Turner
[tg_shares_up rewrite v4 11/11] sched: update tg->shares after cpu.shares write
Mr. James W. Laferriere
Re: Linux 2.6.25-rc1 , syntax error near unexpected token `;'
Chuck Ebbert
Re: PCI: Unable to reserve mem region problem
Mingming Cao
Re: [RFC 1/4] Large Blocksize support for Ext2/3/4
Linus Torvalds
Linux 2.6.34-rc4
git
:
Ralf Wildenhues
[PATCH] Fix typos in the documentation
Adeodato
Bazaar's patience diff as GIT_EXTERNAL_DIFF
Johannes Schindelin
Re: [PATCH 2/4] Add functions get_relative_cwd() and is_inside_dir()
Len Brown
Re: fatal: unable to create '.git/index': File exists
Denis Bueno
Git clone error
git-commits-head
:
Linux Kernel Mailing List
ASoC: fix registration of the SoC card in the Freescale MPC8610 drivers
Linux Kernel Mailing List
drivers/acpi: use kasprintf
Linux Kernel Mailing List
nfsd41: sanity check client drc maxreqs
Linux Kernel Mailing List
bnx2x: Moving includes
Linux Kernel Mailing List
V4L/DVB: gspca - sonixj: Adjust minor values of sensor ov7630. - set the color ga...
openbsd-misc
:
Sevan / Venture37
Re: This is what Linus Torvalds calls openBSD crowd
Netmaffia.hu
Tini Lányok AKCIÓBAN OTTHON
Sam Fourman Jr.
Re: Help with Altell PC6700
Siju George
This is what Linus Torvalds calls openBSD crowd
Darrin Chandler
Re: OT: Python (was Re: vi in /bin)
linux-netdev
:
Kurt Van Dijck
Re: [PATCH net-next-2.6 1/2] can: add driver for Softing card
Eric Dumazet
Re: [PATCH net-next-2.6] net: Introduce skb_orphan_try()
Jamie Lokier
Re: POHMELFS high performance network filesystem. Transactions, failover, performa...
David Miller
Re: [PATCH v2] net: typos in comments in include/linux/igmp.h
Ursula Braun
[patch 0/1] remove header_ops bug in qeth driver
Colocation donated by:
Syndicate