Repository navigation
ambarella-osdrv-s3l: stop the build when the kernel moves iav.ko's offsets - #2788
Conversation
…fsets The prebuilt modules hard-code struct offsets and carry no __versions, so a kernel config that moves them builds, boots and loads them, and fails only at the first /dev/iav ioctl. CI cannot see that: #2778 passed every check while it would have broken iav.ko on every S3L image. The package now compiles a probe against the built kernel with its own Kbuild, and stops if inode->i_cdev or file->private_data is not where iav_open expects.
PR Summary by QodoFail S3L builds when kernel offsets break prebuilt iav.ko
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
1. Kernel rebuilds can skip the ABI check
|
Problem
iav.koand the other S3L modules are prebuilt, carry no__versions, and hard-code struct offsets. A kernel config that moves them still builds, boots and loads them, and fails only at the first/dev/iavioctl. #2778 passed every CI check while it would have brokeniav.koon every S3L image, and #2763 fixed the same kind of breakage in the other direction.Change
ambarella-osdrv-s3lnow depends onlinux. After buildingload_ucode, it compilessrc/abi/abi_probe.cto assembly with the kernel's own Kbuild, so it gets this kernel's headers and flags. The build stops unless both offsets match whatiav_openuses:That's
inode->i_cdevat 272 andfile->private_dataat 112. The probe is never installed.Hardware tested on
Not run on a camera. It changes nothing on the image: the probe only runs on the build host, and the build output is the same size as before.
Evidence
make BOARD=s3l_ultimateon this branch, as is:The same build with #2778's
CONFIG_QUOTA=yadded tos3l.generic.config:ci-matrix.py --self-testpasses, and--stdinnarrows this tos3l_ultimate. So would any future change tos3l.generic.config, which means the check runs on every S3L kernel config change.Scope
general/package/all-patches/linux/(those go to OpenIPC/linux)general/overlay/or in a sharedload_<vendor>script hardcodes a value specific to my boardLD_PRELOAD, and no binaries that cannot be rebuilt from source