In the Linux kernel, the following vulnerability has been resolved:
i2c: ismt: Fix an out-of-bounds bug in ismt_access()
When the driver does not check the data from the user, the variable 'data->block[0]' may be very large to cause an out-of-bounds bug.
The following log can reveal it:
[ 33.995542] i2c i2c-1: ioctl, cmd=0x720, arg=0x7ffcb3dc3a20 [ 33.995978] ismtsmbus 0000:00:05.0: I2CSMBUSBLOCKDATA: WRITE [ 33.996475] ================================================================== [ 33.996995] BUG: KASAN: out-of-bounds in ismtaccess.cold+0x374/0x214b [ 33.997473] Read of size 18446744073709551615 at addr ffff88810efcfdb1 by task ismtpoc/485 [ 33.999450] Call Trace: [ 34.001849] memcpy+0x20/0x60 [ 34.002077] ismtaccess.cold+0x374/0x214b [ 34.003382] _i2csmbusxfer+0x44f/0xfb0 [ 34.004007] i2csmbusxfer+0x10a/0x390 [ 34.004291] i2cdevioctlsmbus+0x2c8/0x710 [ 34.005196] i2cdev_ioctl+0x5ec/0x74c
Fix this bug by checking the size of 'data->block[0]' first.
[
{
"deprecated": false,
"id": "CVE-2022-50394-147b7502",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@96c12fd0ec74641295e1c3c34dea3dce1b6c3422",
"digest": {
"function_hash": "283990036045054325155284747660111858048",
"length": 5120.0
},
"target": {
"function": "ismt_access",
"file": "drivers/i2c/busses/i2c-ismt.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2022-50394-249608e5",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@233348a04becf133283f0076e20b317302de21d9",
"digest": {
"line_hashes": [
"88914032073458105485746548680517802561",
"94426435447957667212344093274061568722",
"95980659577986400951780441329317501317",
"15696111413659285547068531353550313317"
],
"threshold": 0.9
},
"target": {
"file": "drivers/i2c/busses/i2c-ismt.c"
},
"signature_type": "Line",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2022-50394-400898e2",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a642469d464b2780a25a49b51ae56623c65eac34",
"digest": {
"line_hashes": [
"88914032073458105485746548680517802561",
"94426435447957667212344093274061568722",
"95980659577986400951780441329317501317",
"15696111413659285547068531353550313317"
],
"threshold": 0.9
},
"target": {
"file": "drivers/i2c/busses/i2c-ismt.c"
},
"signature_type": "Line",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2022-50394-4083da6b",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@233348a04becf133283f0076e20b317302de21d9",
"digest": {
"function_hash": "283990036045054325155284747660111858048",
"length": 5120.0
},
"target": {
"function": "ismt_access",
"file": "drivers/i2c/busses/i2c-ismt.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2022-50394-4ab7695a",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@39244cc754829bf707dccd12e2ce37510f5b1f8d",
"digest": {
"line_hashes": [
"88914032073458105485746548680517802561",
"94426435447957667212344093274061568722",
"95980659577986400951780441329317501317",
"15696111413659285547068531353550313317"
],
"threshold": 0.9
},
"target": {
"file": "drivers/i2c/busses/i2c-ismt.c"
},
"signature_type": "Line",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2022-50394-6f8c64be",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cdcbae2c5003747ddfd14e29db9c1d5d7e7c44dd",
"digest": {
"line_hashes": [
"88914032073458105485746548680517802561",
"94426435447957667212344093274061568722",
"95980659577986400951780441329317501317",
"15696111413659285547068531353550313317"
],
"threshold": 0.9
},
"target": {
"file": "drivers/i2c/busses/i2c-ismt.c"
},
"signature_type": "Line",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2022-50394-7b556b98",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9ac541a0898e8ec187a3fa7024b9701cffae6bf2",
"digest": {
"function_hash": "87832301937207640014031941845520813885",
"length": 4663.0
},
"target": {
"function": "ismt_access",
"file": "drivers/i2c/busses/i2c-ismt.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2022-50394-83f1495a",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@96c12fd0ec74641295e1c3c34dea3dce1b6c3422",
"digest": {
"line_hashes": [
"88914032073458105485746548680517802561",
"94426435447957667212344093274061568722",
"95980659577986400951780441329317501317",
"15696111413659285547068531353550313317"
],
"threshold": 0.9
},
"target": {
"file": "drivers/i2c/busses/i2c-ismt.c"
},
"signature_type": "Line",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2022-50394-a37d278f",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a642469d464b2780a25a49b51ae56623c65eac34",
"digest": {
"function_hash": "283990036045054325155284747660111858048",
"length": 5120.0
},
"target": {
"function": "ismt_access",
"file": "drivers/i2c/busses/i2c-ismt.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2022-50394-a88f1af0",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bfe41d966c860a8ad4c735639d616da270c92735",
"digest": {
"function_hash": "87832301937207640014031941845520813885",
"length": 4663.0
},
"target": {
"function": "ismt_access",
"file": "drivers/i2c/busses/i2c-ismt.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2022-50394-a9b300ca",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cdcbae2c5003747ddfd14e29db9c1d5d7e7c44dd",
"digest": {
"function_hash": "87832301937207640014031941845520813885",
"length": 4663.0
},
"target": {
"function": "ismt_access",
"file": "drivers/i2c/busses/i2c-ismt.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2022-50394-abcbe253",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4a7bb1d93addb2f67e36fed00a53cb7f270d7b7a",
"digest": {
"line_hashes": [
"88914032073458105485746548680517802561",
"94426435447957667212344093274061568722",
"95980659577986400951780441329317501317",
"15696111413659285547068531353550313317"
],
"threshold": 0.9
},
"target": {
"file": "drivers/i2c/busses/i2c-ismt.c"
},
"signature_type": "Line",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2022-50394-ad0c9575",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bfe41d966c860a8ad4c735639d616da270c92735",
"digest": {
"line_hashes": [
"88914032073458105485746548680517802561",
"94426435447957667212344093274061568722",
"95980659577986400951780441329317501317",
"15696111413659285547068531353550313317"
],
"threshold": 0.9
},
"target": {
"file": "drivers/i2c/busses/i2c-ismt.c"
},
"signature_type": "Line",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2022-50394-ccf1f4ea",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@03b7ef7a6c5ca1ff553470166b4919db88b810f6",
"digest": {
"line_hashes": [
"88914032073458105485746548680517802561",
"94426435447957667212344093274061568722",
"95980659577986400951780441329317501317",
"15696111413659285547068531353550313317"
],
"threshold": 0.9
},
"target": {
"file": "drivers/i2c/busses/i2c-ismt.c"
},
"signature_type": "Line",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2022-50394-ee73e9c3",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4a7bb1d93addb2f67e36fed00a53cb7f270d7b7a",
"digest": {
"function_hash": "325697292242559451292984465301505010729",
"length": 4781.0
},
"target": {
"function": "ismt_access",
"file": "drivers/i2c/busses/i2c-ismt.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2022-50394-f398aafd",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@39244cc754829bf707dccd12e2ce37510f5b1f8d",
"digest": {
"function_hash": "283990036045054325155284747660111858048",
"length": 5120.0
},
"target": {
"function": "ismt_access",
"file": "drivers/i2c/busses/i2c-ismt.c"
},
"signature_type": "Function",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2022-50394-f8d9e80e",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9ac541a0898e8ec187a3fa7024b9701cffae6bf2",
"digest": {
"line_hashes": [
"88914032073458105485746548680517802561",
"94426435447957667212344093274061568722",
"95980659577986400951780441329317501317",
"15696111413659285547068531353550313317"
],
"threshold": 0.9
},
"target": {
"file": "drivers/i2c/busses/i2c-ismt.c"
},
"signature_type": "Line",
"signature_version": "v1"
},
{
"deprecated": false,
"id": "CVE-2022-50394-f9544e6b",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@03b7ef7a6c5ca1ff553470166b4919db88b810f6",
"digest": {
"function_hash": "325697292242559451292984465301505010729",
"length": 4781.0
},
"target": {
"function": "ismt_access",
"file": "drivers/i2c/busses/i2c-ismt.c"
},
"signature_type": "Function",
"signature_version": "v1"
}
]