History

copy_process: pass clone_flags as u64 across calltree

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.

Simon Schuster committed 1 year ago

Commit edd3cb01 parent 04ff48238 files · +59 −59Browse files

Showing the changes to kernel/utsname.c (1 of 38 files). Show all

Unified · Split

kernel/utsname.c+1−1
@@ -86,7 +86,7 @@ fail: · 85 unmodified lines
86 * utsname of this process won't be seen by parent, and vice86 * utsname of this process won't be seen by parent, and vice
87 * versa.87 * versa.
88 */88 */
89struct uts_namespace *copy_utsname(unsigned long flags,89struct uts_namespace *copy_utsname(u64 flags,
90 struct user_namespace *user_ns, struct uts_namespace *old_ns)90 struct user_namespace *user_ns, struct uts_namespace *old_ns)
91{91{
92 struct uts_namespace *new_ns;92 struct uts_namespace *new_ns;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t