diff options
Diffstat (limited to 'kernel/audit.c')
-rw-r--r-- | kernel/audit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index f5dc4b5db72e..5ce53337a9e4 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
@@ -670,7 +670,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
670 | &status_set, sizeof(status_set)); | 670 | &status_set, sizeof(status_set)); |
671 | break; | 671 | break; |
672 | case AUDIT_SET: | 672 | case AUDIT_SET: |
673 | if (nlh->nlmsg_len < sizeof(struct audit_status)) | 673 | if (nlmsg_len(nlh) < sizeof(struct audit_status)) |
674 | return -EINVAL; | 674 | return -EINVAL; |
675 | status_get = (struct audit_status *)data; | 675 | status_get = (struct audit_status *)data; |
676 | if (status_get->mask & AUDIT_STATUS_ENABLED) { | 676 | if (status_get->mask & AUDIT_STATUS_ENABLED) { |
@@ -832,7 +832,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) | |||
832 | 832 | ||
833 | memset(&s, 0, sizeof(s)); | 833 | memset(&s, 0, sizeof(s)); |
834 | /* guard against past and future API changes */ | 834 | /* guard against past and future API changes */ |
835 | memcpy(&s, data, min(sizeof(s), (size_t)nlh->nlmsg_len)); | 835 | memcpy(&s, data, min_t(size_t, sizeof(s), nlmsg_len(nlh))); |
836 | if ((s.enabled != 0 && s.enabled != 1) || | 836 | if ((s.enabled != 0 && s.enabled != 1) || |
837 | (s.log_passwd != 0 && s.log_passwd != 1)) | 837 | (s.log_passwd != 0 && s.log_passwd != 1)) |
838 | return -EINVAL; | 838 | return -EINVAL; |