[Devel] [PATCH RH8 v2 0/2] fix ve->ve_ns dereferences

Andrey Zhadchenko andrey.zhadchenko at virtuozzo.com
Fri Jul 9 02:19:50 MSK 2021


ve->ve_ns is not guaranteed to be non-NULL. For example
we can create process with such ve with following script:

mkdir /sys/fs/cgroup/ve/1
echo 1 > /sys/fs/cgroup/ve/1/ve.veid
echo $$ > /sys/fs/cgroup/ve/1/tasks

These patches adds checks to ensure ve->ve_ns is not NULL

v2:
 - remove a lot of excessive rcu_dereference in connector
 - move newly sync_filesystems code under namespace_sem to ensure mnt_ns
won't dissapear unexpectedly

Andrey Zhadchenko (2):
  fs/sync: fix nullptr dereference ve->ve_ns->mnt_ns
  drivers/connector: fix nullptr dereference ve->ve_ns->pid_ns

 drivers/connector/cn_proc.c | 10 ++++++++--
 fs/sync.c                   | 28 ++++++++++++++++++++++++++--
 2 files changed, 34 insertions(+), 4 deletions(-)

-- 
1.8.3.1



More information about the Devel mailing list