Commit 29a747a1 authored by Wang Weiyang's avatar Wang Weiyang Committed by Yongqiang Liu
Browse files

device_cgroup: Roll back to original exceptions after copy failure

stable inclusion
from stable-v4.19.270
commit 697e55b94162721cfdfa7acd1be09427d2c47c80
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6DPF8


CVE: NA

--------------------------------

commit e68bfbd3 upstream.

When add the 'a *:* rwm' entry to devcgroup A's whitelist, at first A's
exceptions will be cleaned and A's behavior is changed to
DEVCG_DEFAULT_ALLOW. Then parent's exceptions will be copyed to A's
whitelist. If copy failure occurs, just return leaving A to grant
permissions to all devices. And A may grant more permissions than
parent.

Backup A's whitelist and recover original exceptions after copy
failure.

Cc: stable@vger.kernel.org
Fixes: 4cef7299 ("device_cgroup: add proper checking when changing default behavior")
Signed-off-by: default avatarWang Weiyang <wangweiyang2@huawei.com>
Reviewed-by: default avatarAristeu Rozanski <aris@redhat.com>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
parent 5112aa6b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment