diff options
author | Oleg Nesterov <[email protected]> | 2023-08-17 18:37:08 +0200 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2023-08-21 13:46:25 -0700 |
commit | 5ffd2c37cb7a53d52099e5ed1fd7ccbc9e358791 (patch) | |
tree | fef673a9670941e2854fbf2997b0422ebc5a9f34 /lib/test_fortify/write_overflow-strncpy-src.c | |
parent | cdaac8e7e5a059f9b5e816cda257f08d0abffacd (diff) |
kill do_each_thread()
Eric has pointed out that we still have 3 users of do_each_thread().
Change them to use for_each_process_thread() and kill this helper.
There is a subtle change, after do_each_thread/while_each_thread g == t ==
&init_task, while after for_each_process_thread() they both point to
nowhere, but this doesn't matter.
> Why is for_each_process_thread() better than do_each_thread()?
Say, for_each_process_thread() is rcu safe, do_each_thread() is not.
And certainly
for_each_process_thread(p, t) {
do_something(p, t);
}
looks better than
do_each_thread(p, t) {
do_something(p, t);
} while_each_thread(p, t);
And again, there are only 3 users of this awkward helper left. It should
have been killed years ago and in fact I thought it had already been
killed. It uses while_each_thread() which needs some changes.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Oleg Nesterov <[email protected]>
Reviewed-by: Kees Cook <[email protected]>
Cc: "Christian Brauner (Microsoft)" <[email protected]>
Cc: Eric W. Biederman <[email protected]>
Cc: Jiri Slaby <[email protected]> # tty/serial
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions