From: Alexey Dobriyan <adobriyan@gmail.com>
To: Stephen Smalley <sds@tycho.nsa.gov>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: [PATCH v2] fs.h: ifdef security fields
Date: Wed, 2 Aug 2006 19:14:55 +0400 [thread overview]
Message-ID: <20060802151455.GA6827@martell.zuzino.mipt.ru> (raw)
In-Reply-To: <1154458395.3582.150.camel@moss-spartans.epoch.ncsc.mil>
On Tue, Aug 01, 2006 at 02:53:15PM -0400, Stephen Smalley wrote:
> > --- a/fs/inode.c
> > +++ b/fs/inode.c
> > @@ -133,7 +133,9 @@ #endif
> > inode->i_bdev = NULL;
> > inode->i_cdev = NULL;
> > inode->i_rdev = 0;
> > +#ifdef CONFIG_SECURITY
> > inode->i_security = NULL;
> > +#endif
>
> Possibly this should just be moved inside the security_inode_alloc
> static inlines?
Agree, it's better.
> > --- a/include/linux/fs.h
> > +++ b/include/linux/fs.h
> > @@ -552,7 +552,9 @@ struct inode {
> > unsigned int i_flags;
> >
> > atomic_t i_writecount;
> > +#ifdef CONFIG_SECURITY
> > void *i_security;
> > +#endif
> > union {
> > void *generic_ip;
> > } u;
> > @@ -688,8 +690,9 @@ struct file {
> > struct file_ra_state f_ra;
> >
> > unsigned long f_version;
> > +#ifdef CONFIG_SECURITY_SELINUX
>
> This should just be CONFIG_SECURITY.
After another user appear.
> > void *f_security;
> > -
> > +#endif
> > /* needed for tty driver, and maybe others */
> > void *private_data;
> >
> > @@ -877,7 +880,9 @@ struct super_block {
> > int s_syncing;
> > int s_need_sync_fs;
> > atomic_t s_active;
> > +#ifdef CONFIG_SECURITY_SELINUX
>
> Likewise.
After second user appear in tree.
> > void *s_security;
> > +#endif
[PATCH v2] fs.h: ifdef security fields
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---
fs/inode.c | 1 -
include/linux/fs.h | 7 ++++++-
include/linux/security.h | 1 +
3 files changed, 7 insertions(+), 2 deletions(-)
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -133,7 +133,6 @@ #endif
inode->i_bdev = NULL;
inode->i_cdev = NULL;
inode->i_rdev = 0;
- inode->i_security = NULL;
inode->dirtied_when = 0;
if (security_inode_alloc(inode)) {
if (inode->i_sb->s_op->destroy_inode)
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -552,7 +552,9 @@ #endif
unsigned int i_flags;
atomic_t i_writecount;
+#ifdef CONFIG_SECURITY
void *i_security;
+#endif
union {
void *generic_ip;
} u;
@@ -688,8 +690,9 @@ struct file {
struct file_ra_state f_ra;
unsigned long f_version;
+#ifdef CONFIG_SECURITY_SELINUX
void *f_security;
-
+#endif
/* needed for tty driver, and maybe others */
void *private_data;
@@ -877,7 +880,9 @@ struct super_block {
int s_syncing;
int s_need_sync_fs;
atomic_t s_active;
+#ifdef CONFIG_SECURITY_SELINUX
void *s_security;
+#endif
struct xattr_handler **s_xattr;
struct list_head s_inodes; /* all inodes */
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1537,6 +1537,7 @@ static inline void security_sb_post_pivo
static inline int security_inode_alloc (struct inode *inode)
{
+ inode->i_security = NULL;
return security_ops->inode_alloc_security (inode);
}
next prev parent reply other threads:[~2006-08-02 15:15 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-01 15:53 [PATCH] fs.h: ifdef security fields Alexey Dobriyan
2006-08-01 18:53 ` Stephen Smalley
2006-08-02 15:14 ` Alexey Dobriyan [this message]
2006-08-02 16:53 ` [PATCH v2] " Stephen Smalley
2006-08-02 19:10 ` Alexey Dobriyan
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=20060802151455.GA6827@martell.zuzino.mipt.ru \
--to=adobriyan@gmail.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sds@tycho.nsa.gov \
/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).