From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org, linux-security-module@wirex.com
Cc: linux-fsdevel@vger.kernel.org
Subject: Re: [RFC] LSM changes for 2.5.38
Date: Thu, 26 Sep 2002 13:28:10 -0700 [thread overview]
Message-ID: <20020926202809.GD6908@kroah.com> (raw)
In-Reply-To: <20020926202713.GC6908@kroah.com>
Copied linux-fsdevel, as it touches the core fs code.
# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.613 -> 1.614
# fs/inode.c 1.69 -> 1.70
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/09/26 sds@tislabs.com 1.614
# [PATCH] LSM: inode.c init modification
#
# On Thu, 19 Sep 2002, Greg KH wrote:
#
# > Yes, and explaining the fine points of inode_init() and
# > inode_alloc_security() and why they are different, might be a bit tough.
# >
# > {sigh}, well if there's no other way (and I can't think of one right
# > now), but I really don't like it...
#
# Here's a patch that attempt to support the same functionality without
# inserting hooks into filesystem-specific code. This patch permits the
# security module to perform initialization of the inode security state
# based on the superblock information, enabling SELinux to initialize
# pipe, devpts, and shm inodes without relying on inode_precondition to
# catch them on first use.
#
# This is achieved simply by moving the initialization of inode->i_sb
# before the call to inode_alloc_security, enabling the
# inode_alloc_security hook function to perform the allocation and
# initialization for such inodes. No new hooks are required.
# --------------------------------------------
#
diff -Nru a/fs/inode.c b/fs/inode.c
--- a/fs/inode.c Thu Sep 26 13:23:52 2002
+++ b/fs/inode.c Thu Sep 26 13:23:52 2002
@@ -101,6 +101,7 @@
if (inode) {
struct address_space * const mapping = &inode->i_data;
+ inode->i_sb = sb;
inode->i_security = NULL;
if (security_ops->inode_alloc_security(inode)) {
if (inode->i_sb->s_op->destroy_inode)
@@ -109,7 +110,6 @@
kmem_cache_free(inode_cachep, (inode));
return NULL;
}
- inode->i_sb = sb;
inode->i_dev = sb->s_dev;
inode->i_blkbits = sb->s_blocksize_bits;
inode->i_flags = 0;
next parent reply other threads:[~2002-09-26 20:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20020926202552.GA6908@kroah.com>
[not found] ` <20020926202647.GB6908@kroah.com>
[not found] ` <20020926202713.GC6908@kroah.com>
2002-09-26 20:28 ` Greg KH [this message]
2002-09-26 20:28 ` [RFC] LSM changes for 2.5.38 Greg KH
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=20020926202809.GD6908@kroah.com \
--to=greg@kroah.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@wirex.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;
as well as URLs for NNTP newsgroup(s).