Skip to content

fix: multiple memcpy calls in the fat32 driver (ff in ff.c#7

Open
orbisai0security wants to merge 1 commit into
Vinalinux-Org:mainfrom
orbisai0security:fix-fat32-sfn-memcpy-bounds-check
Open

fix: multiple memcpy calls in the fat32 driver (ff in ff.c#7
orbisai0security wants to merge 1 commit into
Vinalinux-Org:mainfrom
orbisai0security:fix-fat32-sfn-memcpy-bounds-check

Conversation

@orbisai0security

Copy link
Copy Markdown

Summary

Fix critical severity security issue in reference/drivers/fat32/source/ff.c.

Vulnerability

Field Value
ID V-001
Severity CRITICAL
Scanner multi_agent_ai
Rule V-001
File reference/drivers/fat32/source/ff.c:2024

Description: Multiple memcpy calls in the FAT32 driver (ff.c) copy data from filesystem structures into fixed-size buffers without independently verifying that the source length fits within the destination buffer. At line 2024, 11 bytes are copied for a Short File Name (SFN) without checking destination size. At lines 2160/2171, SZDIRE-sized directory blocks are copied into dirb without validating the offset. At lines 4052/4056, sector-sized chunks are copied into rbuff using attacker-controlled sector offsets derived from fs->winsect and fp->sect. A crafted FAT32 image can manipulate these fields to cause out-of-bounds writes.

Changes

  • reference/drivers/fat32/source/ff.c

Verification

  • Build passes
  • Scanner re-scan confirms fix
  • LLM code review passed

Automated security fix by OrbisAI Security

Automated security fix generated by Orbis Security AI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant