mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 12:53:14 +01: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 <[email protected]>
This commit is contained in:
1 parent
9f1e40193e
commit
1bc94d09e1
1 file changed
+3
-3
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user