Linux内置安全机制

  • Address space separation/process isolation
  • unix permissions
  • DAC capabilities
  • SELinux
  • seccomp
  • namespaces

内核Top 漏洞分类(按数量排序包括Core kernel 与 Vendor drivers,数据日期January 2014 -> April 2016)

  1. missing/incorrect bounds check
  2. null pointer defeference
  3. information leak
  4. missing permission check
  5. use after free
  6. race condition
  7. memory corruption(other)
  8. other
  9. integer overflow
  10. 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!)

驱动代码安全质量控制:

    1. 安全编码规范,动静态安全检查(KASAN,checkpatch.pl等),安全编译选项
    2. 打开所有漏洞利用缓解机制
    3. 通过SELinux策略与Linux权限控制,减小驱动接口攻击面

Android: protecting the kernel的更多相关文章

  1. Compile android source and kernel for emulator in Debian

    1.download the android source code Reference from http://source.android.com/source/downloading.html ...

  2. 编译android的linux kernel goldfish

    https://source.android.com/source/building-kernels.html $ export PATH=/home/hzh/oldhome/learn/androi ...

  3. [原]Ubuntu 14.04编译Android Kernel

    如何编译android kernel参考官方文档:https://source.android.com/source/building-kernels.html   在Ubuntu 14.04上编译a ...

  4. 在Ubuntu上下载、编译和安装Android最新内核源代码(Linux Kernel)

    文章转载至CSDN社区罗升阳的安卓之旅,原文地址:http://blog.csdn.net/luoshengyang/article/details/6564592 在前一篇文章提到,从源代码树下载下 ...

  5. Mac OS X于Android Kernel下载方法

    于上一篇日志中,我总结了大家提供的下载Android源代码的方法.这里再简单总结一下内核的下载方法. 參考这里的介绍:http://source.android.com/source/building ...

  6. 【Android 系统开发】下载 编译 Android源代码 和 Android kernel源代码

    下载Android源码简要流程 : a. 获取repo文件: curl http://commondatastorage.googleapis.com/git-repo-downloads/repo ...

  7. 下载 编译 Android源代码 和 Android kernel源代码

    下载Android源码简要流程 : a. 获取repo文件: curl http://commondatastorage.googleapis.com/git-repo-downloads/repo ...

  8. How to download and compile Android kernel goldfish ?

    Prerequisites Assuming that we already downloaded the android-ndk-r12b and sdk. w4118@w4118:~/utils$ ...

  9. 华为手机内核代码的编译及刷入教程【通过魔改华为P9 Android Kernel 对抗反调试机制】

    0x00  写在前面 攻防对立.程序调试与反调试之间的对抗是一个永恒的主题.在安卓逆向工程实践中,通过修改和编译安卓内核源码来对抗反调试是一种常见的方法.但网上关于此类的资料比较少,且都是基于AOSP ...

随机推荐

  1. SQL - 数据查询

    数据查询是数据库的核心操作.SQL 提供了 select 语句进行数据查询,该语句的一般格式为: select  [ ALL | distinct ] <目标列表达式>  [ ,<目 ...

  2. flex对象.show()的时候display变成block

    在css中设置display: none;的对象会出现这种情况. 在JavaScript中用.hide()隐藏的对象不会出现.

  3. Hadoop---hu-hadoop1: mv: cannot stat `/home/bigdata/hadoop-2.6.0/logs/hadoop-root-datanode-hu-hadoop1.out.4': No such file or directory

    hu-hadoop1: mv: cannot stat `/home/bigdata/hadoop-2.6.0/logs/hadoop-root-datanode-hu-hadoop1.out.4': ...

  4. OpenSSH隐藏版本号教程

    1.查看当前OpenSSH版本号 sshd -v #sshd并没有-v选项,这并不是重点重点是这样能曝出版本号 2.查看sshd位置 which sshd 3.备份sshd cp /usr/sbin/ ...

  5. python ctrl+c

    #!/usr/bin/env pythonimport signalimport sysimport osdef signal_handler(signal, frame): print('You p ...

  6. web前端开发面试题(答案)

    1.xhtml和html有什么区别? HTML是一种基本的WEB网页设计语言,XHTML是一个基于XML的置标语言最主要的不同:XHTML 元素必须被正确地嵌套.XHTML 元素必须被关闭.标签名必须 ...

  7. POJ 1001 Exponentiation(大数运算)

    POJ 1001 Exponentiation 时限:500 ms   内存限制:10000 K 提交材料共计: 179923   接受: 43369 描述:求得数R( 0.0 < R < ...

  8. laravel中判断当前页面与连接地址是否一致,并添加效果:

  9. windows 日常使用

    打开任务管理器:shift+ctrl+esc 各种快捷打开的方式 regedit.msc 注册表 gpedit.msc 组策略 lusrmgr.msc本地用户和组 CMD命令窗口打开任务管理: tas ...

  10. asp.net mvc 笔记一

    webapi controller 中 action 名称 不能与 View controller  中的 action 名称相同,否则 Url.Action("actionName&quo ...