Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 2236639 - EROFS doesn't zero mmap post-EOF tails on some files
Summary: EROFS doesn't zero mmap post-EOF tails on some files
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 37
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-09-01 04:18 UTC by Alexander Maltsev
Modified: 2023-09-13 01:35 UTC (History)
17 users (show)

Fixed In Version: kernel-6.4.14-200.fc38
Doc Type: ---
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-09-07 01:29:10 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Alexander Maltsev 2023-09-01 04:18:08 UTC
There is a problem in kernel EROFS file system driver that causes wrong behaviour of mmap() on some files. It causes a crash in clang if system header files are stored in EROFS. Other software could be affected as mmap() is used extensively.

It is reproducible vith e.g. paching entire root file systemt o EROFS image with `lz4hc` compression option (the problem is not in compression itself; different compression option will trigger it on different files), mounting this image to subdirectory, and running `clang-cpp mountpoint/usr/include/stdlib.h`; clang-cpp produces some garbage output and crashes.

There are no EROFS-related messages in dmesg.

It affects any kernel up to (and including) 6.5. It should be fixed in 6.6 with this commit: https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git/commit/?id=e4c1cf523d820730a86cae2c6d55924833b6f7ac

It could be fixed in older kernels with this patch: https://lore.kernel.org/linux-erofs/20230831112959.99884-5-hsiangkao@linux.alibaba.com/T/

Could this fix be included in fc37 and rawhide please?

Reproducible: Always

Comment 1 Fedora Update System 2023-09-02 23:20:48 UTC
FEDORA-2023-eadae36e49 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-eadae36e49

Comment 2 Fedora Update System 2023-09-02 23:20:49 UTC
FEDORA-2023-f1812ce4c3 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-f1812ce4c3

Comment 3 Fedora Update System 2023-09-03 01:33:21 UTC
FEDORA-2023-eadae36e49 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-eadae36e49`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-eadae36e49

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2023-09-03 02:23:00 UTC
FEDORA-2023-f1812ce4c3 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-f1812ce4c3`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-f1812ce4c3

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Gao Xiang 2023-09-04 05:20:20 UTC
yes, but it only impacts compressed files and will be fixed in all stable/LTS kernels.

Comment 6 Fedora Update System 2023-09-07 01:29:10 UTC
FEDORA-2023-f1812ce4c3 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 7 Fedora Update System 2023-09-08 01:33:14 UTC
FEDORA-2023-4d7e9e1dc5 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-4d7e9e1dc5`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-4d7e9e1dc5

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2023-09-13 01:35:28 UTC
FEDORA-2023-4d7e9e1dc5 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.