Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport v3.7-branch] fs: ext2: Fix nbytes_to_read calculation in ext2_inode_read() #84011

Open
wants to merge 1 commit into
base: v3.7-branch
Choose a base branch
from

Conversation

zephyrbot
Copy link
Collaborator

@zephyrbot zephyrbot commented Jan 15, 2025

Backport 5a5f05b from #83572.

Fixes #83625

Fix incorrect nbytes_to_read calculation in ext2_inode_read() function.
Previously nbytes_to_read was decremented by read value which caused
incorrect calculation of bytes to read in subsequent iterations.
Now nbytes_to_read is decremented by to_read value which represents
the actual number of bytes read in current iteration.

This fixes potential data corruption issues when reading files from
ext2 filesystem.

Signed-off-by: Chen Shu <[email protected]>
(cherry picked from commit 5a5f05b)
@zephyrbot zephyrbot added Backport Backport PR and backport failure issues area: File System size: XS A PR changing only a single line of code labels Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: File System Backport Backport PR and backport failure issues size: XS A PR changing only a single line of code
Projects
Status: To do
Development

Successfully merging this pull request may close these issues.

3 participants