Bug 2265794 (CVE-2023-52458)

Summary: CVE-2023-52458 kernel: block: null pointer dereference in ioctl.c when length and logical block size are misaligned
Product: [Other] Security Response Reporter: Patrick Del Bello <pdelbell>
Component: vulnerabilityAssignee: Product Security <prodsec-ir-bot>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: acaringi, allarkin, aquini, bhu, chwhite, cye, cyin, dbohanno, debarbos, dfreiber, drow, dvlasenk, esandeen, ezulian, hkrzesin, jarod, jburrell, jdenham, jfaracco, jforbes, jlelli, joe.lawrence, jshortt, jstancek, jwyatt, kcarcia, kyoshida, ldoskova, lgoncalv, lzampier, mleitner, mmilgram, mstowell, nmurray, ptalbert, rparrazo, rrobaina, rvrbovsk, rysulliv, scweaver, sukulkar, tglozar, tyberry, vkumar, wcosta, williams, wmealing, ycote, ykopkova, zhijwang
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: kernel 6.8-rc1 Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the Linux kernel's block subsystem, where a NULL pointer dereference occurs if partitions are created or resized with a size that is not a multiple of the logical block size. This flaw allows a privileged attacker to cause a denial of service.
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: 2265806    
Bug Blocks: 2265790    

Description Patrick Del Bello 2024-02-24 11:20:03 UTC
Before calling add partition or resize partition, there is no check on whether the length is aligned with the logical block size.
If the logical block size of the disk is larger than 512 bytes, then the partition size maybe not the multiple of the logical block size, and when the last sector is read, bio_truncate() will adjust the bio size, resulting in an IO error if the size of the read command is smaller than
the logical block size.If integrity data is supported, this will also result in a null pointer dereference when calling bio_integrity_free.

Comment 1 Patrick Del Bello 2024-02-24 11:25:03 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 2265806]

Comment 3 Justin M. Forbes 2024-02-27 00:17:23 UTC
	Fixed in 5.15.148 with commit 5010c2712096
	Fixed in 6.1.75 with commit ef31cc877947
	Fixed in 6.6.14 with commit cb16cc1abda1
	Fixed in 6.7.2 with commit bcdc288e7bc0
	Fixed in 6.8-rc1 with commit 6f64f866aa1a

Comment 4 Justin M. Forbes 2024-02-27 00:17:55 UTC
This was fixed for Fedora with the 6.6.14 stable kernel updates.