mm-madvise-split-out-madvise-input-validity-check.patch removed from -mm tree
The quilt patch titled
Subject: mm/madvise: split out madvise input validity check
has been removed from the -mm tree. Its filename was
mm-madvise-split-out-madvise-input-validity-check.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: SeongJae Park <[email protected]>
Subject: mm/madvise: split out madvise input validity check
Date: Wed, 5 Feb 2025 22:15:15 -0800
Split out the madvise parameters validation logic from do_madvise(), for easy reuse of the logic from a future change.
---
mm/madvise.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-)
mm/madvise.c renamed from mm/madvise.c~mm-madvise-split-out-madvise-input-validity-check +22 -10
@@ -1618,6 +1618,27 @@ static void madvise_unlock(struct mm_strmmap_read_unlock (mm); } +static bool is_valid_madvise (unsigned long start,size_t len_in,int behavior) +{ +size_t len; + +if (!madvise_behavior_valid (behavior)) +return false; + +if (!PAGE_ALIGNED (start)) +return false; + len =PAGE_ALIGN (len_in); + +/* Check to see whether len was rounded up from small -ve to zero */ +if (len_in && !len) +return false; + +if (start + len < start) +return false; + +return true; +} +/* * The madvise(2) system call. *
@@ -1697,20 +1718,11 @@ int do_madvise(struct mm_struct *mm, unssize_t len;struct blk_plug plug; -if (!madvise_behavior_valid (behavior)) +if (!is_valid_madvise (start, len_in, behavior))return -EINVAL ; -if (!PAGE_ALIGNED (start)) -return -EINVAL ; len =PAGE_ALIGN (len_in); - -/* Check to see whether len was rounded up from small -ve to zero */ -if (len_in && !len) -return -EINVAL ; - end = start + len; -if (end < start) -return -EINVAL ;if (end == start)return 0 ;
_
Patches currently in -mm which might be from [email protected] are
mm-damon-sysfs-schemes-let-damon_sysfs_scheme_set_filters-be-used-for-different-named-directories.patch mm-damon-sysfs-schemes-implement-core_filters-and-ops_filters-directories.patch mm-damon-sysfs-schemes-commit-filters-in-coreops_filters-directories.patch mm-damon-core-expose-damos_filter_for_ops-to-damon-kernel-api-callers.patch mm-damon-sysfs-schemes-record-filters-of-which-layer-should-be-added-to-the-given-filters-directory.patch mm-damon-sysfs-schemes-return-error-when-for-attempts-to-install-filters-on-wrong-sysfs-directory.patch docs-abi-damon-document-coreops_filters-directories.patch docs-admin-guide-mm-damon-usage-update-for-coreops_filters-directories.patch mm-damon-sysfs-validate-user-inputs-from-damon_sysfs_commit_input.patch mm-damon-core-invoke-kdamond_call-after-merging-is-done-if-possible.patch mm-damon-core-make-damon_set_attrs-be-safe-to-be-called-from-damon_call.patch mm-damon-sysfs-handle-commit-command-using-damon_call.patch mm-damon-sysfs-remove-damon_sysfs_cmd_request-code-from-damon_sysfs_handle_cmd.patch mm-damon-sysfs-remove-damon_sysfs_cmd_request_callback-and-its-callers.patch mm-damon-sysfs-remove-damon_sysfs_cmd_request-and-its-readers.patch mm-damon-sysfs-schemes-remove-obsolete-comment-for-damon_sysfs_schemes_clear_regions.patch mm-damon-remove-damon_callback-private.patch mm-damon-remove-before_start-of-damon_callback.patch mm-damon-remove-damon_callback-after_sampling.patch mm-damon-remove-damon_callback-before_damos_apply.patch mm-damon-remove-damon_operations-reset_aggregated.patch mm-damon-sysfs-schemes-avoid-wformat-security-warning-on-damon_sysfs_access_pattern_add_range_dir.patch mm-madvise-use-is_memory_failure-from-madvise_do_behavior.patch mm-madvise-split-out-populate-behavior-check-logic.patch mm-madvise-deduplicate-madvise_do_behavior-skip-case-handlings.patch mm-madvise-remove-len-parameter-of-madvise_do_behavior.patch