In the Linux kernel, the following vulnerability has been resolved:
usb: cdns3 fix use-after-free at workaround 2
BUG: KFENCE: use-after-free read in _listdelentryvalid+0x10/0xac
cdns3wa2removeoldrequest() { ... kfree(privreq->request.buf); cdns3gadgetepfreerequest(&privep->endpoint, &privreq->request); listdelinit(&privreq->list); ^^^ use after free ... }
cdns3gadgetepfreerequest() free the space pointed by privreq, but privreq is used in the following listdelinit().
This patch move listdelinit() before cdns3gadgetepfreerequest().
[
{
"id": "CVE-2022-50034-0887334f",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6fd50446e7c9a98b4bcf96815f5c9602a16ea472",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"length": 450.0,
"function_hash": "65576552425511711327769710929299600083"
},
"target": {
"function": "cdns3_wa2_remove_old_request",
"file": "drivers/usb/cdns3/cdns3-gadget.c"
}
},
{
"id": "CVE-2022-50034-0c8d6215",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7d602f30149a117eea260208b1661bc404c21dfd",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"length": 450.0,
"function_hash": "65576552425511711327769710929299600083"
},
"target": {
"function": "cdns3_wa2_remove_old_request",
"file": "drivers/usb/cdns3/cdns3-gadget.c"
}
},
{
"id": "CVE-2022-50034-219549ac",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c3c1dbad3a2db32ecf371c97f2058491b8ba0f9a",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"length": 450.0,
"function_hash": "65576552425511711327769710929299600083"
},
"target": {
"function": "cdns3_wa2_remove_old_request",
"file": "drivers/usb/cdns3/cdns3-gadget.c"
}
},
{
"id": "CVE-2022-50034-39f29224",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e65d9b7147d7be3504893ca7dfb85286bda83d40",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"length": 450.0,
"function_hash": "65576552425511711327769710929299600083"
},
"target": {
"function": "cdns3_wa2_remove_old_request",
"file": "drivers/usb/cdns3/gadget.c"
}
},
{
"id": "CVE-2022-50034-604d1e40",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c3c1dbad3a2db32ecf371c97f2058491b8ba0f9a",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"160290003952394112814719453668655024115",
"66473511173810453140783186416275078033",
"83973214398140824027494940829142526769",
"312610791760989958645842040193266986363",
"253016916261995485907959310160419227552",
"158795668781523660064941314030048208177",
"226479132396547425721334130105638659778"
]
},
"target": {
"file": "drivers/usb/cdns3/cdns3-gadget.c"
}
},
{
"id": "CVE-2022-50034-68119ef2",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6d7ac60098b206d0472475b666cb09d556bec03d",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"length": 450.0,
"function_hash": "65576552425511711327769710929299600083"
},
"target": {
"function": "cdns3_wa2_remove_old_request",
"file": "drivers/usb/cdns3/gadget.c"
}
},
{
"id": "CVE-2022-50034-734aa180",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e65d9b7147d7be3504893ca7dfb85286bda83d40",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"160290003952394112814719453668655024115",
"66473511173810453140783186416275078033",
"83973214398140824027494940829142526769",
"312610791760989958645842040193266986363",
"253016916261995485907959310160419227552",
"158795668781523660064941314030048208177",
"226479132396547425721334130105638659778"
]
},
"target": {
"file": "drivers/usb/cdns3/gadget.c"
}
},
{
"id": "CVE-2022-50034-9b10b191",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6fd50446e7c9a98b4bcf96815f5c9602a16ea472",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"160290003952394112814719453668655024115",
"66473511173810453140783186416275078033",
"83973214398140824027494940829142526769",
"312610791760989958645842040193266986363",
"253016916261995485907959310160419227552",
"158795668781523660064941314030048208177",
"226479132396547425721334130105638659778"
]
},
"target": {
"file": "drivers/usb/cdns3/cdns3-gadget.c"
}
},
{
"id": "CVE-2022-50034-bec4298c",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6d7ac60098b206d0472475b666cb09d556bec03d",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"160290003952394112814719453668655024115",
"66473511173810453140783186416275078033",
"83973214398140824027494940829142526769",
"312610791760989958645842040193266986363",
"253016916261995485907959310160419227552",
"158795668781523660064941314030048208177",
"226479132396547425721334130105638659778"
]
},
"target": {
"file": "drivers/usb/cdns3/gadget.c"
}
},
{
"id": "CVE-2022-50034-ef08f23e",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7d602f30149a117eea260208b1661bc404c21dfd",
"deprecated": false,
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"160290003952394112814719453668655024115",
"66473511173810453140783186416275078033",
"83973214398140824027494940829142526769",
"312610791760989958645842040193266986363",
"253016916261995485907959310160419227552",
"158795668781523660064941314030048208177",
"226479132396547425721334130105638659778"
]
},
"target": {
"file": "drivers/usb/cdns3/cdns3-gadget.c"
}
}
]