Skip to content

fix: the kcalloc() and kmalloc() calls at cache in cache.c#3588

Open
orbisai0security wants to merge 1 commit into
ventoy:masterfrom
orbisai0security:fix-v-004-squashfs-cache-integer-overflow
Open

fix: the kcalloc() and kmalloc() calls at cache in cache.c#3588
orbisai0security wants to merge 1 commit into
ventoy:masterfrom
orbisai0security:fix-v-004-squashfs-cache-integer-overflow

Conversation

@orbisai0security

Copy link
Copy Markdown

Summary

Fix critical severity security issue in SQUASHFS/squashfs-tools-4.4/kernel/kernel-2.6/fs/squashfs/cache.c.

Vulnerability

Field Value
ID V-004
Severity CRITICAL
Scanner multi_agent_ai
Rule V-004
File SQUASHFS/squashfs-tools-4.4/kernel/kernel-2.6/fs/squashfs/cache.c:244

Description: The kcalloc() and kmalloc() calls at cache.c lines 244, 266, 273, and 402 use entries and pages values derived directly from the SquashFS image superblock without validating them against architecture-defined maximums. On 32-bit systems, if an attacker crafts an image with an extremely large entries value (e.g., 0x40000001 where sizeof(*cache->entry) = 8), the multiplication entries * sizeof(*(cache->entry)) overflows size_t, resulting in a tiny allocation (e.g., 8 bytes). Subsequent writes to cache->entry[i] for any index i > 0 overflow the undersized buffer, corrupting heap memory.

Changes

  • SQUASHFS/squashfs-tools-4.4/kernel/kernel-2.6/fs/squashfs/cache.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