In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$> /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS > PID=$! #5>echo$PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including thegroup leader back intoa. In thisfinal migration,non-leader threadswould bedoing identity migrationwhile thegroup leaderisdoing an actual one.After #3,lets say the whole process was in cset A, and thatafter #4, theleadermovesto cset B.Then, during #6, the following happens: 1. cgroup_migrate_add_src() iscalled on B for the leader. 2. cgroup_migrate_add_src() is called on Afor the other threads. 3. cgroup_migrate_prepare_dst() is called.It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy.5. and then it notices A wants to migrate to A as it s an identity migration, it culls itby list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. Therest of migration takesplace with B on the src list but nothing on the dst list.This means that A isn t held while migration is inprogress. Ifall tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_nodefor both src and dstpreloadlists. We wanted to exclude the csetfrom the src list but ended upinadvertently excluding it fromthe dst list too.This patch fixesthe issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1:#1> mkdir -p /sys/fs/cgroup/misc/a/b#2> echo $$ >/sys/fs/cgroup/misc/a/cgroup.procs#3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS >PID=$!#5> echo$PID> /sys/fs/cgroup/misc/a/b/tasks#6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the groupleader back into a. Inthis finalmigration,non-leader threads wouldbe doingidentity migration whilethe groupleaderis doingan actual one.After #3, let ssaythe whole process was in cset A, and that after#4, theleader movesto cset B. Then,during #6, the following happens:1. cgroup_migrate_add_src() iscalledon B for the leader.2. cgroup_migrate_add_src() is called on A for theother threads.3. cgroup_migrate_prepare_dst() is called. It scansthe src list.4. It notices that B wants to migrate to A, so it tries to A to the dstlist but realizes that its ->mg_preload_node is already busy.5. and then itnotices A wants to migrate to A as it s an identitymigration, it culls it by list_del_init()ing its ->mg_preload_node andputting references accordingly.6. The rest of migration takesplace with B on the srclist but nothing onthe dst list.This means that A isn t held while migration is in progress. If all tasksleaveA before themigration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreloadlists. We wanted to excludethe cset from the src list but endedupinadvertently excluding it from the dst list too.This patchfixes the issue by separating outcset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1:#1> mkdir -p /sys/fs/cgroup/misc/a/b#2> echo $$ >/sys/fs/cgroup/misc/a/cgroup.procs#3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS >PID=$!#5> echo$PID> /sys/fs/cgroup/misc/a/b/tasks#6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the groupleader back into a. Inthis finalmigration,non-leader threads wouldbe doingidentity migration whilethe groupleaderis doingan actual one.After #3, let ssaythe whole process was in cset A, and that after#4, theleader movesto cset B. Then,during #6, the following happens:1. cgroup_migrate_add_src() iscalledon B for the leader.2. cgroup_migrate_add_src() is called on A for theother threads.3. cgroup_migrate_prepare_dst() is called. It scansthe src list.4. It notices that B wants to migrate to A, so it tries to A to the dstlist but realizes that its ->mg_preload_node is already busy.5. and then itnotices A wants to migrate to A as it s an identitymigration, it culls it by list_del_init()ing its ->mg_preload_node andputting references accordingly.6. The rest of migration takesplace with B on the srclist but nothing onthe dst list.This means that A isn t held while migration is in progress. If all tasksleaveA before themigration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreloadlists. We wanted to excludethe cset from the src list but endedupinadvertently excluding it from the dst list too.This patchfixes the issue by separating outcset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$> /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS > PID=$! #5>echo$PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including thegroup leader back intoa. In thisfinal migration,non-leader threadswould bedoing identity migrationwhile thegroup leaderisdoing an actual one.After #3,lets say the whole process was in cset A, and thatafter #4, theleadermovesto cset B.Then, during #6, the following happens: 1. cgroup_migrate_add_src() iscalled on B for the leader. 2. cgroup_migrate_add_src() is called on Afor the other threads. 3. cgroup_migrate_prepare_dst() is called.It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy.5. and then it notices A wants to migrate to A as it s an identity migration, it culls itby list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. Therest of migration takesplace with B on the src list but nothing on the dst list.This means that A isn t held while migration is inprogress. Ifall tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_nodefor both src and dstpreloadlists. We wanted to exclude the csetfrom the src list but ended upinadvertently excluding it fromthe dst list too.This patch fixesthe issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linuxkernel, thefollowing vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.
In the Linux kernel, the following vulnerability has been resolved:cgroup: Use separate src/dst nodes when preloading css_sets for migrationEach cset (css_set) is pinned by its tasks. When we re moving tasks aroundacross csets for a migration, we need to hold the source and destinationcsets to ensure that they don t go away while we re moving tasks about. Thisis done by linking cset->mg_preload_node on either themgctx->preloaded_src_csets or mgctx->preloaded_dst_csets list. Using thesame cset->mg_preload_node for both the src and dst lists was deemed okay asa cset can t be both the source and destination at the same time.Unfortunately, this overloading becomes problematic when multiple tasks areinvolved in a migration and some of them are identity noop migrations whileothers are actually moving across cgroups. For example, this can happen withthe following sequence on cgroup1: #1> mkdir -p /sys/fs/cgroup/misc/a/b #2> echo $$ > /sys/fs/cgroup/misc/a/cgroup.procs #3> RUN_A_COMMAND_WHICH_CREATES_MULTIPLE_THREADS & #4> PID=$! #5> echo $PID > /sys/fs/cgroup/misc/a/b/tasks #6> echo $PID > /sys/fs/cgroup/misc/a/cgroup.procsthe process including the group leader back into a. In this final migration,non-leader threads would be doing identity migration while the group leaderis doing an actual one.After #3, let s say the whole process was in cset A, and that after #4, theleader moves to cset B. Then, during #6, the following happens: 1. cgroup_migrate_add_src() is called on B for the leader. 2. cgroup_migrate_add_src() is called on A for the other threads. 3. cgroup_migrate_prepare_dst() is called. It scans the src list. 4. It notices that B wants to migrate to A, so it tries to A to the dst list but realizes that its ->mg_preload_node is already busy. 5. and then it notices A wants to migrate to A as it s an identity migration, it culls it by list_del_init() ing its ->mg_preload_node and putting references accordingly. 6. The rest of migration takes place with B on the src list but nothing on the dst list.This means that A isn t held while migration is in progress. If all tasksleave A before the migration finishes and the incoming task pins it, thecset will be destroyed leading to use-after-free.This is caused by overloading cset->mg_preload_node for both src and dstpreload lists. We wanted to exclude the cset from the src list but ended upinadvertently excluding it from the dst list too.This patch fixes the issue by separating out cset->mg_preload_node into->mg_src_preload_node and ->mg_dst_preload_node, so that the src and dstpreloadings don t interfere with each other.