]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
audit: return on memory error to avoid null pointer dereference
authorRichard Guy Briggs <rgb@redhat.com>
Wed, 21 Feb 2018 09:30:07 +0000 (04:30 -0500)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 27 Aug 2018 14:40:05 +0000 (16:40 +0200)
commite4eabf7cc9e2e228f4acda1161fd30d4c3bc9722
tree0650ef2f3765d41f6ca67e1284027522f1cc58fc
parent409ac458b6c14f7db70306edc83c5986850118b3
audit: return on memory error to avoid null pointer dereference

BugLink: http://bugs.launchpad.net/bugs/1786352
[ Upstream commit 23138ead270045f1b3e912e667967b6094244999 ]

If there is a memory allocation error when trying to change an audit
kernel feature value, the ignored allocation error will trigger a NULL
pointer dereference oops on subsequent use of that pointer.  Return
instead.

Passes audit-testsuite.
See: https://github.com/linux-audit/audit-kernel/issues/76

Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
[PM: not necessary (other funcs check for NULL), but a good practice]
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
kernel/audit.c