[patch 1/3] git-audit-fixes

akpm at osdl.org akpm at osdl.org
Wed Mar 8 07:51:37 UTC 2006


From: Andrew Morton <akpm at osdl.org>

kernel/auditfilter.c: In function `audit_comparator':
kernel/auditfilter.c:554: warning: control reaches end of non-void function
kernel/auditfilter.c: At top level:
kernel/auditfilter.c:58: warning: `audit_unpack_string' defined but not used

Cc: <linux-audit at redhat.com>
Cc: Al Viro <viro at ftp.linux.org.uk>
Signed-off-by: Andrew Morton <akpm at osdl.org>
---

 kernel/auditfilter.c |   31 ++-----------------------------
 1 files changed, 2 insertions(+), 29 deletions(-)

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;
 }
 
-
-
 static int audit_filter_user_rules(struct netlink_skb_parms *cb,
 				   struct audit_krule *rule,
 				   enum audit_state *state)
_




More information about the Linux-audit mailing list