{"id":"CVE-2021-46904","state":"PUBLISHED","title":"net: hso: fix null-ptr-deref during tty device unregistration","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet: hso: fix null-ptr-deref during tty device unregistration\n\nMultiple ttys try to claim the same the minor number causing a double\nunregistration of the same device. The first unregistration succeeds\nbut the next one results in a null-ptr-deref.\n\nThe get_free_serial_index() function returns an available minor number\nbut doesn't assign it immediately. The assignment is done by the caller\nlater. But before this assignment, calls to get_free_serial_index()\nwould return the same minor number.\n\nFix this by modifying get_free_serial_index to assign the minor number\nimmediately after one is found to be and rename it to obtain_minor()\nto better reflect what it does. Similary, rename set_serial_by_index()\nto release_minor() and modify it to free up the minor number of the\ngiven hso_serial. Every obtain_minor() should have corresponding\nrelease_minor() call.","publishedAt":"2024-02-25T14:03:40.319Z","updatedAt":"2026-05-11T13:44:09.016Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"72dc1c096c7051a48ab1dbb12f71976656b55eb5","status":"affected","lessThan":"a462067d7c8e6953a733bf5ade8db947b1bb5449","versionType":"git"},{"version":"72dc1c096c7051a48ab1dbb12f71976656b55eb5","status":"affected","lessThan":"145c89c441d27696961752bf51b323f347601bee","versionType":"git"},{"version":"72dc1c096c7051a48ab1dbb12f71976656b55eb5","status":"affected","lessThan":"caf5ac93b3b5d5fac032fc11fbea680e115421b4","versionType":"git"},{"version":"72dc1c096c7051a48ab1dbb12f71976656b55eb5","status":"affected","lessThan":"92028d7a31e55d53e41cff679156b9432cffcb36","versionType":"git"},{"version":"72dc1c096c7051a48ab1dbb12f71976656b55eb5","status":"affected","lessThan":"4a2933c88399c0ebc738db39bbce3ae89786d723","versionType":"git"},{"version":"72dc1c096c7051a48ab1dbb12f71976656b55eb5","status":"affected","lessThan":"dc195928d7e4ec7b5cfc6cd10dc4c8d87a7c72ac","versionType":"git"},{"version":"72dc1c096c7051a48ab1dbb12f71976656b55eb5","status":"affected","lessThan":"388d05f70f1ee0cac4a2068fd295072f1a44152a","versionType":"git"},{"version":"72dc1c096c7051a48ab1dbb12f71976656b55eb5","status":"affected","lessThan":"8a12f8836145ffe37e9c8733dce18c22fb668b66","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/net/usb/hso.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.27","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.27","versionType":"semver"},{"version":"4.4.268","status":"unaffected","lessThanOrEqual":"4.4.*","versionType":"semver"},{"version":"4.9.268","status":"unaffected","lessThanOrEqual":"4.9.*","versionType":"semver"},{"version":"4.14.232","status":"unaffected","lessThanOrEqual":"4.14.*","versionType":"semver"},{"version":"4.19.187","status":"unaffected","lessThanOrEqual":"4.19.*","versionType":"semver"},{"version":"5.4.112","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.30","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.11.14","status":"unaffected","lessThanOrEqual":"5.11.*","versionType":"semver"},{"version":"5.12","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/net/usb/hso.c"]}],"references":["https://git.kernel.org/stable/c/a462067d7c8e6953a733bf5ade8db947b1bb5449","https://git.kernel.org/stable/c/145c89c441d27696961752bf51b323f347601bee","https://git.kernel.org/stable/c/caf5ac93b3b5d5fac032fc11fbea680e115421b4","https://git.kernel.org/stable/c/92028d7a31e55d53e41cff679156b9432cffcb36","https://git.kernel.org/stable/c/4a2933c88399c0ebc738db39bbce3ae89786d723","https://git.kernel.org/stable/c/dc195928d7e4ec7b5cfc6cd10dc4c8d87a7c72ac","https://git.kernel.org/stable/c/388d05f70f1ee0cac4a2068fd295072f1a44152a","https://git.kernel.org/stable/c/8a12f8836145ffe37e9c8733dce18c22fb668b66"],"weaknesses":[],"ingestedAt":"2026-10-29T19:49:16.371Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2021/46xxx/CVE-2021-46904.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2021-46904","state":"PUBLISHED","datePublished":"2024-02-25T14:03:40.319Z","dateUpdated":"2026-05-11T13:44:09.016Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2024-02-25T13:45:52.716Z"},"containers":{"cna":{"title":"net: hso: fix null-ptr-deref during tty device unregistration","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet: hso: fix null-ptr-deref during tty device unregistration\n\nMultiple ttys try to claim the same the minor number causing a double\nunregistration of the same device. The first unregistration succeeds\nbut the next one results in a null-ptr-deref.\n\nThe get_free_serial_index() function returns an available minor number\nbut doesn't assign it immediately. The assignment is done by the caller\nlater. But before this assignment, calls to get_free_serial_index()\nwould return the same minor number.\n\nFix this by modifying get_free_serial_index to assign the minor number\nimmediately after one is found to be and rename it to obtain_minor()\nto better reflect what it does. Similary, rename set_serial_by_index()\nto release_minor() and modify it to free up the minor number of the\ngiven hso_serial. Every obtain_minor() should have corresponding\nrelease_minor() call."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"72dc1c096c7051a48ab1dbb12f71976656b55eb5","status":"affected","lessThan":"a462067d7c8e6953a733bf5ade8db947b1bb5449","versionType":"git"},{"version":"72dc1c096c7051a48ab1dbb12f71976656b55eb5","status":"affected","lessThan":"145c89c441d27696961752bf51b323f347601bee","versionType":"git"},{"version":"72dc1c096c7051a48ab1dbb12f71976656b55eb5","status":"affected","lessThan":"caf5ac93b3b5d5fac032fc11fbea680e115421b4","versionType":"git"},{"version":"72dc1c096c7051a48ab1dbb12f71976656b55eb5","status":"affected","lessThan":"92028d7a31e55d53e41cff679156b9432cffcb36","versionType":"git"},{"version":"72dc1c096c7051a48ab1dbb12f71976656b55eb5","status":"affected","lessThan":"4a2933c88399c0ebc738db39bbce3ae89786d723","versionType":"git"},{"version":"72dc1c096c7051a48ab1dbb12f71976656b55eb5","status":"affected","lessThan":"dc195928d7e4ec7b5cfc6cd10dc4c8d87a7c72ac","versionType":"git"},{"version":"72dc1c096c7051a48ab1dbb12f71976656b55eb5","status":"affected","lessThan":"388d05f70f1ee0cac4a2068fd295072f1a44152a","versionType":"git"},{"version":"72dc1c096c7051a48ab1dbb12f71976656b55eb5","status":"affected","lessThan":"8a12f8836145ffe37e9c8733dce18c22fb668b66","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/net/usb/hso.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"2.6.27","status":"affected"},{"version":"0","status":"unaffected","lessThan":"2.6.27","versionType":"semver"},{"version":"4.4.268","status":"unaffected","lessThanOrEqual":"4.4.*","versionType":"semver"},{"version":"4.9.268","status":"unaffected","lessThanOrEqual":"4.9.*","versionType":"semver"},{"version":"4.14.232","status":"unaffected","lessThanOrEqual":"4.14.*","versionType":"semver"},{"version":"4.19.187","status":"unaffected","lessThanOrEqual":"4.19.*","versionType":"semver"},{"version":"5.4.112","status":"unaffected","lessThanOrEqual":"5.4.*","versionType":"semver"},{"version":"5.10.30","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.11.14","status":"unaffected","lessThanOrEqual":"5.11.*","versionType":"semver"},{"version":"5.12","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/net/usb/hso.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/a462067d7c8e6953a733bf5ade8db947b1bb5449"},{"url":"https://git.kernel.org/stable/c/145c89c441d27696961752bf51b323f347601bee"},{"url":"https://git.kernel.org/stable/c/caf5ac93b3b5d5fac032fc11fbea680e115421b4"},{"url":"https://git.kernel.org/stable/c/92028d7a31e55d53e41cff679156b9432cffcb36"},{"url":"https://git.kernel.org/stable/c/4a2933c88399c0ebc738db39bbce3ae89786d723"},{"url":"https://git.kernel.org/stable/c/dc195928d7e4ec7b5cfc6cd10dc4c8d87a7c72ac"},{"url":"https://git.kernel.org/stable/c/388d05f70f1ee0cac4a2068fd295072f1a44152a"},{"url":"https://git.kernel.org/stable/c/8a12f8836145ffe37e9c8733dce18c22fb668b66"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-05-11T13:44:09.016Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.27","versionEndExcluding":"4.4.268"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.27","versionEndExcluding":"4.9.268"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.27","versionEndExcluding":"4.14.232"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.27","versionEndExcluding":"4.19.187"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.27","versionEndExcluding":"5.4.112"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.27","versionEndExcluding":"5.10.30"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.27","versionEndExcluding":"5.11.14"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"2.6.27","versionEndExcluding":"5.12"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}},"adp":[{"title":"CISA ADP Vulnrichment","metrics":[{"other":{"type":"ssvc","content":{"timestamp":"2024-07-25T17:47:17.588165Z","id":"CVE-2021-46904","options":[{"Exploitation":"none"},{"Automatable":"no"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}}],"providerMetadata":{"shortName":"CISA-ADP","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","dateUpdated":"2024-07-25T17:47:30.417Z"}},{"title":"CVE Program Container","references":[{"url":"https://git.kernel.org/stable/c/a462067d7c8e6953a733bf5ade8db947b1bb5449","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/145c89c441d27696961752bf51b323f347601bee","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/caf5ac93b3b5d5fac032fc11fbea680e115421b4","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/92028d7a31e55d53e41cff679156b9432cffcb36","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/4a2933c88399c0ebc738db39bbce3ae89786d723","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/dc195928d7e4ec7b5cfc6cd10dc4c8d87a7c72ac","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/388d05f70f1ee0cac4a2068fd295072f1a44152a","tags":["x_transferred"]},{"url":"https://git.kernel.org/stable/c/8a12f8836145ffe37e9c8733dce18c22fb668b66","tags":["x_transferred"]}],"providerMetadata":{"shortName":"CVE","orgId":"af854a3a-2127-422b-91ae-364da2661108","dateUpdated":"2024-08-04T05:17:42.846Z"}}]}}}