You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "casaroli (via GitHub)" <gi...@apache.org> on 2026/10/09 08:03:51 UTC
[PR] libs/libc/machine/arm64: Do not dereference a NULL symbol in up_relocateadd(). [nuttx]
casaroli opened a new pull request, #20550:
URL: https://github.com/apache/nuttx/pull/20550
## Summary
`libelf_relocateadd()` passes `sym` as NULL for a relocation against symbol index 0, such as `R_AARCH64_NONE`. The arm64 `up_relocateadd()` read `sym->st_value` before it looked at the relocation type, so loading a module with such a relocation faulted in the kernel.
This PR accepts a NULL symbol for `R_AARCH64_NONE` and fails any other type with `-EINVAL`, as the other architectures do.
## Impact
arm64 ELF loading only.
## Testing
`qemu-armv8a:knsh` with `CONFIG_DRIVERS_VIRTIO`, `CONFIG_DRIVERS_VIRTIO_MMIO`, `CONFIG_FS_V9FS` and `CONFIG_V9FS_VIRTIO_9P`, QEMU 11 (`-m 512M`, a `virtio-9p-device` share). The test programs were built outside the tree against the export package.
A program with an `R_AARCH64_NONE` relocation against symbol 0 (`.reloc ., R_AARCH64_NONE` in an assembly file).
Before:
```
nsh> none
default_fatal_handler: (IFSC/DFSC) for Data/Instruction aborts: level 2 translation fault
arm64_exception_handler: FAR_ELn: 0x8
```
After:
```
nsh> none
R_AARCH64_NONE test: nonefunc() returned 7
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] libs/libc/machine/arm64: Do not dereference a NULL symbol in up_relocateadd(). [nuttx]
Posted by "acassis (via GitHub)" <gi...@apache.org>.
acassis merged PR #20550:
URL: https://github.com/apache/nuttx/pull/20550
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] libs/libc/machine/arm64: Do not dereference a NULL symbol in up_relocateadd(). [nuttx]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #20550:
URL: https://github.com/apache/nuttx/pull/20550#issuecomment-6077267358
<!-- membrowse-pr-comment -->
## <img src="https://membrowse.com/membrowse-logo.svg" height="24" align="top"> MemBrowse Memory Report
*No memory changes detected for:*
- [arduino-mega2560](https://membrowse.com/public/apache/nuttx/target/arduino-mega2560/compare?head=82f211c0ad030627d1a8a25a7c9833ba862c61f7&base=5b383ae5baa0a9e5ccdcd00f146e29d9f3ccc22c)
- [esp32-devkitc](https://membrowse.com/public/apache/nuttx/target/esp32-devkitc/compare?head=82f211c0ad030627d1a8a25a7c9833ba862c61f7&base=5b383ae5baa0a9e5ccdcd00f146e29d9f3ccc22c)
- [hifive1-revb](https://membrowse.com/public/apache/nuttx/target/hifive1-revb/compare?head=82f211c0ad030627d1a8a25a7c9833ba862c61f7&base=5b383ae5baa0a9e5ccdcd00f146e29d9f3ccc22c)
- [mirtoo](https://membrowse.com/public/apache/nuttx/target/mirtoo/compare?head=82f211c0ad030627d1a8a25a7c9833ba862c61f7&base=5b383ae5baa0a9e5ccdcd00f146e29d9f3ccc22c)
- [qemu-armv8a](https://membrowse.com/public/apache/nuttx/target/qemu-armv8a/compare?head=82f211c0ad030627d1a8a25a7c9833ba862c61f7&base=5b383ae5baa0a9e5ccdcd00f146e29d9f3ccc22c)
- [qemu-intel64](https://membrowse.com/public/apache/nuttx/target/qemu-intel64/compare?head=82f211c0ad030627d1a8a25a7c9833ba862c61f7&base=5b383ae5baa0a9e5ccdcd00f146e29d9f3ccc22c)
- [rx65n-rsk2mb](https://membrowse.com/public/apache/nuttx/target/rx65n-rsk2mb/compare?head=82f211c0ad030627d1a8a25a7c9833ba862c61f7&base=5b383ae5baa0a9e5ccdcd00f146e29d9f3ccc22c)
- [s698pm-dkit](https://membrowse.com/public/apache/nuttx/target/s698pm-dkit/compare?head=82f211c0ad030627d1a8a25a7c9833ba862c61f7&base=5b383ae5baa0a9e5ccdcd00f146e29d9f3ccc22c)
- [stm32-nucleo-f103rb](https://membrowse.com/public/apache/nuttx/target/stm32-nucleo-f103rb/compare?head=82f211c0ad030627d1a8a25a7c9833ba862c61f7&base=5b383ae5baa0a9e5ccdcd00f146e29d9f3ccc22c)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org