Skip to content

Commit 399ab86

Browse files
peaktocreekakpm00
authored andcommitted
/proc/pid/smaps: add mseal info for vma
Add sl in /proc/pid/smaps to indicate vma is sealed Link: https://lkml.kernel.org/r/[email protected] Fixes: 8be7258 ("mseal: add mseal syscall") Signed-off-by: Jeff Xu <[email protected]> Acked-by: David Hildenbrand <[email protected]> Cc: Adhemerval Zanella <[email protected]> Cc: Jann Horn <[email protected]> Cc: Jorge Lucangeli Obes <[email protected]> Cc: Kees Cook <[email protected]> Cc: Randy Dunlap <[email protected]> Cc: Stephen Röttger <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 8c61291 commit 399ab86

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

Documentation/filesystems/proc.rst

+1
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ encoded manner. The codes are the following:
571571
um userfaultfd missing tracking
572572
uw userfaultfd wr-protect tracking
573573
ss shadow stack page
574+
sl sealed
574575
== =======================================
575576

576577
Note that there is no guarantee that every flag and associated mnemonic will

fs/proc/task_mmu.c

+3
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,9 @@ static void show_smap_vma_flags(struct seq_file *m, struct vm_area_struct *vma)
706706
#endif /* CONFIG_HAVE_ARCH_USERFAULTFD_MINOR */
707707
#ifdef CONFIG_X86_USER_SHADOW_STACK
708708
[ilog2(VM_SHADOW_STACK)] = "ss",
709+
#endif
710+
#ifdef CONFIG_64BIT
711+
[ilog2(VM_SEALED)] = "sl",
709712
#endif
710713
};
711714
size_t i;

include/linux/mm.h

+5
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,11 @@ extern unsigned int kobjsize(const void *objp);
406406
#define VM_ALLOW_ANY_UNCACHED VM_NONE
407407
#endif
408408

409+
#ifdef CONFIG_64BIT
410+
/* VM is sealed, in vm_flags */
411+
#define VM_SEALED _BITUL(63)
412+
#endif
413+
409414
/* Bits set in the VMA until the stack is in its final location */
410415
#define VM_STACK_INCOMPLETE_SETUP (VM_RAND_READ | VM_SEQ_READ | VM_STACK_EARLY)
411416

mm/internal.h

-5
Original file line numberDiff line numberDiff line change
@@ -1434,11 +1434,6 @@ void __meminit __init_single_page(struct page *page, unsigned long pfn,
14341434
unsigned long shrink_slab(gfp_t gfp_mask, int nid, struct mem_cgroup *memcg,
14351435
int priority);
14361436

1437-
#ifdef CONFIG_64BIT
1438-
/* VM is sealed, in vm_flags */
1439-
#define VM_SEALED _BITUL(63)
1440-
#endif
1441-
14421437
#ifdef CONFIG_64BIT
14431438
static inline int can_do_mseal(unsigned long flags)
14441439
{

0 commit comments

Comments
 (0)