diff options
| author | Jianlin Shi <shijianlin11@foxmail.com> | 2026-06-15 10:27:41 +0800 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-07-25 21:51:26 -0700 |
| commit | 23ecaf9e7de35393cf67cfd30b93430db2658a39 (patch) | |
| tree | 916464586f926b9d2e509014e9d480fcec4256e7 /scripts | |
| parent | 3b453bd1113543920baca62951d3964f31d84e80 (diff) | |
| download | linux-next-23ecaf9e7de35393cf67cfd30b93430db2658a39.tar.gz linux-next-23ecaf9e7de35393cf67cfd30b93430db2658a39.zip | |
ipc: only destroy orphaned shm segments on sysctl write
proc_ipc_dointvec_minmax_orphans() currently calls shm_destroy_orphaned()
whenever shm_rmid_forced is set, including on sysctl reads. Reading
/proc/sys/kernel/shm_rmid_forced should not take shm_ids rwsem for write
and walk all segments.
Only run the cleanup when the sysctl is written and the forced RMID policy
is enabled.
When shm_rmid_forced=1, monitoring tools that read
/proc/sys/kernel/shm_rmid_forced trigger the cleanup on every read.
Link: https://lore.kernel.org/all/?q=only+destroy+orphaned+shm+segments+on+sysctl+write
Link: https://lore.kernel.org/tencent_738A8BC6E9EA205F555E4B0DAA154D4F8E0A@qq.com
Signed-off-by: Jianlin Shi <shijianlin11@foxmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Davidlohr Bueso <dave@stgolabs.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'scripts')
0 files changed, 0 insertions, 0 deletions
