【Android Debug】 Skipping insecure file ...

本文介绍了在Android设备上更新驱动程序时遇到的Skippinginsecurefile错误及其解决方案。该错误通常发生在文件权限设置不当的情况下,文章详细记录了如何正确设置文件权限以避免此问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在某个项目的bring up阶段,有时候会不断的更新各种文件,config, drivers, kernel image等。

有时候会出现 Skipping insecure file 错误,导致device boot失败。


详见如下:

详见system\core\init\util.c---> read_file
    if ((sb.st_mode & 
(S_IWGRP | S_IWOTH)) != 0) {
        ERROR("skipping insecure file '%s'\n", fn);
        goto oops;
    }


这个属于4.1新特性,更加安全,后续我们研发人员注意:


如笔者所经历,更新wifi/bt驱动时, 新编译出来的文件如下:


-rw-r--r-- 1 yangxx yangxx  173140 2013-06-19 07:16 galcore.ko
-rw-r--r-- 1 yangxx yangxx   62088 2013-06-19 07:16 mbt8xxx.ko
-rw-r--r-- 1 yangxx yangxx  277004 2013-06-19 07:16 mlan.ko
-rw-r--r-- 1 yangxx yangxx  358032 2013-06-19 07:16 sd8787.ko
-rw-r--r-- 1 yangxx yangxx 3876608 2013-06-19 07:16 uImage


明显文件权限是644, push到板子后就变成了777,

步骤如下:

adb root

adb remount

adb push *** /system/lib/modules/

adb shell sync

adb reboot

重启板子失败,从串口看这些文件,权限却变成了777.

研究发下,必须到板子里面更改权限才行,如下:

adb root

adb remount

adb shell

# cd /system/lib/modules/

# chmod 644 *.ko

# reboot


然后OK


总结:

[Solution]

1.      EnableBT/BT-HID as attached patch says, recompile kernel and BT drivers.

2.      Pushgalcore.ko  mbt8xxx.ko  mlan.ko  sd8787.ko to/system/lib/modules/

3.      Remountsystem and chmod modules permission to 644 (Wasted much time in thisstep, as push “777” files always in before verification)

[Reason]

Android defines secure file checking mechanismduring devcie boot, those with 777 permission will be regarded as inscure file.

Here, just make drivers matches kernel imagecorresponding, not android system images.





[File Watcher (node.js)] Request to start watching: /home/SENSETIME/leisiquan.vendor/.config/Code/User (excludes: <none>, includes: <all>, filter: <none>, correlationId: <none>),/home/SENSETIME/leisiquan.vendor/.config/Code/User/settings.json (excludes: <none>, includes: <all>, filter: <none>, correlationId: <none>) [main 2025-08-01T12:47:02.252Z] [File Watcher (node.js)] ignoring a path for watching who's stat info failed to resolve: /home/SENSETIME/leisiquan.vendor/.config/Code/User/settings.json (error: Error: ENOENT: no such file or directory, stat '/home/SENSETIME/leisiquan.vendor/.config/Code/User/settings.json') [main 2025-08-01T12:47:02.253Z] [File Watcher (node.js)] starting fs.watchFile() on /home/SENSETIME/leisiquan.vendor/.config/Code/User/settings.json (correlationId: undefined) [main 2025-08-01T12:47:02.256Z] Starting VS Code [main 2025-08-01T12:47:02.256Z] from: /usr/share/code/resources/app [main 2025-08-01T12:47:02.256Z] args: { _: [], diff: false, merge: false, add: false, remove: false, goto: false, 'new-window': false, 'reuse-window': false, wait: false, help: false, 'list-extensions': false, 'show-versions': false, 'pre-release': false, 'update-extensions': false, version: false, verbose: true, status: false, 'prof-startup': false, 'no-cached-data': false, 'prof-v8-extensions': false, 'disable-extensions': false, 'disable-lcd-text': false, 'disable-gpu': true, 'disable-chromium-sandbox': false, sandbox: false, telemetry: false, debugRenderer: false, 'enable-smoke-test-driver': false, logExtensionHostCommunication: false, 'skip-release-notes': false, 'skip-welcome': false, 'disable-telemetry': false, 'disable-updates': false, 'use-inmemory-secretstorage': false, 'disable-workspace-trust': false, 'disable-crash-reporter': false, 'crash-reporter-id': '9bc59030-b82d-49d9-9051-898bbb437304', 'skip-add-to-recently-opened': false, 'open-url': false, 'file-write': false, 'file-chmod': false, force: false, 'do-not-sync': false, 'do-not-include-pack-dependencies': false, trace: false, 'trace-memory-infra': false, 'preserve-env': false, 'force-user-env': false, 'force-disable-user-env': false, 'open-devtools': false, 'disable-gpu-sandbox': false, '__enable-file-policy': false, 'enable-coi': false, 'enable-rdp-display-tracking': false, 'disable-layout-restore': false, 'no-proxy-server': false, 'no-sandbox': false, nolazy: false, 'force-renderer-accessibility': false, 'ignore-certificate-errors': false, 'allow-insecure-localhost': false, 'disable-dev-shm-usage': false, 'profile-temp': false, logsPath: '/home/SENSETIME/leisiquan.vendor/.config/Code/logs/20250801T204702' } [main 2025-08-01T12:47:02.258Z] Resolving machine identifier... [main 2025-08-01T12:47:02.262Z] [File Watcher (node.js)] Started watching: '/home/SENSETIME/leisiquan.vendor/.config/Code/User' [49295:0801/204702.266343:WARNING:vaapi_wrapper.cc(1534)] Skipping nVidia device named: nvidia-drm [49295:0801/204702.268231:WARNING:sandbox_linux.cc(420)] InitializeSandbox() called with multiple threads in process gpu-process. [49295:0801/204702.269007:WARNING:viz_main_impl.cc(85)] VizNullHypothesis is disabled (not a warning) [main 2025-08-01T12:47:02.298Z] Resolved machine identifier: 3777bd569b947d43ea914eabe3a61f5de17708a4d53a88839111bf818a20a675 [main 2025-08-01T12:47:02.298Z] Main->SharedProcess#connect [main 2025-08-01T12:47:02.302Z] StorageMainService: creating application storage [main 2025-08-01T12:47:02.306Z] ElectronURLListener: waiting for window to be ready to handle URLs... [main 2025-08-01T12:47:02.306Z] lifecycle (main): phase changed (value: 2) [main 2025-08-01T12:47:02.306Z] windowsManager#open [main 2025-08-01T12:47:02.307Z] windowsManager#open pathsToOpen [ [Object: null prototype] {} ] [main 2025-08-01T12:47:02.307Z] windowsManager#doOpenEmpty { restore: false, remoteAuthority: undefined, filesToOpen: undefined, forceNewWindow: false } [main 2025-08-01T12:47:02.309Z] IPC Object URL: Registered new channel vscode:dc0454f3-919f-4e9a-999c-dc2a526cc059. [main 2025-08-01T12:47:02.309Z] window#validateWindowState: validating window state on 1 display(s) { width: 1200, height: 800, mode: 1, x: 360, y: 140, hasDefaultState: true } [main 2025-08-01T12:47:02.309Z] window#validateWindowState: single monitor working area { x: 72, y: 27, width: 1848, height: 1053 } [main 2025-08-01T12:47:02.309Z] window#ctor: using window state { width: 1200, height: 800, mode: 1, x: 360, y: 140, hasDefaultState: true } [main 2025-08-01T12:47:02.356Z] window#load: attempt to load window (id: 1) [main 2025-08-01T12:47:02.364Z] windowsManager#open used window count 1 (workspacesToOpen: 0, foldersToOpen: 0, emptyToRestore: 0, maybeOpenEmptyWindow: true) [main 2025-08-01T12:47:02.364Z] lifecycle (main): phase changed (value: 3) [main 2025-08-01T12:47:02.364Z] resolveShellEnv(): skipped (VSCODE_CLI is set) [main 2025-08-01T12:47:02.365Z] update#setState idle [main 2025-08-01T12:47:02.407Z] resolveShellEnv(): skipped (VSCODE_CLI is set) [49253:0801/204702.419375:INFO:CONSOLE(3)] "[uncaught exception]: TypeError: Failed to fetch dynamically imported module: vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js", source: vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/workbench.js (3) [49253:0801/204702.419453:INFO:CONSOLE(3)] "TypeError: Failed to fetch dynamically imported module: vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js", source: vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/workbench.js (3) [49253:0801/204702.419556:INFO:CONSOLE(4)] "Uncaught (in promise) TypeError: Failed to fetch dynamically imported module: vscode-file://vscode-app/usr/share/code/resources/app/out/vs/workbench/workbench.desktop.main.js", source: vscode-file://vscode-app/usr/share/code/resources/app/out/vs/code/electron-browser/workbench/workbench.js (4) [49253:0801/204702.445759:ERROR:nss_util.cc(227)] Error initializing NSS with a persistent database (sql:/home/SENSETIME/leisiquan.vendor/.pki/nssdb): libsoftokn3.so: 无法打开共享对象文件: 没有那个文件或目录 [49253:0801/204702.445798:ERROR:nss_util.cc(112)] Error initializing NSS without a persistent database: NSS error code: -5925 [49253:0801/204702.445805:FATAL:nss_util.cc(114)] nss_error=-5925, os_error=0 [0801/204702.482445:ERROR:directory_reader_posix.cc(43)] opendir /home/SENSETIME/leisiquan.vendor/.config/Code/Crashpad/attachments/63a4640e-035f-4f73-ac78-2ede9b09a5b9: No such file or directory (2) [49299:0801/204708.716049:ERROR:ssl_client_socket_impl.cc(877)] handshake failed; returned -1, SSL error code 1, net_error -3
最新发布
08-02
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值