diff options
author | Eric Paris <eparis@redhat.com> | 2014-01-13 16:49:28 -0500 |
---|---|---|
committer | Eric Paris <eparis@redhat.com> | 2014-01-13 22:33:39 -0500 |
commit | 3f0c5fad89c2c287baee0f314177b82aeafa7363 (patch) | |
tree | f8aa71217198b39a0abd553e91c889acc6e6b0bb /kernel | |
parent | 70249a9cfdb405f654708699c679c6774efb31d8 (diff) |
audit: remove needless switch in AUDIT_SET
If userspace specified that it was setting values via the mask we do not
need a second check to see if they also set the version field high
enough to understand those values. (clearly if they set the mask they
knew those values).
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/audit.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index b6717231d3d4..ab2e3d8288f2 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
@@ -834,22 +834,15 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
834 | if (err < 0) | 834 | if (err < 0) |
835 | return err; | 835 | return err; |
836 | } | 836 | } |
837 | switch (s.version) { | 837 | if (s.mask & AUDIT_STATUS_BACKLOG_WAIT_TIME) { |
838 | /* add future vers # cases immediately below and allow | 838 | if (sizeof(s) > (size_t)nlh->nlmsg_len) |
839 | * to fall through */ | 839 | return -EINVAL; |
840 | case 2: | 840 | if (s.backlog_wait_time < 0 || |
841 | if (s.mask & AUDIT_STATUS_BACKLOG_WAIT_TIME) { | 841 | s.backlog_wait_time > 10*AUDIT_BACKLOG_WAIT_TIME) |
842 | if (sizeof(s) > (size_t)nlh->nlmsg_len) | 842 | return -EINVAL; |
843 | return -EINVAL; | 843 | err = audit_set_backlog_wait_time(s.backlog_wait_time); |
844 | if (s.backlog_wait_time < 0 || | 844 | if (err < 0) |
845 | s.backlog_wait_time > 10*AUDIT_BACKLOG_WAIT_TIME) | 845 | return err; |
846 | return -EINVAL; | ||
847 | err = audit_set_backlog_wait_time(s.backlog_wait_time); | ||
848 | if (err < 0) | ||
849 | return err; | ||
850 | } | ||
851 | default: | ||
852 | break; | ||
853 | } | 846 | } |
854 | break; | 847 | break; |
855 | } | 848 | } |