In the Linux kernel, the following vulnerability has been resolved:
kobject: Add sanity check for kset->kobj.ktype in kset_register()
When I register a kset in the following way: static struct kset mykset; kobjectsetname(&mykset.kobj, "mykset"); ret = ksetregister(&my_kset);
A null pointer dereference exception is occurred: [ 4453.568337] Unable to handle kernel NULL pointer dereference at \ virtual address 0000000000000028 ... ... [ 4453.810361] Call trace: [ 4453.813062] kobjectgetownership+0xc/0x34 [ 4453.817493] kobjectaddinternal+0x98/0x274 [ 4453.822005] ksetregister+0x5c/0xb4 [ 4453.825820] mykobjinit+0x44/0x1000 [mykset] ... ...
Because I didn't initialize my_kset.kobj.ktype.
According to the description in Documentation/core-api/kobject.rst: - A ktype is the type of object that embeds a kobject. Every structure that embeds a kobject needs a corresponding ktype.
So add sanity check to make sure kset->kobj.ktype is not NULL.
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/53xxx/CVE-2023-53480.json",
"cna_assigner": "Linux"
}"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2023-53480.json"
[
{
"id": "CVE-2023-53480-128cc7e7",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@48aebbe801e78a8932404c122ed0e880ccedc220",
"target": {
"file": "lib/kobject.c",
"function": "kset_register"
},
"digest": {
"function_hash": "241647986973307127317481318943340352356",
"length": 216.0
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function"
},
{
"id": "CVE-2023-53480-24d2c469",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4d0fe8c52bb3029d83e323c961221156ab98680b",
"target": {
"file": "lib/kobject.c",
"function": "kset_register"
},
"digest": {
"function_hash": "338683003538531887206797526061043181557",
"length": 286.0
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function"
},
{
"id": "CVE-2023-53480-2bb89940",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1a772881bc059c596d8ca587cbd2a233edce3d3b",
"target": {
"file": "lib/kobject.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"32419423070966835034438206475977501051",
"282380616988388750652785291206202766877",
"257551875617633142537223159764630166054"
]
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"id": "CVE-2023-53480-3debe0b7",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@964e025ceefdf75da46b0133d0c2790de451aeec",
"target": {
"file": "lib/kobject.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"32419423070966835034438206475977501051",
"282380616988388750652785291206202766877",
"104289278148583297492590118454089974477"
]
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"id": "CVE-2023-53480-435717e3",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@039ec9db2d30032eafa365f5f89b30eca5322b05",
"target": {
"file": "lib/kobject.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"32419423070966835034438206475977501051",
"282380616988388750652785291206202766877",
"104289278148583297492590118454089974477"
]
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"id": "CVE-2023-53480-58ac136e",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@48aebbe801e78a8932404c122ed0e880ccedc220",
"target": {
"file": "lib/kobject.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"32419423070966835034438206475977501051",
"282380616988388750652785291206202766877",
"104289278148583297492590118454089974477"
]
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"id": "CVE-2023-53480-5fc3476e",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5df5829158513134ddcaf2184d9286eda7b0bb18",
"target": {
"file": "lib/kobject.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"32419423070966835034438206475977501051",
"282380616988388750652785291206202766877",
"104289278148583297492590118454089974477"
]
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"id": "CVE-2023-53480-605118b5",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5df5829158513134ddcaf2184d9286eda7b0bb18",
"target": {
"file": "lib/kobject.c",
"function": "kset_register"
},
"digest": {
"function_hash": "241647986973307127317481318943340352356",
"length": 216.0
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function"
},
{
"id": "CVE-2023-53480-619429c5",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@964e025ceefdf75da46b0133d0c2790de451aeec",
"target": {
"file": "lib/kobject.c",
"function": "kset_register"
},
"digest": {
"function_hash": "241647986973307127317481318943340352356",
"length": 216.0
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function"
},
{
"id": "CVE-2023-53480-61ae6752",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f3f6bf22a4f5ba649cf26ae4670de5c7f861bdef",
"target": {
"file": "lib/kobject.c",
"function": "kset_register"
},
"digest": {
"function_hash": "241647986973307127317481318943340352356",
"length": 216.0
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function"
},
{
"id": "CVE-2023-53480-65546209",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1a772881bc059c596d8ca587cbd2a233edce3d3b",
"target": {
"file": "lib/kobject.c",
"function": "kset_register"
},
"digest": {
"function_hash": "338683003538531887206797526061043181557",
"length": 286.0
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function"
},
{
"id": "CVE-2023-53480-82f2ae0a",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f3f6bf22a4f5ba649cf26ae4670de5c7f861bdef",
"target": {
"file": "lib/kobject.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"32419423070966835034438206475977501051",
"282380616988388750652785291206202766877",
"104289278148583297492590118454089974477"
]
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"id": "CVE-2023-53480-910b7b04",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4d0fe8c52bb3029d83e323c961221156ab98680b",
"target": {
"file": "lib/kobject.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"32419423070966835034438206475977501051",
"282380616988388750652785291206202766877",
"257551875617633142537223159764630166054"
]
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"id": "CVE-2023-53480-a5039426",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@039ec9db2d30032eafa365f5f89b30eca5322b05",
"target": {
"file": "lib/kobject.c",
"function": "kset_register"
},
"digest": {
"function_hash": "241647986973307127317481318943340352356",
"length": 216.0
},
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function"
}
]