linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: James Morris <jmorris@namei.org>, Al Viro <viro@ZenIV.linux.org.uk>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	NeilBrown <neilb@suse.de>,
	Casey Schaufler <casey@schaufler-ca.com>
Subject: linux-next: manual merge of the security tree with the vfs tree
Date: Wed, 13 May 2015 14:39:52 +1000	[thread overview]
Message-ID: <20150513143952.79a3b57e@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 3107 bytes --]

Hi James,

Today's linux-next merge of the security tree got a conflict in
include/linux/security.h and security/security.c between commits
37882db0546c ("SECURITY: remove nameidata arg from inode_follow_link")
and bda0be7ad994 ("security: make inode_follow_link RCU-walk aware")
from the vfs tree and commits 3c4ed7bdf599 ("LSM: Split security.h")
and 346033a28fb1 ("LSM: Remove a comment from security.h") from the
security tree.

I fixed it up (see below, plus I added the following merge fix patch)
and can carry the fix as necessary (no action is required).

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed, 13 May 2015 14:29:17 +1000
Subject: [PATCH] LSM: merge fix for follow_link API changes

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 include/linux/lsm_hooks.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h
index f014f2596e22..9429f054c323 100644
--- a/include/linux/lsm_hooks.h
+++ b/include/linux/lsm_hooks.h
@@ -315,7 +315,8 @@
  * @inode_follow_link:
  *	Check permission to follow a symbolic link when looking up a pathname.
  *	@dentry contains the dentry structure for the link.
- *	@nd contains the nameidata structure for the parent directory.
+ *	@inode contains the inode, which itself is not stable in RCU-walk
+ *	@rcu indicates whether we are in RCU-walk mode.
  *	Return 0 if permission is granted.
  * @inode_permission:
  *	Check permission before accessing an inode.  This hook is called by the
@@ -1397,7 +1398,8 @@ union security_list_options {
 				struct inode *new_dir,
 				struct dentry *new_dentry);
 	int (*inode_readlink)(struct dentry *dentry);
-	int (*inode_follow_link)(struct dentry *dentry, struct nameidata *nd);
+	int (*inode_follow_link)(struct dentry *dentry, struct inode *inode,
+				 bool rcu);
 	int (*inode_permission)(struct inode *inode, int mask);
 	int (*inode_setattr)(struct dentry *dentry, struct iattr *attr);
 	int (*inode_getattr)(const struct path *path);
-- 
2.1.4

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc security/security.c
index 04c8feca081a,bd4c5f6a5b78..000000000000
--- a/security/security.c
+++ b/security/security.c
@@@ -578,15 -586,14 +586,15 @@@ int security_inode_readlink(struct dent
  {
  	if (unlikely(IS_PRIVATE(d_backing_inode(dentry))))
  		return 0;
- 	return security_ops->inode_readlink(dentry);
+ 	return call_int_hook(inode_readlink, 0, dentry);
  }
  
 -int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd)
 +int security_inode_follow_link(struct dentry *dentry, struct inode *inode,
 +			       bool rcu)
  {
 -	if (unlikely(IS_PRIVATE(d_backing_inode(dentry))))
 +	if (unlikely(IS_PRIVATE(inode)))
  		return 0;
- 	return security_ops->inode_follow_link(dentry, inode, rcu);
 -	return call_int_hook(inode_follow_link, 0, dentry, nd);
++	return call_int_hook(inode_follow_link, 0, dentry, inode, rcu);
  }
  
  int security_inode_permission(struct inode *inode, int mask)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

             reply	other threads:[~2015-05-13  4:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-13  4:39 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-08-12  4:44 linux-next: manual merge of the security tree with the vfs tree Stephen Rothwell
2015-12-31  4:24 Stephen Rothwell
2015-12-31  4:30 ` Al Viro
2015-12-31 10:45   ` Petko Manolov
2016-01-01  4:34     ` Al Viro
2016-01-01 17:29       ` Petko Manolov
2016-01-04  1:37 ` Mimi Zohar
2016-01-04  1:55   ` Stephen Rothwell
2015-05-13  4:26 Stephen Rothwell
2014-12-10  2:47 Stephen Rothwell

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=20150513143952.79a3b57e@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=casey@schaufler-ca.com \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=viro@ZenIV.linux.org.uk \
    /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).