Merge branch 'upstream' of git://git.infradead.org/users/pcmoore/audit
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 12 Feb 2015 04:07:47 +0000 (20:07 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 12 Feb 2015 04:07:47 +0000 (20:07 -0800)
Pull audit fix from Paul Moore:
 "Just one patch from the audit tree for v3.20, and a very minor one at
  that.

  The patch simply removes an old, unused field from the audit_krule
  structure, a private audit-only struct.  In audit related news, we did
  a proper overhaul of the audit pathname code and removed the nasty
  getname()/putname() hacks for audit, you should see those patches in
  Al's vfs tree if you haven't already.

  That's it for audit this time, let's hope for a quiet -rcX series"

* 'upstream' of git://git.infradead.org/users/pcmoore/audit:
  audit: remove vestiges of vers_ops

1  2 
include/linux/audit.h
kernel/auditfilter.c

diff --combined include/linux/audit.h
@@@ -46,7 -46,6 +46,6 @@@ struct audit_tree
  struct sk_buff;
  
  struct audit_krule {
-       int                     vers_ops;
        u32                     pflags;
        u32                     flags;
        u32                     listnr;
@@@ -94,7 -93,7 +93,7 @@@ extern unsigned compat_dir_class[]
  extern unsigned compat_chattr_class[];
  extern unsigned compat_signal_class[];
  
 -extern int __weak audit_classify_compat_syscall(int abi, unsigned syscall);
 +extern int audit_classify_compat_syscall(int abi, unsigned syscall);
  
  /* audit_names->type values */
  #define       AUDIT_TYPE_UNKNOWN      0       /* we don't know yet */
@@@ -134,7 -133,6 +133,7 @@@ extern void audit_putname(struct filena
  #define AUDIT_INODE_HIDDEN    2       /* audit record should be hidden */
  extern void __audit_inode(struct filename *name, const struct dentry *dentry,
                                unsigned int flags);
 +extern void __audit_file(const struct file *);
  extern void __audit_inode_child(const struct inode *parent,
                                const struct dentry *dentry,
                                const unsigned char type);
@@@ -188,11 -186,6 +187,11 @@@ static inline void audit_inode(struct f
                __audit_inode(name, dentry, flags);
        }
  }
 +static inline void audit_file(struct file *file)
 +{
 +      if (unlikely(!audit_dummy_context()))
 +              __audit_file(file);
 +}
  static inline void audit_inode_parent_hidden(struct filename *name,
                                                const struct dentry *dentry)
  {
@@@ -367,9 -360,6 +366,9 @@@ static inline void audit_inode(struct f
                                const struct dentry *dentry,
                                unsigned int parent)
  { }
 +static inline void audit_file(struct file *file)
 +{
 +}
  static inline void audit_inode_parent_hidden(struct filename *name,
                                const struct dentry *dentry)
  { }
diff --combined kernel/auditfilter.c
@@@ -121,7 -121,7 +121,7 @@@ static inline struct audit_entry *audit
        if (unlikely(!entry))
                return NULL;
  
 -      fields = kzalloc(sizeof(*fields) * field_count, GFP_KERNEL);
 +      fields = kcalloc(field_count, sizeof(*fields), GFP_KERNEL);
        if (unlikely(!fields)) {
                kfree(entry);
                return NULL;
@@@ -175,7 -175,7 +175,7 @@@ static __u32 *classes[AUDIT_SYSCALL_CLA
  
  int __init audit_register_class(int class, unsigned *list)
  {
 -      __u32 *p = kzalloc(AUDIT_BITMASK_SIZE * sizeof(__u32), GFP_KERNEL);
 +      __u32 *p = kcalloc(AUDIT_BITMASK_SIZE, sizeof(__u32), GFP_KERNEL);
        if (!p)
                return -ENOMEM;
        while (*list != ~0U) {
@@@ -425,7 -425,6 +425,6 @@@ static struct audit_entry *audit_data_t
                goto exit_nofree;
  
        bufp = data->buf;
-       entry->rule.vers_ops = 2;
        for (i = 0; i < data->field_count; i++) {
                struct audit_field *f = &entry->rule.fields[i];
  
@@@ -758,7 -757,6 +757,6 @@@ struct audit_entry *audit_dupe_rule(str
                return ERR_PTR(-ENOMEM);
  
        new = &entry->rule;
-       new->vers_ops = old->vers_ops;
        new->flags = old->flags;
        new->pflags = old->pflags;
        new->listnr = old->listnr;