Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

apparmor: drop in_atomic flag in common_mmap, and common_file_perm

with the previous changes to mmap the in_atomic flag is now always
false, so drop it.

Suggested-by: Tyler Hicks <code@tyhicks.com>
Reviewed-by: Georgia Garcia <georgia.garcia@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>

+9 -12
+9 -12
security/apparmor/lsm.c
··· 520 520 aa_put_label(rcu_access_pointer(ctx->label)); 521 521 } 522 522 523 - static int common_file_perm(const char *op, struct file *file, u32 mask, 524 - bool in_atomic) 523 + static int common_file_perm(const char *op, struct file *file, u32 mask) 525 524 { 526 525 struct aa_label *label; 527 526 int error = 0; ··· 531 532 return -EACCES; 532 533 533 534 label = __begin_current_label_crit_section(&needput); 534 - error = aa_file_perm(op, current_cred(), label, file, mask, in_atomic); 535 + error = aa_file_perm(op, current_cred(), label, file, mask, false); 535 536 __end_current_label_crit_section(label, needput); 536 537 537 538 return error; ··· 539 540 540 541 static int apparmor_file_receive(struct file *file) 541 542 { 542 - return common_file_perm(OP_FRECEIVE, file, aa_map_file_to_perms(file), 543 - false); 543 + return common_file_perm(OP_FRECEIVE, file, aa_map_file_to_perms(file)); 544 544 } 545 545 546 546 static int apparmor_file_permission(struct file *file, int mask) 547 547 { 548 - return common_file_perm(OP_FPERM, file, mask, false); 548 + return common_file_perm(OP_FPERM, file, mask); 549 549 } 550 550 551 551 static int apparmor_file_lock(struct file *file, unsigned int cmd) ··· 554 556 if (cmd == F_WRLCK) 555 557 mask |= MAY_WRITE; 556 558 557 - return common_file_perm(OP_FLOCK, file, mask, false); 559 + return common_file_perm(OP_FLOCK, file, mask); 558 560 } 559 561 560 562 static int common_mmap(const char *op, struct file *file, unsigned long prot, 561 - unsigned long flags, bool in_atomic) 563 + unsigned long flags) 562 564 { 563 565 int mask = 0; 564 566 ··· 576 578 if (prot & PROT_EXEC) 577 579 mask |= AA_EXEC_MMAP; 578 580 579 - return common_file_perm(op, file, mask, in_atomic); 581 + return common_file_perm(op, file, mask); 580 582 } 581 583 582 584 static int apparmor_mmap_file(struct file *file, unsigned long reqprot, 583 585 unsigned long prot, unsigned long flags) 584 586 { 585 - return common_mmap(OP_FMMAP, file, prot, flags, false); 587 + return common_mmap(OP_FMMAP, file, prot, flags); 586 588 } 587 589 588 590 static int apparmor_file_mprotect(struct vm_area_struct *vma, 589 591 unsigned long reqprot, unsigned long prot) 590 592 { 591 593 return common_mmap(OP_FMPROT, vma->vm_file, prot, 592 - !(vma->vm_flags & VM_SHARED) ? MAP_PRIVATE : 0, 593 - false); 594 + !(vma->vm_flags & VM_SHARED) ? MAP_PRIVATE : 0); 594 595 } 595 596 596 597 #ifdef CONFIG_IO_URING