diff options
| author | Eric Dumazet <edumazet@google.com> | 2023-06-22 18:15:03 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-08-16 18:13:01 +0200 |
| commit | 595500b268effbf201a0307ff23e7a51a5ebd1a0 (patch) | |
| tree | 332ddc1f8f7f7632a11f24244ee1eebe3bda2230 /firmware | |
| parent | ff9c28ef44d15914457c7dc13318c6c5a26934f0 (diff) | |
| download | linux-595500b268effbf201a0307ff23e7a51a5ebd1a0.tar.gz linux-595500b268effbf201a0307ff23e7a51a5ebd1a0.tar.bz2 linux-595500b268effbf201a0307ff23e7a51a5ebd1a0.zip | |
sch_netem: fix issues in netem_change() vs get_dist_table()
commit 11b73313c12403f617b47752db0ab3deef201af7 upstream.
In blamed commit, I missed that get_dist_table() was allocating
memory using GFP_KERNEL, and acquiring qdisc lock to perform
the swap of newly allocated table with current one.
In this patch, get_dist_table() is allocating memory and
copy user data before we acquire the qdisc lock.
Then we perform swap operations while being protected by the lock.
Note that after this patch netem_change() no longer can do partial changes.
If an error is returned, qdisc conf is left unchanged.
Fixes: 2174a08db80d ("sch_netem: acquire qdisc lock in netem_change()")
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Link: https://lore.kernel.org/r/20230622181503.2327695-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'firmware')
0 files changed, 0 insertions, 0 deletions
