Bug 2271461 (CVE-2021-47178)

Summary: CVE-2021-47178 kernel: scsi: target: core: Avoid smp_processor_id() in preemptible code
Product: [Other] Security Response Reporter: Mauro Matteo Cascella <mcascell>
Component: vulnerabilityAssignee: Product Security <prodsec-ir-bot>
Status: NEW --- QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: acaringi, allarkin, aquini, bhu, chwhite, dbohanno, debarbos, dfreiber, drow, dvlasenk, esandeen, ezulian, hkrzesin, jarod, jburrell, jfaracco, jlelli, joe.lawrence, jshortt, jstancek, jwyatt, ldoskova, lgoncalv, mleitner, mmilgram, mstowell, nmurray, ptalbert, rhel-process-autobot, rparrazo, rrobaina, rvrbovsk, scweaver, sidakwo, sukulkar, tglozar, vkumar, watson-tool-maintainers, wcosta, williams, wmealing, ycote, ykopkova
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: kernel 5.12.9, kernel 5.13 Doc Type: If docs needed, set a value
Doc Text:
This linux kernel vulnerability occurs in the SCSI target core subsystem, specifically concerning how CPU IDs are handled for TCMU (Target Core Module in Userspace) devices. The issue arises because the kernel previously used the smp_processor_id() function within preemptible code during abort handling in the SCSI host work queue. This unsafe operation triggers a kernel BUG message and potential system instability when thread migrations occur, particularly noticeable when the DEBUG_PREEMPT configuration is enabled. Patched kernel versions resolve the vulnerability by replacing this check with raw_smp_processor_id(), allowing the system to safely retrieve the CPU ID for performance optimizations without violating preemptible code constraints.
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:    
Bug Blocks: 2271579    

Description Mauro Matteo Cascella 2024-03-25 17:30:45 UTC
In the Linux kernel, the following vulnerability has been resolved:

scsi: target: core: Avoid smp_processor_id() in preemptible code

The Linux kernel CVE team has assigned CVE-2021-47178 to this issue.

Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2024032538-CVE-2021-47178-6167@gregkh/T

Comment 2 Alex 2024-06-09 17:01:36 UTC
The result of automatic check (that is developed by Alexander Larkin) for this CVE-2021-47178 is: CHECK	Maybe valid. Check manually. with impact LOW (that is an approximation based on flags DANGER INIT 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.