mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-26 20:44:32 +08:00
apparmor: fix missing error check for rhashtable_insert_fast
[ Upstream commit000518bc5a
] rhashtable_insert_fast() could return err value when memory allocation is failed. but unpack_profile() do not check values and this always returns success value. This patch just adds error check code. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes:e025be0f26
("apparmor: support querying extended trusted helper extra data") Signed-off-by: Danila Chernetsov <listdansp@mail.ru> Signed-off-by: John Johansen <john.johansen@canonical.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
196f6c7190
commit
0fa0cd1f98
@ -909,8 +909,13 @@ static struct aa_profile *unpack_profile(struct aa_ext *e, char **ns_name)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
rhashtable_insert_fast(profile->data, &data->head,
|
||||
profile->data->p);
|
||||
if (rhashtable_insert_fast(profile->data, &data->head,
|
||||
profile->data->p)) {
|
||||
kfree_sensitive(data->key);
|
||||
kfree_sensitive(data);
|
||||
info = "failed to insert data to table";
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
||||
if (!unpack_nameX(e, AA_STRUCTEND, NULL)) {
|
||||
|
Loading…
Reference in New Issue
Block a user