← Documents Documentation/ABI/removed/sysfs-selinux-checkreqprot GitHub 원문 ↗

Linux 6.18.37 · ABI / removed

제거된 SELinux checkreqprot ABI

mmap/mprotect의 요청 protection과 실제 적용 protection 중 무엇을 검사할지 선택하던 호환 mechanism을 설명합니다.

Source pathDocumentation/ABI/removed/sysfs-selinux-checkreqprot
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

실제 protection 검사로 전환

sysfs-selinux-checkreqprot:1-26

Policy 승인 없이 executable mapping을 허용할 수 있던 checkreqprot 기능은 2023년 3월 제거됐습니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 What: /sys/fs/selinux/checkreqprot
2 Date: April 2005 (predates git)
3 KernelVersion: 2.6.12-rc2 (predates git)
4 Contact: selinux@vger.kernel.org
5 Description:
6
7 REMOVAL UPDATE: The SELinux checkreqprot functionality was removed in
8 March 2023, the original deprecation notice is shown below.
9
10 The selinuxfs "checkreqprot" node allows SELinux to be configured
11 to check the protection requested by userspace for mmap/mprotect
12 calls instead of the actual protection applied by the kernel.
13 This was a compatibility mechanism for legacy userspace and
14 for the READ_IMPLIES_EXEC personality flag. However, if set to
15 1, it weakens security by allowing mappings to be made executable
16 without authorization by policy. The default value of checkreqprot
17 at boot was changed starting in Linux v4.4 to 0 (i.e. check the
18 actual protection), and Android and Linux distributions have been
19 explicitly writing a "0" to /sys/fs/selinux/checkreqprot during
20 initialization for some time. Support for setting checkreqprot to 1
21 will be removed no sooner than June 2021, at which point the kernel
22 will always cease using checkreqprot internally and will always
23 check the actual protections being applied upon mmap/mprotect calls.
24 The checkreqprot selinuxfs node will remain for backward compatibility
25 but will discard writes of the "0" value and will reject writes of the
26 "1" value when this mechanism is removed.
27

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

SELinux checkreqprot

1-26
항목
What/sys/fs/selinux/checkreqprot
Date2005년 4월, git 이전
KernelVersion2.6.12-rc2, git 이전
Contactselinux@vger.kernel.org

SELinux checkreqprot 기능은 2023년 3월 제거됐다. 아래 내용은 원래의 deprecation 공지다.

selinuxfs의 checkreqprot node는 mmap/mprotect 호출에서 kernel이 실제로 적용한 protection 대신 user space가 요청한 protection을 SELinux가 검사하도록 설정할 수 있게 했다. 이는 옛 user space와 READ_IMPLIES_EXEC personality flag를 위한 호환 mechanism이었다.

그러나 1로 설정하면 policy의 승인 없이 mapping을 executable로 만들 수 있어 보안이 약해진다. Linux v4.4부터 boot 시 checkreqprot 기본값은 0, 즉 실제 protection을 검사하는 값으로 바뀌었다. Android와 Linux distribution도 한동안 초기화 과정에서 /sys/fs/selinux/checkreqprot에 0을 명시적으로 썼다.

과거 공지에서는 checkreqprot를 1로 설정하는 지원을 2021년 6월 이전에는 제거하지 않으며, 제거 시점부터 kernel 내부에서 checkreqprot 사용을 중단하고 mmap/mprotect 호출에 실제 적용되는 protection을 항상 검사한다고 설명했다. 하위 호환성을 위해 checkreqprot selinuxfs node는 남기되 0 쓰기는 버리고 1 쓰기는 거부할 예정이라고 기록했다.