{"id":"CVE-2022-49285","aliases":["CVE-2022-49285"],"related":[],"kind":"vulnerability","state":"published","title":"iio: accel: mma8452: use the correct logic to get mma8452_data","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\niio: accel: mma8452: use the correct logic to get mma8452_data\n\nThe original logic to get mma8452_data is wrong, the *dev point to\nthe device belong to iio_dev. we can't use this dev to find the\ncorrect i2c_client. The original logic happen to work because it\nfinally use dev->driver_data to get iio_dev. Here use the API\nto_i2c_client() is wrong and make reader confuse. To correct the\nlogic, it should be like this\n\n  struct mma8452_data *data = iio_priv(dev_get_drvdata(dev));\n\nBut after commit 8b7651f25962 (\"iio: iio_device_alloc(): Remove\nunnecessary self drvdata\"), the upper logic also can't work.\nWhen try to show the avialable scale in userspace, will meet kernel\ndump, kernel handle NULL pointer dereference.\n\nSo use dev_to_iio_dev() to correct the logic.\n\nDual fixes tags as the second reflects when the bug was exposed, whilst\nthe first reflects when the original bug was introduced.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\niio: accel: mma8452: use the correct logic to get mma8452_data\n\nThe original logic to get mma8452_data is wrong, the *dev point to\nthe device belong to iio_dev. we can't use this dev to find the\ncorrect i2c_client. The original logic happen to work because it\nfinally use dev->driver_data to get iio_dev. Here use the API\nto_i2c_client() is wrong and make reader confuse. To correct the\nlogic, it should be like this\n\n  struct mma8452_data *data = iio_priv(dev_get_drvdata(dev));\n\nBut after commit 8b7651f25962 (\"iio: iio_device_alloc(): Remove\nunnecessary self drvdata\"), the upper logic also can't work.\nWhen try to show the avialable scale in userspace, will meet kernel\ndump, kernel handle NULL pointer dereference.\n\nSo use dev_to_iio_dev() to correct the logic.\n\nDual fixes tags as the second reflects when the bug was exposed, whilst\nthe first reflects when the original bug was introduced.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: iio: accel: mma8452: usa la lógica correcta para obtener mma8452_data La lógica original para obtener mma8452_data es incorrecta, el punto *dev al dispositivo pertenece a iio_dev. No podemos usar este dev para encontrar el i2c_client correcto. La lógica original funcionó porque finalmente usó dev-&gt;driver_data para obtener iio_dev. Aquí, usar la API to_i2c_client() es incorrecto y confunde al lector. Para corregir la lógica, debería ser así struct mma8452_data *data = iio_priv(dev_get_drvdata(dev)); Pero después de el commit 8b7651f25962 (\"iio: iio_device_alloc(): eliminar drvdata propios innecesarios\"), la lógica superior tampoco puede funcionar. Cuando se intenta mostrar la escala disponible en el espacio de usuario, se produce un volcado del kernel y una desreferencia del puntero NULL del manejador del kernel. Por lo tanto, se utiliza dev_to_iio_dev() para corregir la lógica. Dual corrige las etiquetas, ya que la segunda refleja cuándo se expuso el error, mientras que la primera refleja cuándo se introdujo el error original.","source":"nvd"}],"published":"2025-02-26T01:56:25.096Z","modified":"2026-06-17T05:17:36.020Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-476"],"affected":[{"ranges":[{"type":"git","introduced":"c3cdd6e48e35b7a02f28e301ef30a87ff3cd6527","fixed":"4c0bb583a4444cce224e8661090cbffc98e2fe07","status":"affected"},{"type":"git","introduced":"c3cdd6e48e35b7a02f28e301ef30a87ff3cd6527","fixed":"d2d9ebdbff79d87d27652578e6d1638ad3b5f3bf","status":"affected"},{"type":"git","introduced":"c3cdd6e48e35b7a02f28e301ef30a87ff3cd6527","fixed":"c87b7b12f48db86ac9909894f4dc0107d7df6375","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"4.4","status":"affected"},{"type":"semver","introduced":"0","fixed":"4.4","status":"unaffected"},{"type":"semver","introduced":"5.15.54","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"5.17.2","lastAffected":"5.17.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"5.18","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"4.4","fixed":"5.15.54"},{"status":"affected","introduced":"5.16","fixed":"5.17.2"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/4c0bb583a4444cce224e8661090cbffc98e2fe07","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d2d9ebdbff79d87d27652578e6d1638ad3b5f3bf","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c87b7b12f48db86ac9909894f4dc0107d7df6375","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-49285","url":"https://www.cve.org/CVERecord?id=CVE-2022-49285","licence":"CVE Terms of Use","modified":"2026-05-11T18:56:44.269Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-49285","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-49285","licence":"Public domain","modified":"2026-06-17T05:17:36.020Z"}],"updatedAt":"2026-11-25T22:58:20.360Z","epss":{"score":0.00258,"percentile":0.18639,"date":"2026-12-02T12:00:21.000Z"}}