Android: protecting the kernel
Linux内置安全机制
- Address space separation/process isolation
- unix permissions
- DAC capabilities
- SELinux
- seccomp
- namespaces
- …
内核Top 漏洞分类(按数量排序包括Core kernel 与 Vendor drivers,数据日期January 2014 -> April 2016)
- missing/incorrect bounds check
- null pointer defeference
- information leak
- missing permission check
- use after free
- race condition
- memory corruption(other)
- other
- integer overflow
- uninitialized data
利用缓解,安全机制- missing/incorrect bounds check(Landing in upstream kernel!)
- Hardened usercopy
- Protect against incorrect bounds checking in copy_*_user()
- PAN emulation
- Protect against kernel access to userspace bypassing hardened usercopy changes.
- Stack protector strong
- protects against stack buffer overflows
- KASLR (arm64 android-4.4 kernel)
- Makes code reuse attacks probabilistic
- PXN - make userspace non-executable for the kernel
- Protects against ret2user attacks
- RODATA - mark kernel memory as read-only/no-execute
- Makes code non-writeable, and data non-executable
漏洞利用缓解机制 - null pointer dereference
- CONFIG_LSM_MMAP_MIN_ADDR
- Make null pointer dereference unexploitable (just crash)
- PAN emulation also make null pointer
- dereference non-exploitable
一些安全建议
Android主线上的内核代码质量要优于厂商驱动代码:
- 厂商如何提升驱动代码安全质量? Step2
- Compiler changes e.g. integer overflow checking(clang 3.5+与gcc 5.0+都有integer overflow 检测)
- Scripts e.g. checkpatch.pl (checkpatch.pl可执行质量和简单漏洞检测)
- Runtime changes - e.g. PAN enforce proper use of copy_*_user() (Privileged Access Never)
- KASAN (内存错误检测)
- Constification (const声明)
利用缓解 - 减少攻击面(Linux权限模型,与SEAndroid策略配置)Setp1
- Restrict access to perf(限制perf访问)
- Access to perf_event_open() is disabled by default.
- Developers may re-enable access via debug shell
- Remove access to debugfs (限制debugfs访问,Android N完全禁止APP访问)
- All app access to debugfs removed in N
- Remove default access to /sys (白名单限制/sys访问)
- App access to files in /sys must be whitelisted
- Seccomp required for all devices (minijail shoutout!)
驱动代码安全质量控制:
- 安全编码规范,动静态安全检查(KASAN,checkpatch.pl等),安全编译选项
- 打开所有漏洞利用缓解机制
- 通过SELinux策略与Linux权限控制,减小驱动接口攻击面
Android: protecting the kernel的更多相关文章
- Compile android source and kernel for emulator in Debian
1.download the android source code Reference from http://source.android.com/source/downloading.html ...
- 编译android的linux kernel goldfish
https://source.android.com/source/building-kernels.html $ export PATH=/home/hzh/oldhome/learn/androi ...
- [原]Ubuntu 14.04编译Android Kernel
如何编译android kernel参考官方文档:https://source.android.com/source/building-kernels.html 在Ubuntu 14.04上编译a ...
- 在Ubuntu上下载、编译和安装Android最新内核源代码(Linux Kernel)
文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/6564592 在前一篇文章提到,从源代码树下载下 ...
- Mac OS X于Android Kernel下载方法
于上一篇日志中,我总结了大家提供的下载Android源代码的方法.这里再简单总结一下内核的下载方法. 參考这里的介绍:http://source.android.com/source/building ...
- 【Android 系统开发】下载 编译 Android源代码 和 Android kernel源代码
下载Android源码简要流程 : a. 获取repo文件: curl http://commondatastorage.googleapis.com/git-repo-downloads/repo ...
- 下载 编译 Android源代码 和 Android kernel源代码
下载Android源码简要流程 : a. 获取repo文件: curl http://commondatastorage.googleapis.com/git-repo-downloads/repo ...
- How to download and compile Android kernel goldfish ?
Prerequisites Assuming that we already downloaded the android-ndk-r12b and sdk. w4118@w4118:~/utils$ ...
- 华为手机内核代码的编译及刷入教程【通过魔改华为P9 Android Kernel 对抗反调试机制】
0x00 写在前面 攻防对立.程序调试与反调试之间的对抗是一个永恒的主题.在安卓逆向工程实践中,通过修改和编译安卓内核源码来对抗反调试是一种常见的方法.但网上关于此类的资料比较少,且都是基于AOSP ...
随机推荐
- Cassandra的commitLog、memtable、 SStable
和关系数据库一样,Cassandra在写数据之前,也需要先记录日志,称之为commitlog,然后数据才会写入到Column Family对应的Memtable中,并且Memtable中的内容是按照k ...
- Oracle 11.2.0.4.0 Dataguard部署和日常维护(7) - Dataguard Flashback篇
1. 设置备库的闪回目录 show parameter db_recovery_file; NAME TYPE VALUE ------------------------------------ - ...
- 水题系列二:PhoneNumbers
问题描述: Phonenumbers 企业喜欢用容易被记住的电话号码.让电话号码容易被记住的一个办法是将它写成一 个容易记 住的 单词或 者短语 .例如 ,你 需要给 滑铁卢 大学打 电话时 ,可 以 ...
- notepad++自动对齐使用空格代替Tab并将空格显示为小点
一.说明 对大多数语言而言自动对齐使用空格还是tab对编译运行并没有什么影响,但对python问题就很大:因为就算是缩进看起来是一样的但某些行用空格某些行用tab运行会报错. 另外除了空格替换tab外 ...
- shiro jwt 构建无状态分布式鉴权体系
一:JWT 1.令牌构造 JWT(json web token)是可在网络上传输的用于声明某种主张的令牌(token),以JSON 对象为载体的轻量级开放标准(RFC 7519). 一个JWT令牌的定 ...
- js--阻止冒泡,捕获,默认行为
防止冒泡和捕获 w3c的方法是e.stopPropagation(),IE则是使用e.cancelBubble = true· var el = window.document.getElementB ...
- CSS3 的box-shadow进阶之 - 动画篇 - 制作辐射动画
本篇文章是上一篇讲box-shadow基础知识的延伸,建议先花几分钟阅读那篇文章,点击阅读,再来看这篇. 除了box-shadow属性知识外,制作动画,还需要对CSS3的animation, @key ...
- UVa 10891 - Game of Sum 动态规划,博弈 难度: 0
题目 https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&a ...
- Unity中DOTween插件的DOTweenPath轨迹移动
先来看一下DOTweenPath组件的截图 1.Scene View Commands (1)SHIFT+CTRL:add a waypoint 加一个轨迹点 (2)SHIFT+ALT: ...
- Java 从服务器下载文件到本地(页面、后台、配置都有)
先来看实现效果: 有一个链接如下: 点击链接下载文件: 第一种方法:Servlet实现 一.HTML页面部分: 1.HTML页面中的一个链接 <a id="downloadTempl ...