StsHostTestCases kptr_restrict 为0分析

StsHostTestCases kptr_restrict 为0

--该词条未被审核

Android Q,202009的STS工具测试STS fail 三项

分析:

查看log:

测试中会cat /proc/sys/kernel/kptr_restrict,期望返回2或者大于2

然后再进行安全补丁的验证。

 

1.STS测试fail先查看补丁是否打上,经过确认,补丁已经打上。

例如某个补丁,查看代码已经存在。

2.那么此项fail的原因为userdebug版本节点/proc/sys/kernel/kptr_restrict的值为0.查看之前的版本(测试pass的版本),一直都是这个值。推测是谷歌工具更新,测试项更新。

kptr_restrict简介:

kptr_restrict:

This toggle indicates whether restrictions are placed on
exposing kernel addresses via /proc and other interfaces.

When kptr_restrict is set to (0), the default, there are no restrictions.

When kptr_restrict is set to (1), kernel pointers printed using the %pK
format specifier will be replaced with 0's unless the user has CAP_SYSLOG
and effective user and group ids are equal to the real ids. This is
because %pK checks are done at read() time rather than open() time, so
if permissions are elevated between the open() and the read() (e.g via
a setuid binary) then %pK will not leak kernel pointers to unprivileged
users. Note, this is a temporary solution only. The correct long-term
solution is to do the permission checks at open() time. Consider removing
world read permissions from files that use %pK, and using dmesg_restrict
to protect against uses of %pK in dmesg(8) if leaking kernel pointer
values to unprivileged users is a concern.

When kptr_restrict is set to (2), kernel pointers printed using
%pK will be replaced with 0's regardless of privileges.

正常情况下userdebug版本这个节点的值为0,是为了调试。并不是bug。但是google STS需要此项为2或者大于2,那么我们需要修改。

 

3.根据高通的case,修改为:

1.remove:CONFIG_DEBUG_CONSOLE_UNHASHED_POINTERS

2.回退这个修改:
https://source.codeaurora.org/quic/la/device/qcom/common/commit/?id=dabbf8107e5a90630af568027f11e806e61113ce

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值