remove can_do_mseal
Subsystems (3)
v2 cover remove can_do_mseal
From: Jeff Xu <[email protected]>
History:
V2: remove the can_do_mseal (Liam.Howlett, Lorenzo Stoakes)
V1: initial version.
Jeff Xu (1):
mseal: move can_do_mseal() to mseal.c
mm/internal.h | 16 ---------------- mm/mseal.c | 6 +++--- 2 files changed, 3 insertions(+), 19 deletions(-)
Signature · 1 line
2.47.0.338.g60cca15819-goog
PATCH v2 1/1 mseal: remove can_do_mseal()
From: Jeff Xu <[email protected]>
No code logic change.
can_do_mseal() is called exclusively by mseal.c, and mseal.c is compiled only when CONFIG_64BIT flag is set in makefile. Therefore, it is unnecessary to have 32 bit stub function in the header file, remove this function and merge the logic into do_mseal().
--- mm/internal.h | 16 ---------------- mm/mseal.c | 6 +++--- 2 files changed, 3 insertions(+), 19 deletions(-)
mm/internal.h +0 -16
@@ -1457,22 +1457,6 @@ void __meminit __init_single_page(struct page *page, unsigned long pfn,unsigned long shrink_slab (gfp_t gfp_mask,int nid,struct mem_cgroup *memcg,int priority); -#ifdef CONFIG_64BIT -static inline int can_do_mseal (unsigned long flags) -{ -if (flags) -return -EINVAL ; - -return 0 ; -} - -#else -static inline int can_do_mseal (unsigned long flags) -{ -return -EPERM ; -} -#endif -#ifdef CONFIG_SHRINKER_DEBUG static inline __printf(2, 0) int shrinker_debugfs_name_alloc( struct shrinker *shrinker, const char *fmt, va_list ap)
mm/mseal.c +3 -3
@@ -217,9 +217,9 @@ int do_mseal(unsigned long start, size_t len_in, unsigned long flags)unsigned long end;struct mm_struct *mm = current->mm; - ret =can_do_mseal (flags); -if (ret) -return ret; +/* Verify flags not set. */ +if (flags) +return -EINVAL ; start =untagged_addr (start);if (!PAGE_ALIGNED (start))
Signature · 1 line
2.47.0.338.g60cca15819-goog
Re: [PATCH v2 1/1] mseal: remove can_do_mseal()
Quoted 11 lines · On Fri, Dec 06, 2024 at 07:48:39PM +0000, [email protected] wrote:
From: Jeff Xu <[email protected]>
No code logic change.
can_do_mseal()is called exclusively bymseal.c, andmseal.cis compiled only whenCONFIG_64BITflag is set in makefile. Therefore, it is unnecessary to have 32 bit stub function in the header file, remove this function and merge the logic intodo_mseal().Signed-off-by Jeff Xu <[email protected]>
LGTM,
Quoted 8 lines
Cc Jorge Lucangeli Obes <[email protected]>Cc Kees Cook <[email protected]>Cc Liam R. Howlett <[email protected]>Cc Lorenzo Stoakes <[email protected]>Cc Pedro Falcato <[email protected]>Cc Randy Dunlap <[email protected]>Cc Vlastimil Babka <[email protected]>Signed-off-by Andrew Morton <[email protected]>
Not sure you should be submitting a S-o-b for Andrew :P I'm thinking this is a copy/paste mistake.
Quoted 52 lines
--- mm/internal.h | 16 ---------------- mm/mseal.c | 6 +++--- 2 files changed, 3 insertions(+), 19 deletions(-)mm/internal.h +0
-16@@ -1457,22 +1457,6 @@ void __meminit __init_single_page(struct page *page, unsigned long pfn,unsigned long shrink_slab (gfp_t gfp_mask,int nid,struct mem_cgroup *memcg,int priority); -#ifdef CONFIG_64BIT -static inline int can_do_mseal (unsigned long flags) -{ -if (flags) -return -EINVAL ; - -return 0 ; -} - -#else -static inline int can_do_mseal (unsigned long flags) -{ -return -EPERM ; -} -#endif -#ifdef CONFIG_SHRINKER_DEBUG static inline __printf(2, 0) int shrinker_debugfs_name_alloc( struct shrinker *shrinker, const char *fmt, va_list ap)mm/mseal.c +3
-4@@ -217,9 +217,9 @@ int do_mseal(unsigned long start, size_t len_in, unsigned long flags)unsigned long end;struct mm_struct *mm = current->mm; - ret =can_do_mseal (flags); -if (ret) -return ret; +/* Verify flags not set. */ +if (flags) +return -EINVAL ; start =untagged_addr (start);if (!PAGE_ALIGNED (start)) --2.47.0.338.g60cca15819-goog
Re: [PATCH v2 1/1] mseal: remove can_do_mseal()
Quoted 4 lines · Lorenzo Stoakes
Quoted 2 lines · On Fri, Dec 06, 2024 at 07:48:39PM +0000, [email protected] wrote:
From: Jeff Xu <[email protected]>
Quoted 8 lines
Quoted 8 lines
No code logic change.
can_do_mseal()is called exclusively bymseal.c, andmseal.cis compiled only whenCONFIG_64BITflag is set in makefile. Therefore, it is unnecessary to have 32 bit stub function in the header file, remove this function and merge the logic intodo_mseal().
Please remove the link field here when applying.
(I pull the mm-unstable and apply my change on top of the existing commit.)
Quoted 15 lines
Quoted 1 line
Signed-off-by Jeff Xu <[email protected]>LGTM,
Reviewed-by Lorenzo Stoakes <[email protected]>Quoted 8 lines
Cc Jorge Lucangeli Obes <[email protected]>Cc Kees Cook <[email protected]>Cc Liam R. Howlett <[email protected]>Cc Lorenzo Stoakes <[email protected]>Cc Pedro Falcato <[email protected]>Cc Randy Dunlap <[email protected]>Cc Vlastimil Babka <[email protected]>Signed-off-by Andrew Morton <[email protected]>
Quoted 3 lines
Not sure you should be submitting a S-o-b for Andrew :P I'm thinking this is a copy/paste mistake.
I realized where this is coming from after seeing this response.
Thanks for pointing it out
Quoted 52 lines
Quoted 52 lines
--- mm/internal.h | 16 ---------------- mm/mseal.c | 6 +++--- 2 files changed, 3 insertions(+), 19 deletions(-)mm/internal.h +0
-16@@ -1457,22 +1457,6 @@ void __meminit __init_single_page(struct page *page, unsigned long pfn,unsigned long shrink_slab (gfp_t gfp_mask,int nid,struct mem_cgroup *memcg,int priority); -#ifdef CONFIG_64BIT -static inline int can_do_mseal (unsigned long flags) -{ -if (flags) -return -EINVAL ; - -return 0 ; -} - -#else -static inline int can_do_mseal (unsigned long flags) -{ -return -EPERM ; -} -#endif -#ifdef CONFIG_SHRINKER_DEBUG static inline __printf(2, 0) int shrinker_debugfs_name_alloc( struct shrinker *shrinker, const char *fmt, va_list ap)mm/mseal.c +3
-4@@ -217,9 +217,9 @@ int do_mseal(unsigned long start, size_t len_in, unsigned long flags)unsigned long end;struct mm_struct *mm = current->mm; - ret =can_do_mseal (flags); -if (ret) -return ret; +/* Verify flags not set. */ +if (flags) +return -EINVAL ; start =untagged_addr (start);if (!PAGE_ALIGNED (start)) --2.47.0.338.g60cca15819-goog