public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 0/4] syscalls/ipc: shmctl04: Fix /proc/sysvipc/shm parsing
@ 2026-02-23  3:18 Guixiong Wei via ltp
  2026-02-23  3:19 ` [LTP] [PATCH 1/4] syscalls/ipc: shmctl04: Parse /proc/sysvipc/shm size as unsigned long Guixiong Wei via ltp
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Guixiong Wei via ltp @ 2026-02-23  3:18 UTC (permalink / raw)
  To: ltp; +Cc: Guixiong Wei

Hi,

This series fixes shmctl04 parsing and reporting for /proc/sysvipc/shm.

On systems with large SHM segments, the "bytes" column in /proc/sysvipc/shm may
exceed int range, which can lead to truncation and incorrect accounting. The
series parses the size column as unsigned long, requires fscanf() to match all
expected fields to avoid using stale values on partial matches, fixes format
specifiers when reporting counters, and uses SAFE_FOPEN/SAFE_FCLOSE for /proc
reads.

Thanks.

Guixiong Wei (4):
  syscalls/ipc: shmctl04: Parse /proc/sysvipc/shm size as unsigned long
  syscalls/ipc: shmctl04: Require full fscanf match
  syscalls/ipc: shmctl04: Use SAFE_FOPEN for /proc parsing
  syscalls/ipc: shmctl04: Fix shm_info print formats

 .../kernel/syscalls/ipc/shmctl/shmctl04.c     | 24 ++++++++++---------
 1 file changed, 13 insertions(+), 11 deletions(-)

-- 
2.20.1

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-02-24 13:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-23  3:18 [LTP] [PATCH 0/4] syscalls/ipc: shmctl04: Fix /proc/sysvipc/shm parsing Guixiong Wei via ltp
2026-02-23  3:19 ` [LTP] [PATCH 1/4] syscalls/ipc: shmctl04: Parse /proc/sysvipc/shm size as unsigned long Guixiong Wei via ltp
2026-02-23 16:39   ` Cyril Hrubis
2026-02-23  3:19 ` [LTP] [PATCH 2/4] syscalls/ipc: shmctl04: Require full fscanf match Guixiong Wei via ltp
2026-02-23 16:40   ` Cyril Hrubis
2026-02-23  3:19 ` [LTP] [PATCH 3/4] syscalls/ipc: shmctl04: Use SAFE_FOPEN for /proc parsing Guixiong Wei via ltp
2026-02-23 16:40   ` Cyril Hrubis
2026-02-23  3:19 ` [LTP] [PATCH 4/4] syscalls/ipc: shmctl04: Fix shm_info print formats Guixiong Wei via ltp
2026-02-23 16:41   ` Cyril Hrubis
2026-02-24 12:57 ` [LTP] [PATCH 0/4] syscalls/ipc: shmctl04: Fix /proc/sysvipc/shm parsing Andrea Cervesato via ltp
2026-02-24 13:00 ` Andrea Cervesato via ltp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox