Bug 2265800 (CVE-2023-52464)

Summary: CVE-2023-52464 kernel: EDAC/thunderx: Incorrect buffer size in drivers/edac/thunderx_edac.c
Product: [Other] Security Response Reporter: Patrick Del Bello <pdelbell>
Component: vulnerabilityAssignee: Product Security <prodsec-ir-bot>
Status: NEW --- QA Contact:
Severity: low Docs Contact:
Priority: low    
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, kgrant, 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. An improper buffer size is provided to the strncat function, which may result in an out-of-bounds write, leading to memory corruption or 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: 2265812    
Bug Blocks: 2265790    

Description Patrick Del Bello 2024-02-24 11:20:30 UTC
Enabling -Wstringop-overflow globally exposes a warning for a common bug
in the usage of strncat():

  drivers/edac/thunderx_edac.c: In function 'thunderx_ocx_com_threaded_isr':
  drivers/edac/thunderx_edac.c:1136:17: error: 'strncat' specified bound 1024 equals destination size [-Werror=stringop-overflow=]
   1136 |                 strncat(msg, other, OCX_MESSAGE_SIZE);
        |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ...
   1145 |                                 strncat(msg, other, OCX_MESSAGE_SIZE);
   ...
   1150 |                                 strncat(msg, other, OCX_MESSAGE_SIZE);

   ...

Apparently the author of this driver expected strncat() to behave the
way that strlcat() does, which uses the size of the destination buffer
as its third argument rather than the length of the source buffer. The
result is that there is no check on the size of the allocated buffer.

Change it to strlcat().

  [ bp: Trim compiler output, fixup commit message. ]

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

Affects: fedora-all [bug 2265812]

Comment 3 Justin M. Forbes 2024-02-27 00:00:28 UTC
https://lore.kernel.org/linux-cve-announce/2024022336-CVE-2023-52464-b17c@gregkh/T/#u

	Issue introduced in 4.12 with commit 41003396f932 and fixed in 4.19.306 with commit 71c17ee02538
	Issue introduced in 4.12 with commit 41003396f932 and fixed in 5.4.268 with commit 5da3b6e7196f
	Issue introduced in 4.12 with commit 41003396f932 and fixed in 5.10.209 with commit 6aa7865ba7ff
	Issue introduced in 4.12 with commit 41003396f932 and fixed in 5.15.148 with commit 700cf4bead80
	Issue introduced in 4.12 with commit 41003396f932 and fixed in 6.1.75 with commit 9dbac9fdae6e
	Issue introduced in 4.12 with commit 41003396f932 and fixed in 6.6.14 with commit e1c865112415
	Issue introduced in 4.12 with commit 41003396f932 and fixed in 6.7.2 with commit 426fae93c01d
	Issue introduced in 4.12 with commit 41003396f932 and fixed in 6.8-rc1 with commit 475c58e1a471

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

Comment 11 Alex 2024-06-09 16:23:30 UTC
The result of automatic check (that is developed by Alexander Larkin) for this CVE-2023-52464 is: CHECK	Maybe valid. Check manually. with impact LOW (that is an approximation based on flags WRITE OOB WARNONLY IMPROVEONLY  ; these flags parsed automatically based on patch data). Such automatic check happens only for Low/Moderates (and only when not from reporter, but parsing already existing CVE). Highs always checked manually (I check it myself and then we check it again in Remediation team). In rare cases some of the Moderates could be increased to High later.

Comment 15 errata-xmlrpc 2024-07-02 08:53:58 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2024:4211 https://access.redhat.com/errata/RHSA-2024:4211

Comment 16 errata-xmlrpc 2024-07-08 02:01:51 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2024:4352 https://access.redhat.com/errata/RHSA-2024:4352

Comment 17 errata-xmlrpc 2024-11-12 09:18:41 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2024:9315 https://access.redhat.com/errata/RHSA-2024:9315