With the introduction of clone3 in commit 7f192e3cd316 ("fork: add clone3") the effective bit width of clone_flags on all architectures was increased from 32-bit to 64-bit, with a new type of u64 for the flags. However, for most consumers of clone_flags the interface was not changed from the previous type of unsigned long. While this works fine as long as none of the new 64-bit flag bits (CLONE_CLEAR_SIGHAND and CLONE_INTO_CGROUP) are evaluated, this is still undesirable in terms of the principle of least surprise. Thus, this commit fixes all relevant interfaces of callees to sys_clone3/copy_process (excluding the architecture-specific copy_thread) to consistently pass clone_flags as u64, so that no truncation to 32-bit integers occurs on 32-bit architectures.
Showing the changes to kernel/utsname.c (1 of 38 files). Show all
Unified · Split
| @@ -86,7 +86,7 @@ fail: · 85 unmodified lines | ||
| 86 | 86 | * utsname of this process won't be seen by parent, and vice |
| 87 | 87 | * versa. |
| 88 | 88 | */ |
| 89 | −struct uts_namespace *copy_utsname(unsigned long flags, | |
| 89 | +struct uts_namespace *copy_utsname(u64 flags, | |
| 90 | 90 | struct user_namespace *user_ns, struct uts_namespace *old_ns) |
| 91 | 91 | { |
| 92 | 92 | struct uts_namespace *new_ns; |