SysV shm: write back on munmap and drop attaches at exec

Đang mở
#497 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c, macos
Lĩnh vực
operating-systems

Hướng nghiên cứu

Start by tracing the SysV shared memory attach records and the sys_munmap and exec paths; the issue names shm_retire_unmapped as the lazy cleanup to revisit. Reproduce the described probe: attach, write W, call munmap, then attach again and read the value. Done means writes persist after unmapping and old-image attaches are dropped at exec.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

Follow-up to #485 (review comment r4504029776).

An attach is released only lazily: the next shmat or shmdt retires records whose serial no region carries. Two cases still differ from Linux:

  • After execve, the new image may never call shmat or shmdt, so every attach of the old image keeps its host attach until the process exits. This also keeps an IPC_RMIDed segment alive.
  • When the guest munmaps an attach without shmdt, its writes are lost. On Linux those pages are the segment, so the writes persist.

Measured with a probe that runs shmat, writes W, calls munmap and attaches again: Linux reads W, and elfuse reads 0.

Proposed fix: write back and detach from the sys_munmap path, and write back and drop every record at exec. This would also make the lazy sweep in shm_retire_unmapped unnecessary.

Ngôn ngữ chính
C
Star
287
Fork
33
Merge trung bình
2 ngày 17 giờ
Pull request đã merge (30 ngày)
18

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của sysprog21/elfuse

Tất cả issue của sysprog21/elfuse

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.