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

Merged
merged 1 commit into from
Jan 23, 2025

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
@nashif nashif merged commit 78f87d5 into v3.7-branch Jan 23, 2025
28 of 29 checks passed
@nashif nashif deleted the backport-83572-to-v3.7-branch branch January 23, 2025 23:48
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: Done
Development

Successfully merging this pull request may close these issues.

4 participants