+ git-audit-fixes.patch added to -mm tree

Dustin Kirkland dustin.kirkland at gmail.com
Fri Mar 3 13:42:32 UTC 2006


On 3/3/06, akpm at osdl.org <akpm at osdl.org> wrote:
>
> The patch titled
>
>      git-audit-fixes
>
> has been added to the -mm tree.  Its filename is
>
>      git-audit-fixes.patch

<snip>

> diff -puN kernel/auditfilter.c~git-audit-fixes kernel/auditfilter.c
> --- devel/kernel/auditfilter.c~git-audit-fixes  2006-03-03 01:09:08.000000000 -0800
> +++ devel-akpm/kernel/auditfilter.c     2006-03-03 01:09:08.000000000 -0800
> @@ -52,33 +52,6 @@ static inline void audit_free_rule_rcu(s
>         audit_free_rule(e);
>  }
>
> -/* Unpack a filter field's string representation from user-space
> - * buffer. */
> -static char *audit_unpack_string(void **bufp, size_t *remain, size_t len)
> -{
> -       char *str;
> -
> -       if (!*bufp || (len == 0) || (len > *remain))
> -               return ERR_PTR(-EINVAL);
> -
> -       /* Of the currently implemented string fields, PATH_MAX
> -        * defines the longest valid length.
> -        */
> -       if (len > PATH_MAX)
> -               return ERR_PTR(-ENAMETOOLONG);
> -
> -       str = kmalloc(len + 1, GFP_KERNEL);
> -       if (unlikely(!str))
> -               return ERR_PTR(-ENOMEM);
> -
> -       memcpy(str, *bufp, len);
> -       str[len] = 0;
> -       *bufp += len;
> -       *remain -= len;
> -
> -       return str;
> -}
> -
>  /* Common user-space to kernel rule translation. */
>  static inline struct audit_entry *audit_to_entry_common(struct audit_rule *rule)
>  {
> @@ -551,10 +524,10 @@ int audit_comparator(const u32 left, con
>         case AUDIT_GREATER_THAN_OR_EQUAL:
>                 return (left >= right);
>         }
> +       BUG();
> +       return 0;
>  }
>

Just a sanity check here....  But was this patch supposed to delete
the function audit_unpack_string()?  The BUG() return 0 (unreachable
code in any sane situation) was mine and I ack that, but I don't
recall nuking audit_unpack_string()....


:-Dustin




More information about the Linux-audit mailing list