RT-Thread / RT-Thread/rt-thread
[Bug] 读分区表函数readlba的实现可能会导致buffer溢出
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 12.2k
- Forks
- 5.4k
- Avg merge
- 4d 12h
- Merged PRs (30d)
- 40
Description
RT-Thread Version
5.2
Hardware Type/Architectures
ARM64
Develop Toolchain
GCC
Describe the bug
问题描述: components/drivers/block/partitions/efi.c文件的readlba函数中总是以512字节去读取数据,当传入的buffer size没对齐到512时会导致最后一次读取时buffer溢出。从而导致各种问题。
Other additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with components/drivers/block/partitions/efi.c and inspect the readlba function, focusing on how the buffer size is handled when it is not aligned to 512 bytes. Verify that the final read cannot write beyond the provided buffer, then run the relevant partition and block-device tests available in the repository.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100