CVE-2024-47680: f2fs: check discard support for conventional zones

Published Oct 21, 2024
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

f2fs: check discard support for conventional zones

As the helper function f2fsbdevsupportdiscard() shows, f2fs checks if the target block devices support discard by calling bdevmaxdiscardsectors() and bdeviszoned(). This check works well for most cases, but it does not work for conventional zones on zoned block devices. F2fs assumes that zoned block devices support discard, and calls submitdiscardcmd(). When submitdiscardcmd() is called for sequential write required zones, it works fine since submitdiscardcmd() issues zone reset commands instead of discard commands. However, when submitdiscardcmd() is called for conventional zones, blkdevissuediscard() is called even when the devices do not support discard.

The inappropriate blkdevissuediscard() call was not a problem before the commit 30f1e7241422 ("block: move discard checks into the ioctl handler") because blkdevissuediscard() checked if the target devices support discard or not. If not, it returned EOPNOTSUPP. After the commit, blkdevissuediscard() no longer checks it. It always returns zero and sets NULL to the given bio pointer. This NULL pointer triggers f2fsbugon() in submitdiscardcmd(). The BUG is recreated with the commands below at the umount step, where /dev/nullb0 is a zoned nullblk with 5GB total size, 128MB zone size and 10 conventional zones.

$ mkfs.f2fs -f -m /dev/nullb0 $ mount /dev/nullb0 /mnt $ for ((i=0;i<5;i++)); do dd if=/dev/zero of=/mnt/test bs=65536 count=1600 conv=fsync; done $ umount /mnt

To fix the BUG, avoid the inappropriate blkdevissuediscard() call. When discard is requested for conventional zones, check if the device supports discard or not. If not, return EOPNOTSUPP.

Other sources

This CVE was automatically created from a reference found in an email or other text. If you are reading this, then this CVE entry is probably erroneous, since this text should be replaced by the official CVE description automatically.

Launchpad

Affected Software

3 affected componentsFixes available
Linux Linux kernel>=6.10<6.10.13
Linux Linux kernel>=6.11<6.11.2
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.22-16.12.25-1

Event History

Oct 21, 2024
CVE Published
via MITRE·11:53 AM
Data Sourced
via MITRE·11:53 AM
Description
Feb 20, 2025
Data Sourced
via Launchpad·12:44 AM
Description
Mar 28, 2025
Data Sourced
via Ubuntu·12:49 AM
RemedyDescriptionSeverityAffected Software
Apr 13, 2025
Data Sourced
via Debian·12:53 AM
DescriptionAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-47680?

The severity of CVE-2024-47680 is currently classified as moderate.

2

How do I fix CVE-2024-47680?

To fix CVE-2024-47680, upgrade the Linux kernel to version 6.10.13 or later, or 6.11.2 or later.

3

What versions of the Linux kernel are affected by CVE-2024-47680?

CVE-2024-47680 affects Linux kernel versions prior to 6.10.13 and 6.11.2.

4

Is CVE-2024-47680 a remote code execution vulnerability?

No, CVE-2024-47680 is not classified as a remote code execution vulnerability.

5

Does CVE-2024-47680 require user interaction to be exploited?

CVE-2024-47680 does not require user interaction for exploitation.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203