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 security/security.c (1 of 38 files). Show all

Unified · Split

security/security.c+1−1
@@ -3185,7 +3185,7 @@ int security_file_truncate(struct file *file) · 3184 unmodified lines
31853185 *
31863186 * Return: Returns a zero on success, negative values on failure.
31873187 */
3188−int security_task_alloc(struct task_struct *task, unsigned long clone_flags)
3188+int security_task_alloc(struct task_struct *task, u64 clone_flags)
31893189 {
31903190 int rc = lsm_task_alloc(task);
31913191

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