mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 13:14:02 +02:00
apparmor: fix error handling for copy_from_user in policy_update
copy_from_user does not return an error code and the check should be
setting the error code.
Fixes: 8b236f99edf8 ("apparmor: Initial support for compressed policies")
Signed-off-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
9f1e40193e
commit
1bc94d09e1
|
|
@ -552,10 +552,10 @@ static struct aa_loaddata *aa_get_data_from_compressed(const char __user *userbu
|
|||
*compressed_data = kvmalloc(buffer_size, GFP_KERNEL);
|
||||
if (!*compressed_data)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
error = copy_from_user(*compressed_data, userbuf, buffer_size);
|
||||
if (error)
|
||||
if (copy_from_user(*compressed_data, userbuf, buffer_size)) {
|
||||
error = -EFAULT;
|
||||
goto fail;
|
||||
|
||||
}
|
||||
error = zstd_get_frame_header(&header, *compressed_data, buffer_size);
|
||||
if (error || header.frameContentSize == ZSTD_CONTENTSIZE_UNKNOWN ||
|
||||
header.frameContentSize == ZSTD_CONTENTSIZE_ERROR) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user