커널 페이지 테이블 분리
Kernel page-table isolation커널 페이지 테이블 분리(KPTI 또는 PTI,[1] 이전에는 KAISER)[2][3]는 Linux 커널 기능으로 멜트다운의 보안 취약성(주로 인텔의 x86 CPU에 영향을 미침)[4]을 완화하고 커널 주소 공간 레이아웃 랜덤화(KASLR)를 우회하려는 시도에 대한 커널 강화를 개선합니다.KPTI는 Linux 커널 [5][6]버전 4.15에 [7]병합되어 Linux 커널 4.14.11, 4.9.75 및 4.4.[8][9][10]110으로 역리포트되었습니다.Windows와[11] MacOS는[12] 유사한 업데이트를 릴리스했습니다.KPTI는 관련된 Spectre [13]취약성에 대처하지 않습니다.
KAISER 배경
KPTI 패치는 KAISER(Kernel Address Isolation의 줄임말로 Side-Channels Efficient Removed)[6]를 기반으로 합니다.KAISER는 2016년에[14] 구상되어 멜트다운이 아직 알려지지 않은 2017년 6월에 발표되었습니다.KAISER는 훨씬 덜 심각한 문제에 대한 2014년 완화 조치인 KASLR을 물리치기 어렵게 만듭니다.
2014년에 Linux 커널은 [17]KASLR([15]Kernel Address Space Layout Randomization)을 채택했습니다.KASLR은 사용자 공간에서 숨겨진 커널 주소 [16]매핑에 의존하는 다른 커널 취약점을 이용하기 더 어렵게 만듭니다.이러한 커널 매핑에의 액세스는 금지되어 있습니다만, 최신의 프로세서에서는, 이 메모리의 위치를 누설할 가능성이 있는 사이드 채널 공격이 몇개인가 존재하기 때문에, KASLR을 [6][18][19][20]회피할 수 있습니다.
KAISER는 주소 [6]유출의 일부 원인을 제거함으로써 KASLR의 이러한 문제를 해결했습니다.KASLR은 주소 매핑의 누설을 방지하는 데 그친 반면 KAISER는 데이터 누설을 방지하여 멜트다운 [21]사례를 커버합니다.
KPTI는 KAISER를 기반으로 합니다.KPTI가 활성화되지 않은 경우 사용자 공간 코드(애플리케이션)를 실행할 때마다 Linux는 액세스로부터 보호되지만 커널 메모리 전체를 페이지 테이블에 매핑된 상태로 유지합니다.이점은 애플리케이션이 커널에 시스템을 호출하거나 인터럽트를 수신하면 커널 페이지 테이블이 항상 존재하므로 대부분의 컨텍스트 전환 관련 오버헤드([5]TLB 플래시, 페이지 테이블 스왑 등)를 피할 수 있다는 것입니다.
용해 취약성 및 KPTI
2018년 1월에는 인텔의 x86 CPU 및 ARM Cortex-A75에 [22][23]영향을 주는 멜트다운 취약성이 발표되었습니다.KAISER가 원래 수정하려고 했던 KASLR 바이패스보다 훨씬 더 심각한 취약성: 이전에 생각했던 것처럼 메모리 매핑 위치뿐만 아니라 커널 메모리의 내용도 유출될 수 있습니다.
KAISER에 기반한 KPTI는 대부분의 보호된 위치가 사용자 공간에 매핑되지 않도록 함으로써 멜트다운을 방지합니다.
AMD x86 프로세서는 현재 멜트다운의 영향을 받는 것으로 알려져 있지 않으며 이를 [13][24]완화하기 위해 KPTI가 필요하지 않습니다.단, AMD 프로세서는 KPTI가 [20]비활성화되어도 KASLR 바이패스의 영향을 받기 쉽습니다.
실행
KPTI는 사용자 공간과 커널 공간의 페이지 테이블을 완전히 분리하여 이러한 누수를 해결합니다.1 세트의 페이지 테이블에는 이전과 같은 커널 공간과 사용자 공간 주소가 모두 포함되어 있지만 시스템이 커널 모드로 실행 중일 때만 사용됩니다.사용자 모드에서 사용하는 두 번째 페이지테이블 세트에는 시스템콜, 인터럽트 및 [5]예외 입력 및 종료에 필요한 정보를 제공하는 사용자 공간 복사본과 커널 공간 매핑의 최소 세트가 포함됩니다.
프로세스 컨텍스트 식별자(PCID)를 지원하는 프로세서에서는 Translation Lookaside Buffer(TLB; 변환 룩사이드 버퍼) 플래시를 [5]피할 수 있지만 시스템 부하가 높은 [25]워크로드와 인터럽트 부하가 높은 워크로드에서는 특히 상당한 퍼포먼스 비용이 발생합니다.
KAISER의 최초 [6]작성자에 따르면 오버헤드는 0.28%로 [5]측정되었습니다. Linux 개발자는 대부분의 워크로드에서 약 5%, PCID를 최적화하더라도 경우에 따라서는 최대 30%로 측정했습니다. 데이터베이스 엔진 Postgre입니다.인텔 Skylake 프로세서의 읽기 전용 테스트에 대한 SQL의 영향은 7~17%(PCID가 [26]없는 경우 16~23%), 전체 벤치마크에서 13~19%(Coffee Lake vs.Broadwell-E)[27]많은 벤치마크가 [28][29][1]Phoronix에 의해 실행되었지만 Redis는 6~7%[27] 느려졌습니다.Haswell에서는 [30]Linux 커널 컴파일이 5% 느려졌습니다.
KPTI는 "nopti" 커널 부팅 옵션을 사용하여 부분적으로 비활성화할 수 있습니다.또한 새로운 프로세서가 정보 유출을 [2]수정하면 KPTI를 비활성화하기 위한 조항도 작성되었습니다.
레퍼런스
- ^ a b Larabel, Michael (2018-01-03). "Further Analyzing The Intel CPU "x86 PTI Issue" On More Systems". Phoronix.
- ^ a b Corbet, Jonathan (2017-12-20). "The current state of kernel page-table isolation". LWN.net.
- ^ Cimpanu, Catalin (2018-01-03). "OS Makers Preparing Patches for Secret Intel CPU Security Bug". Bleeping Computer.
- ^ "Spectre, Meltdown: Critical CPU Security Flaws Explained – ExtremeTech". ExtremeTech. 2018-01-04. Retrieved 2018-01-05.
- ^ a b c d e Corbet, Jonathan (2017-11-15). "KAISER: hiding the kernel from user space". LWN.net.
- ^ a b c d e Gruss, Daniel; Lipp, Moritz; Schwarz, Michael; Fellner, Richard; Maurice, Clémentine; Mangard, Stefan (2017-06-24). KASLR is Dead: Long Live KASLR (PDF). Engineering Secure Software and Systems 2017.
- ^ Corbet, Jonathan (2017-12-20). "Kernel page-table isolation merged". LWN.net.
- ^ Kroah-Hartman, Greg (2018-01-02). "Linux 4.14.11 Changelog". kernel.org.
- ^ Kroah-Hartman, Greg (2018-01-05). "Linux 4.9.75 Changelog". kernel.org.
- ^ Kroah-Hartman, Greg (2018-01-05). "Linux 4.4.110 Changelog".
- ^ @aionescu (2017-11-14). "Windows 17035 Kernel ASLR/VA Isolation In Practice" (Tweet) – via Twitter.
- ^ "Apple has already partially implemented fix in macOS for 'KPTI' Intel CPU security flaw". AppleInsider. Retrieved 2018-01-03.
- ^ a b Coldewey, Devin (2018-01-04). "Kernel panic! What are Meltdown and Spectre, the bugs affecting nearly every computer and device?". TechCrunch.
- ^ Gruss, Daniel (2018-01-03). "#FunFact: We submitted #KAISER to #bhusa17 and got it rejected". Archived from the original on 2018-01-08. Retrieved 2018-01-08 – via Twitter.
- ^ "Linux kernel 3.14, Section 1.7. Kernel address space randomization". kernelnewbies.org. 2014-03-30. Retrieved 2014-04-02.
- ^ Bhattacharjee, Abhishek; Lustig, Daniel (2017-09-29). Architectural and Operating System Support for Virtual Memory. Morgan & Claypool Publishers. p. 56. ISBN 978-1-62705-933-6.
- ^ Kerner, Sean Michael (2018-01-03). "KPTI Intel Chip Flaw Exposes Security Risks". eWEEK.
- ^ Jang, Yeongjin; Lee, Sangho; Kim, Taesoo (2016). "Breaking Kernel Address Space Layout Randomization with Intel TSX" (PDF). 2016 ACM SIGSAC Conference on Computer and Communications Security. CCS '16. New York, NY, USA: ACM: 380–392. doi:10.1145/2976749.2978321. ISBN 978-1-4503-4139-4.
- ^ Gruss, Daniel; Maurice, Clémentine; Fogh, Anders; Lipp, Moritz; Mangard, Stefan (2016). "Prefetch Side-Channel Attacks: Bypassing SMAP and Kernel ASLR" (PDF). 2016 ACM SIGSAC Conference on Computer and Communications Security. CCS '16. New York, NY, USA: ACM: 368–379. doi:10.1145/2976749.2978356. ISBN 978-1-4503-4139-4.
- ^ a b Hund, R.; Willems, C.; Holz, T. (May 2013). "Practical Timing Side Channel Attacks against Kernel Space ASLR" (PDF). 2013 IEEE Symposium on Security and Privacy: 191–205. doi:10.1109/sp.2013.23.
- ^ "Meltdown" (PDF).
- ^ "Spectre, Meltdown: Critical CPU Security Flaws Explained – ExtremeTech". ExtremeTech. 2018-01-04. Retrieved 2018-01-05.
- ^ Coldewey, Devin (2018-01-04). "Kernel panic! What are Meltdown and Spectre, the bugs affecting nearly every computer and device?". TechCrunch.
- ^ "An Update on AMD Processor Security". AMD. 2018-01-04.
- ^ Leyden, John; Williams, Chris (2018-01-02). "Kernel-memory-leaking Intel processor design flaw forces Linux, Windows redesign". The Register.
- ^ Freund, Andres (2018-01-02). "heads up: Fix for intel hardware bug will lead to performance regressions". PostgreSQL development mailing list (pgsql-hackers).
- ^ a b Larabel, Michael (2018-01-02). "Initial Benchmarks Of The Performance Impact Resulting From Linux's x86 Security Changes". Phoronix.
- ^ Larabel, Michael (2018-01-02). "Linux Gaming Performance Doesn't Appear Affected By The x86 PTI Work". Phoronix.
- ^ Larabel, Michael (2018-01-03). "VM Performance Showing Mixed Impact With Linux 4.15 KPTI Patches – Phoronix". Phoronix.
- ^ Velvindron, Loganaden (2018-01-04). "Linux KPTI performance hit on real workloads". Loganaden Velvindron. Retrieved 2018-01-05.