Bug 2213149 (CVE-2023-31085)

Summary: CVE-2023-31085 kernel: divide-by-zero error in ctrl_cdev_ioctl when do_div happens and erasesize is 0
Product: [Other] Security Response Reporter: Alex <allarkin>
Component: vulnerabilityAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: acaringi, allarkin, bhu, chwhite, crwood, dbohanno, ddepaula, debarbos, dfreiber, dvlasenk, ezulian, hkrzesin, jarod, jburrell, jdenham, jfaracco, jferlan, jforbes, jlelli, joe.lawrence, jshortt, jstancek, jwyatt, kcarcia, kernel-mgr, ldoskova, lgoncalv, lzampier, nmurray, ptalbert, qzhao, rogbas, rrobaina, rvrbovsk, rysulliv, scweaver, steve.beattie, tyberry, vkumar, walters, wcosta, williams, wmealing, ycote
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
A divide-by-zero flaw was found in the Linux kernel’s UBI (a software layer above the MTD layer that admits the use of LVM-like logical volumes on top of MTD devices). This flaw allows a local user to crash the system.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2213150, 2213152, 2213153, 2213154, 2213155    
Bug Blocks: 2189448    

Description Alex 2023-06-07 08:38:14 UTC
A flaw in the Linux Kernel found in drivers/mtd/ubi/cdev.c. There is a divide-by-zero error in do_div(sz,mtd->erasesize), used indirectly by ctrl_cdev_ioctl, when mtd->erasesize is 0.

Reference:
https://lore.kernel.org/all/CA+UBctD_w=75wChmePZHp7KsBSNPWYGDBtzHPRPPtaFoqhGvXA@mail.gmail.com/

Comment 1 Alex 2023-06-07 08:38:40 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 2213150]

Comment 5 Justin M. Forbes 2023-11-08 18:33:41 UTC
This was fixed for Fedora with the 6.5.7 stable kernel updates.