| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
UPMS新增PERMISSION_CUSTOM_SCREEN_CAPTURE权限校验 Signed-off-by: lidongrui <lidongrui3@huawei.com> Co-Authored-By: Agent 🤖 AI[98%] 🔧 Human Fixed[0%] 🧑 Human[2%] 👌 AI Adopted[100%] Co-authored-by: claude (glm-5.2) <ai@local> | 1 个月前 | |
perf(build): enable size_optimize_config on 130 SO targets Add a new services/common:size_optimize_config (same flags as optimize_config minus the explicit -flto=full, so the toolchain's global ThinLTO mode is preserved) and apply it to the 130 ohos_shared_library targets that previously shipped without any optimization config, so unreferenced functions/data are dropped at link time and ROM shrinks without overriding the global LTO policy. -Wl,--gc-sections is an ELF-only linker flag: Apple ld rejects it, so both optimize_config and size_optimize_config now add it only when current_os != "mac", keeping the darwin SDK host build (which links dylibs with -dead_strip) working. Co-Authored-By: Agent Signed-off-by: RuiChen_01 <chenrui193@huawei.com> AI[100%] Human Fixed[0%] Human[0%] AI Adopted[100%] Co-authored-by: claude (glm-5.3) <ai@local> | 16 天前 | |
!20199 merge master0813 into master fix upms bug Created-by: dsz2025 Commit-by: duansizhao Merged-by: openharmony_ci Description: **IssueNo**: #15972 **Description**: 修复 services/uripermmgr/src/file_permission_manager.cpp 中 DESKTOP_PATH/DOCUMENTS_PATH/DOWNLOAD_PATH 目录前缀越界校验漏洞。原 path.find(X) == 0 前缀匹配会把同名前缀兄弟目录(如 Desktop2/DocumentsX/Downloader)误判为权限覆盖范围,新增 IsPathInDir 严格边界判断(目录本身或 dir/ 子路径)替换三处判断;同步在 uri_permission_impl_test 补充 17 个回归用例(目录本身/子路径/同名前缀兄弟目录/自身bundle冷启动/尾斜杠等场景)。 **稳定性自检:** | 自检项 | 自检结果 | | ------------------------------------------------------------ | -------- | | 涉及跨进程调用的相关操作需要抛至主线程或加锁防止并发 | ok | | 成员变量进行赋值或创建需要排查并发 | ok | | 谨慎在lambda表达式中使用引用捕获 | ok | | 谨慎在未经拷贝的情况下使用外部传入的string、C字符串 | ok | | map\vector\list\set等stl模板类使用时需要排查并发 | ok | | 谨慎考虑加锁范围 | ok | | 在IPC通信中谨慎使用同步通信方式 | ok | | 禁止传递this指针至其他模块或线程(特别是eventhandler任务) | ok | | 禁止将外部传入的裸指针在内部直接构造智能指针 | ok | | 禁止多个独立创建的智能指针管理同一地址 | ok | | 禁止在析构函数中抛异步任务 | ok | | 禁止js对象在非js线程(例如在IPC线程)创建、使用或销毁 | ok | | 禁止在对外接口中未经判空直接使用外部传入的指针 | ok | | 禁止接口返回局部变量引用 | ok | | 禁止在信号函数中加锁 | ok | | 禁止在关键流程(SA启动、应用启动等主流程)执行耗时的操作 | ok | | 禁止将同一个cpp编译在不同的so中 | ok | **安全编码自检:** | 自检项 | 自检结果 | | -------------------------------------------------------------- | -------- | | 裸指针避免通过隐式转换构造为sptr | ok | | json对象在取值之前必须先判断类型,避免类型不匹配 | ok | | 序列化时必须对传入的数组大小进行校验,避免出现超大数组 | ok | | 避免使用未明确位宽的整型,选择使用int8_t、uint8_t等类型 | ok | | 外部传入的路径要做规范化校验,对路径中的.、..、../等特殊字符严格校验 | ok | | 指针变量、表示资源描述符的变量、bool变量必须赋初值 | ok | | readParcelable获取的对象使用前需要判空 | ok | | 分配和释放内存的函数需要成对出现 | ok | | 申请内存后异常退出前需要及时进行内存释放 | ok | | 内存申请前必须对内存大小进行合法性校验 | ok | | 内存分配后必须判断是否成功 | ok | | 禁止使用realloc、alloca函数 | ok | | 禁止打印文件路径、口令等敏感信息,如有需要,使用private修饰 | ok | | 禁止打印内存地址 | ok | | 整数之间运算时必须严格检查,确保不会出现溢出、反转、除0 | ok | | 禁止对有符号整数进行位操作符运算 | ok | | 禁止对指针进行逻辑或位运算 | ok | | 循环次数如果收外部数据控制,需要检验其合法性 | ok | | 禁止使用内存操作类危险函数,需要使用安全函数 | ok | | 谨慎使用不可重入函数 | ok | | 必须检查安全函数的返回值,并进行正确处理 | ok | | 禁止仅通过TokenType类型判断绕过权限校验 | ok | **TDD Result**: 不涉及。本地构建环境受限(out目录GN图损坏)无法执行完整单测,已通过独立 g++ 逻辑验证(IsPathInDir + Download分支共 37 个场景全 PASS),等待 CI 执行 uri_permission_impl_test。 **XTS Result**: 不涉及。改动仅涉及服务端路径边界判断与单元测试,等待 CI 验证。 ### 是否已执行L0用例 - [ ] 已验证 - [x] 不涉及。如不涉及,请写明理由:本地构建环境 GN 图损坏无法执行 L0 用例,改动为服务端权限校验逻辑与单测用例,等待 CI 编译与 uri_permission_impl_test 验证。 ### AI检视评分(使用本地代码检视skills扫描): 不适用。 See merge request: openharmony/ability_ability_runtime!20199 | 23 天前 | |
perf(build): enable size_optimize_config on 130 SO targets Add a new services/common:size_optimize_config (same flags as optimize_config minus the explicit -flto=full, so the toolchain's global ThinLTO mode is preserved) and apply it to the 130 ohos_shared_library targets that previously shipped without any optimization config, so unreferenced functions/data are dropped at link time and ROM shrinks without overriding the global LTO policy. -Wl,--gc-sections is an ELF-only linker flag: Apple ld rejects it, so both optimize_config and size_optimize_config now add it only when current_os != "mac", keeping the darwin SDK host build (which links dylibs with -dead_strip) working. Co-Authored-By: Agent Signed-off-by: RuiChen_01 <chenrui193@huawei.com> AI[100%] Human Fixed[0%] Human[0%] AI Adopted[100%] Co-authored-by: claude (glm-5.3) <ai@local> | 16 天前 | |
add upms claude.md Signed-off-by: duansizhao <duansizhao@huawei.com> | 5 个月前 |