In the Linux kernel, the following vulnerability has been resolved:
scsi: ses: Handle enclosure with just a primary component gracefully
This reverts commit 3fe97ff3d949 ("scsi: ses: Don't attach if enclosure has no components") and introduces proper handling of case where there are no detected secondary components, but primary component (enumerated in num_enclosures) does exist. That fix was originally proposed by Ding Hui dinghui@sangfor.com.cn.
Completely ignoring devices that have one primary enclosure and no secondary one results in sesintfadd() bailing completely
scsi 2:0:0:254: enclosure has no enumerated components
scsi 2:0:0:254: Failed to bind enclosure -12ven in valid configurations such
even on valid configurations with 1 primary and 0 secondary enclosures as below:
# sg_ses /dev/sg0
3PARdata SES 3321
Supported diagnostic pages:
Supported Diagnostic Pages [sdp] [0x0]
Configuration (SES) [cf] [0x1]
Short Enclosure Status (SES) [ses] [0x8]
# sg_ses -p cf /dev/sg0
3PARdata SES 3321
Configuration diagnostic page:
number of secondary subenclosures: 0
generation code: 0x0
enclosure descriptor list
Subenclosure identifier: 0 [primary]
relative ES process id: 0, number of ES processes: 1
number of type descriptor headers: 1
enclosure logical identifier (hex): 20000002ac02068d
enclosure vendor: 3PARdata product: VV rev: 3321
type descriptor header and text list
Element type: Unspecified, subenclosure id: 0
number of possible elements: 1
The changelog for the original fix follows
===== We can get a crash when disconnecting the iSCSI session, the call trace like this:
[ffff00002a00fb70] kfree at ffff00000830e224 [ffff00002a00fba0] sesintfremove at ffff000001f200e4 [ffff00002a00fbd0] devicedel at ffff0000086b6a98 [ffff00002a00fc50] deviceunregister at ffff0000086b6d58 [ffff00002a00fc70] _scsiremovedevice at ffff00000870608c [ffff00002a00fca0] scsiremovedevice at ffff000008706134 [ffff00002a00fcc0] _scsiremovetarget at ffff0000087062e4 [ffff00002a00fd10] scsiremovetarget at ffff0000087064c0 [ffff00002a00fd70] _iscsiunbindsession at ffff000001c872c4 [ffff00002a00fdb0] processonework at ffff00000810f35c [ffff00002a00fe00] workerthread at ffff00000810f648 [ffff00002a00fe70] kthread at ffff000008116e98
In sesintfadd, components count could be 0, and kcalloc 0 size scomp, but not saved in edev->component[i].scratch
In this situation, edev->component[0].scratch is an invalid pointer, when kfree it in sesintfremove_enclosure, a crash like above would happen The call trace also could be other random cases when kfree cannot catch the invalid pointer
We should not use edev->component[] array when the components count is 0 We also need check index when use edev->component[] array in
[
{
"deprecated": false,
"id": "CVE-2023-53431-0601d24e",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f8e702c54413eee2d8f94f61d18adadac7c87e87",
"digest": {
"threshold": 0.9,
"line_hashes": [
"146506755786577890309609722453862618897",
"16662462923749882796966257146337231425",
"180276574333526250678629905488965660463",
"209969120906618850144167596733450882724",
"54363067085962535298507951164351833607",
"154464928779179317884688350798007713527",
"207012821765638331364782586804229023926",
"210979110534702820020805172847198362480",
"19550728953343585350015452085182356291",
"55533647037026783177079305305764677946",
"75575708390743156713572586131408323114",
"293479974009475256923002050968079982485",
"54659592787677361921624232324208861250",
"300480571697116795278969530848442906474",
"203605734836501431145225018733732595871",
"155035170411075406310907703864487270667",
"277139767449894871066961355904022382723",
"291592702545772856830330348571582557753",
"320705084923970348378292645197907259283",
"237017236771850066154038112410781761641",
"299652965569989948160976142338940007244",
"60935394278527455487689024879657975541",
"123020265966757333357961338565747092129"
]
},
"target": {
"file": "drivers/scsi/ses.c"
},
"signature_type": "Line",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-0991e874",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4e7c498c3713b09bef20c76c7319555637e8bbd5",
"digest": {
"function_hash": "138719367067689831574285434407521605269",
"length": 2202.0
},
"target": {
"function": "ses_enclosure_data_process",
"file": "drivers/scsi/ses.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-0f609fb4",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@110d425cdfb15006f3c4fde5264e786a247b6b36",
"digest": {
"function_hash": "100011937592224116663409578810552782466",
"length": 431.0
},
"target": {
"function": "ses_enclosure_find_by_addr",
"file": "drivers/scsi/ses.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-1073b572",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f8e702c54413eee2d8f94f61d18adadac7c87e87",
"digest": {
"function_hash": "100011937592224116663409578810552782466",
"length": 431.0
},
"target": {
"function": "ses_enclosure_find_by_addr",
"file": "drivers/scsi/ses.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-115507ec",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@05143d90ac90b7abc6692285895a1ef460e008ee",
"digest": {
"threshold": 0.9,
"line_hashes": [
"146506755786577890309609722453862618897",
"16662462923749882796966257146337231425",
"180276574333526250678629905488965660463",
"209969120906618850144167596733450882724",
"54363067085962535298507951164351833607",
"154464928779179317884688350798007713527",
"207012821765638331364782586804229023926",
"210979110534702820020805172847198362480",
"19550728953343585350015452085182356291",
"55533647037026783177079305305764677946",
"75575708390743156713572586131408323114",
"293479974009475256923002050968079982485",
"54659592787677361921624232324208861250",
"300480571697116795278969530848442906474",
"203605734836501431145225018733732595871",
"155035170411075406310907703864487270667",
"277139767449894871066961355904022382723",
"291592702545772856830330348571582557753",
"320705084923970348378292645197907259283",
"237017236771850066154038112410781761641",
"299652965569989948160976142338940007244",
"60935394278527455487689024879657975541",
"123020265966757333357961338565747092129"
]
},
"target": {
"file": "drivers/scsi/ses.c"
},
"signature_type": "Line",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-17747c32",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c8e22b7a1694bb8d025ea636816472739d859145",
"digest": {
"function_hash": "174560300042451857598912742251192904951",
"length": 3215.0
},
"target": {
"function": "ses_intf_add",
"file": "drivers/scsi/ses.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-1a5089bc",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@05143d90ac90b7abc6692285895a1ef460e008ee",
"digest": {
"function_hash": "100011937592224116663409578810552782466",
"length": 431.0
},
"target": {
"function": "ses_enclosure_find_by_addr",
"file": "drivers/scsi/ses.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-1bc00fd6",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c8e22b7a1694bb8d025ea636816472739d859145",
"digest": {
"threshold": 0.9,
"line_hashes": [
"146506755786577890309609722453862618897",
"16662462923749882796966257146337231425",
"180276574333526250678629905488965660463",
"209969120906618850144167596733450882724",
"54363067085962535298507951164351833607",
"154464928779179317884688350798007713527",
"207012821765638331364782586804229023926",
"210979110534702820020805172847198362480",
"19550728953343585350015452085182356291",
"55533647037026783177079305305764677946",
"75575708390743156713572586131408323114",
"293479974009475256923002050968079982485",
"54659592787677361921624232324208861250",
"300480571697116795278969530848442906474",
"203605734836501431145225018733732595871",
"155035170411075406310907703864487270667",
"277139767449894871066961355904022382723",
"291592702545772856830330348571582557753",
"320705084923970348378292645197907259283",
"237017236771850066154038112410781761641",
"299652965569989948160976142338940007244",
"60935394278527455487689024879657975541",
"123020265966757333357961338565747092129"
]
},
"target": {
"file": "drivers/scsi/ses.c"
},
"signature_type": "Line",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-21d8be87",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@176d7345b89ced72020a313bfa4e7f345d1c3aed",
"digest": {
"function_hash": "174560300042451857598912742251192904951",
"length": 3215.0
},
"target": {
"function": "ses_intf_add",
"file": "drivers/scsi/ses.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-24676c78",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c8e22b7a1694bb8d025ea636816472739d859145",
"digest": {
"function_hash": "100011937592224116663409578810552782466",
"length": 431.0
},
"target": {
"function": "ses_enclosure_find_by_addr",
"file": "drivers/scsi/ses.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-332e0bce",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f8e702c54413eee2d8f94f61d18adadac7c87e87",
"digest": {
"function_hash": "138719367067689831574285434407521605269",
"length": 2202.0
},
"target": {
"function": "ses_enclosure_data_process",
"file": "drivers/scsi/ses.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-3411994a",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@176d7345b89ced72020a313bfa4e7f345d1c3aed",
"digest": {
"function_hash": "138719367067689831574285434407521605269",
"length": 2202.0
},
"target": {
"function": "ses_enclosure_data_process",
"file": "drivers/scsi/ses.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-35dffc0f",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@176d7345b89ced72020a313bfa4e7f345d1c3aed",
"digest": {
"function_hash": "100011937592224116663409578810552782466",
"length": 431.0
},
"target": {
"function": "ses_enclosure_find_by_addr",
"file": "drivers/scsi/ses.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-5aa88bfd",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@05143d90ac90b7abc6692285895a1ef460e008ee",
"digest": {
"function_hash": "174560300042451857598912742251192904951",
"length": 3215.0
},
"target": {
"function": "ses_intf_add",
"file": "drivers/scsi/ses.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-5b675b2e",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@eabc4872f172ecb8dd8536bc366a51868154a450",
"digest": {
"function_hash": "100011937592224116663409578810552782466",
"length": 431.0
},
"target": {
"function": "ses_enclosure_find_by_addr",
"file": "drivers/scsi/ses.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-6417426b",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@110d425cdfb15006f3c4fde5264e786a247b6b36",
"digest": {
"function_hash": "138719367067689831574285434407521605269",
"length": 2202.0
},
"target": {
"function": "ses_enclosure_data_process",
"file": "drivers/scsi/ses.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-72e204da",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@110d425cdfb15006f3c4fde5264e786a247b6b36",
"digest": {
"threshold": 0.9,
"line_hashes": [
"146506755786577890309609722453862618897",
"16662462923749882796966257146337231425",
"180276574333526250678629905488965660463",
"209969120906618850144167596733450882724",
"54363067085962535298507951164351833607",
"154464928779179317884688350798007713527",
"207012821765638331364782586804229023926",
"210979110534702820020805172847198362480",
"19550728953343585350015452085182356291",
"55533647037026783177079305305764677946",
"75575708390743156713572586131408323114",
"293479974009475256923002050968079982485",
"54659592787677361921624232324208861250",
"300480571697116795278969530848442906474",
"203605734836501431145225018733732595871",
"155035170411075406310907703864487270667",
"277139767449894871066961355904022382723",
"291592702545772856830330348571582557753",
"320705084923970348378292645197907259283",
"237017236771850066154038112410781761641",
"299652965569989948160976142338940007244",
"60935394278527455487689024879657975541",
"123020265966757333357961338565747092129"
]
},
"target": {
"file": "drivers/scsi/ses.c"
},
"signature_type": "Line",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-748d6640",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4e7c498c3713b09bef20c76c7319555637e8bbd5",
"digest": {
"function_hash": "100011937592224116663409578810552782466",
"length": 431.0
},
"target": {
"function": "ses_enclosure_find_by_addr",
"file": "drivers/scsi/ses.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-7734d19b",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c8e22b7a1694bb8d025ea636816472739d859145",
"digest": {
"function_hash": "138719367067689831574285434407521605269",
"length": 2202.0
},
"target": {
"function": "ses_enclosure_data_process",
"file": "drivers/scsi/ses.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-82f03e27",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@05143d90ac90b7abc6692285895a1ef460e008ee",
"digest": {
"function_hash": "138719367067689831574285434407521605269",
"length": 2202.0
},
"target": {
"function": "ses_enclosure_data_process",
"file": "drivers/scsi/ses.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-9327415c",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@110d425cdfb15006f3c4fde5264e786a247b6b36",
"digest": {
"function_hash": "174560300042451857598912742251192904951",
"length": 3215.0
},
"target": {
"function": "ses_intf_add",
"file": "drivers/scsi/ses.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-b855e2c3",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@eabc4872f172ecb8dd8536bc366a51868154a450",
"digest": {
"function_hash": "138719367067689831574285434407521605269",
"length": 2202.0
},
"target": {
"function": "ses_enclosure_data_process",
"file": "drivers/scsi/ses.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-b9fdb400",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4e7c498c3713b09bef20c76c7319555637e8bbd5",
"digest": {
"function_hash": "174560300042451857598912742251192904951",
"length": 3215.0
},
"target": {
"function": "ses_intf_add",
"file": "drivers/scsi/ses.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-bdadd22b",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@176d7345b89ced72020a313bfa4e7f345d1c3aed",
"digest": {
"threshold": 0.9,
"line_hashes": [
"146506755786577890309609722453862618897",
"16662462923749882796966257146337231425",
"180276574333526250678629905488965660463",
"209969120906618850144167596733450882724",
"54363067085962535298507951164351833607",
"154464928779179317884688350798007713527",
"207012821765638331364782586804229023926",
"210979110534702820020805172847198362480",
"19550728953343585350015452085182356291",
"55533647037026783177079305305764677946",
"75575708390743156713572586131408323114",
"293479974009475256923002050968079982485",
"54659592787677361921624232324208861250",
"300480571697116795278969530848442906474",
"203605734836501431145225018733732595871",
"155035170411075406310907703864487270667",
"277139767449894871066961355904022382723",
"291592702545772856830330348571582557753",
"320705084923970348378292645197907259283",
"237017236771850066154038112410781761641",
"299652965569989948160976142338940007244",
"60935394278527455487689024879657975541",
"123020265966757333357961338565747092129"
]
},
"target": {
"file": "drivers/scsi/ses.c"
},
"signature_type": "Line",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-e9ee80aa",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4e7c498c3713b09bef20c76c7319555637e8bbd5",
"digest": {
"threshold": 0.9,
"line_hashes": [
"146506755786577890309609722453862618897",
"16662462923749882796966257146337231425",
"180276574333526250678629905488965660463",
"209969120906618850144167596733450882724",
"54363067085962535298507951164351833607",
"154464928779179317884688350798007713527",
"207012821765638331364782586804229023926",
"210979110534702820020805172847198362480",
"19550728953343585350015452085182356291",
"55533647037026783177079305305764677946",
"75575708390743156713572586131408323114",
"293479974009475256923002050968079982485",
"54659592787677361921624232324208861250",
"300480571697116795278969530848442906474",
"203605734836501431145225018733732595871",
"155035170411075406310907703864487270667",
"277139767449894871066961355904022382723",
"291592702545772856830330348571582557753",
"320705084923970348378292645197907259283",
"237017236771850066154038112410781761641",
"299652965569989948160976142338940007244",
"60935394278527455487689024879657975541",
"123020265966757333357961338565747092129"
]
},
"target": {
"file": "drivers/scsi/ses.c"
},
"signature_type": "Line",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-fb54c88a",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@eabc4872f172ecb8dd8536bc366a51868154a450",
"digest": {
"threshold": 0.9,
"line_hashes": [
"146506755786577890309609722453862618897",
"16662462923749882796966257146337231425",
"180276574333526250678629905488965660463",
"209969120906618850144167596733450882724",
"54363067085962535298507951164351833607",
"154464928779179317884688350798007713527",
"207012821765638331364782586804229023926",
"210979110534702820020805172847198362480",
"19550728953343585350015452085182356291",
"55533647037026783177079305305764677946",
"75575708390743156713572586131408323114",
"293479974009475256923002050968079982485",
"54659592787677361921624232324208861250",
"300480571697116795278969530848442906474",
"203605734836501431145225018733732595871",
"155035170411075406310907703864487270667",
"277139767449894871066961355904022382723",
"291592702545772856830330348571582557753",
"320705084923970348378292645197907259283",
"237017236771850066154038112410781761641",
"299652965569989948160976142338940007244",
"60935394278527455487689024879657975541",
"123020265966757333357961338565747092129"
]
},
"target": {
"file": "drivers/scsi/ses.c"
},
"signature_type": "Line",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-fe9d8860",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f8e702c54413eee2d8f94f61d18adadac7c87e87",
"digest": {
"function_hash": "174560300042451857598912742251192904951",
"length": 3215.0
},
"target": {
"function": "ses_intf_add",
"file": "drivers/scsi/ses.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2023-53431-ffe7d86c",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@eabc4872f172ecb8dd8536bc366a51868154a450",
"digest": {
"function_hash": "174560300042451857598912742251192904951",
"length": 3215.0
},
"target": {
"function": "ses_intf_add",
"file": "drivers/scsi/ses.c"
},
"signature_type": "Function",
"signature_version": "v1"
}
]