In the Linux kernel, the following vulnerability has been resolved:
net: asix: add proper error handling of usb read errors
Syzbot once again hit uninit value in asix driver. The problem still the same -- asixreadcmd() reads less bytes, than was requested by caller.
Since all read requests are performed via asixreadcmd() let's catch usb related error there and add _mustcheck notation to be sure all callers actually check return value.
So, this patch adds sanity check inside asixreadcmd(), that simply checks if bytes read are not less, than was requested and adds missing error handling of asixreadcmd() all across the driver code.
[
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"60604756943237725253677468564639154885",
"272475573824939403710351873585107829611",
"20324404785676293345873777662495532381",
"176793043986298169681462780280880668365",
"200440793862497269518802030866707401428",
"255826282608760194903043333126090866236",
"88374148554349175107692977757688935159",
"113449779404404139212682925946616985568",
"316700946401036451374606297646304575739",
"69992035463160489153401089971827938222",
"241223405280659846956899882560935017898"
],
"threshold": 0.9
},
"target": {
"file": "drivers/net/usb/asix_devices.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@920a9fa27e7805499cfe78491b36fed2322c02ec",
"signature_version": "v1",
"id": "CVE-2022-49226-0026650b"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1916.0,
"function_hash": "260304746102896809303141304327217440688"
},
"target": {
"file": "drivers/net/usb/asix_devices.c",
"function": "ax88772_bind"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9ea8d2fca8fea3b17005b4dc02f8ef15f7a2fb97",
"signature_version": "v1",
"id": "CVE-2022-49226-0c65da2a"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 579.0,
"function_hash": "46314927152408738120223817098494762928"
},
"target": {
"file": "drivers/net/usb/asix_common.c",
"function": "asix_mdio_read_nopm"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@920a9fa27e7805499cfe78491b36fed2322c02ec",
"signature_version": "v1",
"id": "CVE-2022-49226-11bafd47"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"131943846843477513026253242748314500019",
"142456918953720145573712040894091435706",
"172122813165189085820812471194015405975",
"22953320310525601778868451703827238722",
"38644900709672850614474847981317748716"
],
"threshold": 0.9
},
"target": {
"file": "drivers/net/usb/asix.h"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@920a9fa27e7805499cfe78491b36fed2322c02ec",
"signature_version": "v1",
"id": "CVE-2022-49226-18121a1b"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"215864971250448420702198162381473484166",
"155897448423858508180878294276672405162",
"186115678209386790150462973515422021041",
"278722383418844256146314371890692904485",
"310165482915402143967929085751326703321",
"204346576457350969545903424572388465648",
"331946608115796790825779876969223650252",
"261796642541841538176824049465118880519",
"121197455610079396812974444692639014583",
"1505221702531330192937809932515427913",
"106055133402852531493863842584777954853",
"105020731976871923204422816611485500279",
"146282606367781097279835431770667588516",
"274245352569098492708833154102648925859",
"272735564258597209157555937982896371641",
"124713412560305102193257992350262942707",
"19785885425562142176390747630095455583",
"211229813843140354539676062587317024041"
],
"threshold": 0.9
},
"target": {
"file": "drivers/net/usb/asix_common.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b96a7265f763b37ff3138b9ca8122a950f13b00e",
"signature_version": "v1",
"id": "CVE-2022-49226-252859f6"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 504.0,
"function_hash": "61334275557031946813601919180283209492"
},
"target": {
"file": "drivers/net/usb/asix_common.c",
"function": "asix_check_host_enable"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@920a9fa27e7805499cfe78491b36fed2322c02ec",
"signature_version": "v1",
"id": "CVE-2022-49226-25818607"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 504.0,
"function_hash": "61334275557031946813601919180283209492"
},
"target": {
"file": "drivers/net/usb/asix_common.c",
"function": "asix_check_host_enable"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b96a7265f763b37ff3138b9ca8122a950f13b00e",
"signature_version": "v1",
"id": "CVE-2022-49226-2ebbf027"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"215864971250448420702198162381473484166",
"155897448423858508180878294276672405162",
"186115678209386790150462973515422021041",
"278722383418844256146314371890692904485",
"310165482915402143967929085751326703321",
"204346576457350969545903424572388465648",
"331946608115796790825779876969223650252",
"261796642541841538176824049465118880519",
"121197455610079396812974444692639014583",
"1505221702531330192937809932515427913",
"106055133402852531493863842584777954853",
"105020731976871923204422816611485500279",
"146282606367781097279835431770667588516",
"274245352569098492708833154102648925859",
"272735564258597209157555937982896371641",
"124713412560305102193257992350262942707",
"19785885425562142176390747630095455583",
"211229813843140354539676062587317024041"
],
"threshold": 0.9
},
"target": {
"file": "drivers/net/usb/asix_common.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@920a9fa27e7805499cfe78491b36fed2322c02ec",
"signature_version": "v1",
"id": "CVE-2022-49226-3677e9b2"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"131943846843477513026253242748314500019",
"142456918953720145573712040894091435706",
"172122813165189085820812471194015405975",
"22953320310525601778868451703827238722",
"38644900709672850614474847981317748716"
],
"threshold": 0.9
},
"target": {
"file": "drivers/net/usb/asix.h"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9ea8d2fca8fea3b17005b4dc02f8ef15f7a2fb97",
"signature_version": "v1",
"id": "CVE-2022-49226-3a4f0ccf"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"131943846843477513026253242748314500019",
"142456918953720145573712040894091435706",
"172122813165189085820812471194015405975",
"22953320310525601778868451703827238722",
"38644900709672850614474847981317748716"
],
"threshold": 0.9
},
"target": {
"file": "drivers/net/usb/asix.h"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b96a7265f763b37ff3138b9ca8122a950f13b00e",
"signature_version": "v1",
"id": "CVE-2022-49226-3cda7ed7"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 567.0,
"function_hash": "332281504313201198198138668709088021947"
},
"target": {
"file": "drivers/net/usb/asix_common.c",
"function": "asix_read_cmd"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@662ff765470ad0d11a1153d6d8e99d69a98e60b4",
"signature_version": "v1",
"id": "CVE-2022-49226-4a316d58"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 2359.0,
"function_hash": "18143048146190792080405401862447784118"
},
"target": {
"file": "drivers/net/usb/asix_devices.c",
"function": "ax88178_reset"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b96a7265f763b37ff3138b9ca8122a950f13b00e",
"signature_version": "v1",
"id": "CVE-2022-49226-532cd119"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 579.0,
"function_hash": "46314927152408738120223817098494762928"
},
"target": {
"file": "drivers/net/usb/asix_common.c",
"function": "asix_mdio_read_nopm"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9ea8d2fca8fea3b17005b4dc02f8ef15f7a2fb97",
"signature_version": "v1",
"id": "CVE-2022-49226-544d2692"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 2359.0,
"function_hash": "18143048146190792080405401862447784118"
},
"target": {
"file": "drivers/net/usb/asix_devices.c",
"function": "ax88178_reset"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@920a9fa27e7805499cfe78491b36fed2322c02ec",
"signature_version": "v1",
"id": "CVE-2022-49226-67a5b9eb"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 567.0,
"function_hash": "332281504313201198198138668709088021947"
},
"target": {
"file": "drivers/net/usb/asix_common.c",
"function": "asix_read_cmd"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9ea8d2fca8fea3b17005b4dc02f8ef15f7a2fb97",
"signature_version": "v1",
"id": "CVE-2022-49226-6f72650a"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 2359.0,
"function_hash": "18143048146190792080405401862447784118"
},
"target": {
"file": "drivers/net/usb/asix_devices.c",
"function": "ax88178_reset"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@662ff765470ad0d11a1153d6d8e99d69a98e60b4",
"signature_version": "v1",
"id": "CVE-2022-49226-73eb5b0a"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"215864971250448420702198162381473484166",
"155897448423858508180878294276672405162",
"186115678209386790150462973515422021041",
"278722383418844256146314371890692904485",
"310165482915402143967929085751326703321",
"204346576457350969545903424572388465648",
"331946608115796790825779876969223650252",
"261796642541841538176824049465118880519",
"121197455610079396812974444692639014583",
"1505221702531330192937809932515427913",
"106055133402852531493863842584777954853",
"105020731976871923204422816611485500279",
"146282606367781097279835431770667588516",
"274245352569098492708833154102648925859",
"272735564258597209157555937982896371641",
"124713412560305102193257992350262942707",
"19785885425562142176390747630095455583",
"211229813843140354539676062587317024041"
],
"threshold": 0.9
},
"target": {
"file": "drivers/net/usb/asix_common.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@662ff765470ad0d11a1153d6d8e99d69a98e60b4",
"signature_version": "v1",
"id": "CVE-2022-49226-7cae6eff"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"131943846843477513026253242748314500019",
"142456918953720145573712040894091435706",
"172122813165189085820812471194015405975",
"22953320310525601778868451703827238722",
"38644900709672850614474847981317748716"
],
"threshold": 0.9
},
"target": {
"file": "drivers/net/usb/asix.h"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@662ff765470ad0d11a1153d6d8e99d69a98e60b4",
"signature_version": "v1",
"id": "CVE-2022-49226-84aaacc8"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1916.0,
"function_hash": "260304746102896809303141304327217440688"
},
"target": {
"file": "drivers/net/usb/asix_devices.c",
"function": "ax88772_bind"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@920a9fa27e7805499cfe78491b36fed2322c02ec",
"signature_version": "v1",
"id": "CVE-2022-49226-85ff033c"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 504.0,
"function_hash": "61334275557031946813601919180283209492"
},
"target": {
"file": "drivers/net/usb/asix_common.c",
"function": "asix_check_host_enable"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9ea8d2fca8fea3b17005b4dc02f8ef15f7a2fb97",
"signature_version": "v1",
"id": "CVE-2022-49226-8e4213cd"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1916.0,
"function_hash": "260304746102896809303141304327217440688"
},
"target": {
"file": "drivers/net/usb/asix_devices.c",
"function": "ax88772_bind"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b96a7265f763b37ff3138b9ca8122a950f13b00e",
"signature_version": "v1",
"id": "CVE-2022-49226-a8231f63"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"60604756943237725253677468564639154885",
"272475573824939403710351873585107829611",
"20324404785676293345873777662495532381",
"176793043986298169681462780280880668365",
"200440793862497269518802030866707401428",
"255826282608760194903043333126090866236",
"88374148554349175107692977757688935159",
"113449779404404139212682925946616985568",
"316700946401036451374606297646304575739",
"69992035463160489153401089971827938222",
"241223405280659846956899882560935017898"
],
"threshold": 0.9
},
"target": {
"file": "drivers/net/usb/asix_devices.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b96a7265f763b37ff3138b9ca8122a950f13b00e",
"signature_version": "v1",
"id": "CVE-2022-49226-b4a2fd64"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 1916.0,
"function_hash": "260304746102896809303141304327217440688"
},
"target": {
"file": "drivers/net/usb/asix_devices.c",
"function": "ax88772_bind"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@662ff765470ad0d11a1153d6d8e99d69a98e60b4",
"signature_version": "v1",
"id": "CVE-2022-49226-b4af622a"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 2359.0,
"function_hash": "18143048146190792080405401862447784118"
},
"target": {
"file": "drivers/net/usb/asix_devices.c",
"function": "ax88178_reset"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9ea8d2fca8fea3b17005b4dc02f8ef15f7a2fb97",
"signature_version": "v1",
"id": "CVE-2022-49226-b50f056f"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 579.0,
"function_hash": "46314927152408738120223817098494762928"
},
"target": {
"file": "drivers/net/usb/asix_common.c",
"function": "asix_mdio_read_nopm"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b96a7265f763b37ff3138b9ca8122a950f13b00e",
"signature_version": "v1",
"id": "CVE-2022-49226-ba64aa32"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 567.0,
"function_hash": "332281504313201198198138668709088021947"
},
"target": {
"file": "drivers/net/usb/asix_common.c",
"function": "asix_read_cmd"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@920a9fa27e7805499cfe78491b36fed2322c02ec",
"signature_version": "v1",
"id": "CVE-2022-49226-c0b8dc64"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 567.0,
"function_hash": "332281504313201198198138668709088021947"
},
"target": {
"file": "drivers/net/usb/asix_common.c",
"function": "asix_read_cmd"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b96a7265f763b37ff3138b9ca8122a950f13b00e",
"signature_version": "v1",
"id": "CVE-2022-49226-c3369a77"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 579.0,
"function_hash": "46314927152408738120223817098494762928"
},
"target": {
"file": "drivers/net/usb/asix_common.c",
"function": "asix_mdio_read_nopm"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@662ff765470ad0d11a1153d6d8e99d69a98e60b4",
"signature_version": "v1",
"id": "CVE-2022-49226-c58cf16f"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"215864971250448420702198162381473484166",
"155897448423858508180878294276672405162",
"186115678209386790150462973515422021041",
"278722383418844256146314371890692904485",
"310165482915402143967929085751326703321",
"204346576457350969545903424572388465648",
"331946608115796790825779876969223650252",
"261796642541841538176824049465118880519",
"121197455610079396812974444692639014583",
"1505221702531330192937809932515427913",
"106055133402852531493863842584777954853",
"105020731976871923204422816611485500279",
"146282606367781097279835431770667588516",
"274245352569098492708833154102648925859",
"272735564258597209157555937982896371641",
"124713412560305102193257992350262942707",
"19785885425562142176390747630095455583",
"211229813843140354539676062587317024041"
],
"threshold": 0.9
},
"target": {
"file": "drivers/net/usb/asix_common.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9ea8d2fca8fea3b17005b4dc02f8ef15f7a2fb97",
"signature_version": "v1",
"id": "CVE-2022-49226-cd698c0a"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"60604756943237725253677468564639154885",
"272475573824939403710351873585107829611",
"20324404785676293345873777662495532381",
"176793043986298169681462780280880668365",
"200440793862497269518802030866707401428",
"255826282608760194903043333126090866236",
"88374148554349175107692977757688935159",
"113449779404404139212682925946616985568",
"316700946401036451374606297646304575739",
"69992035463160489153401089971827938222",
"241223405280659846956899882560935017898"
],
"threshold": 0.9
},
"target": {
"file": "drivers/net/usb/asix_devices.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9ea8d2fca8fea3b17005b4dc02f8ef15f7a2fb97",
"signature_version": "v1",
"id": "CVE-2022-49226-e17d30e1"
},
{
"signature_type": "Line",
"deprecated": false,
"digest": {
"line_hashes": [
"60604756943237725253677468564639154885",
"272475573824939403710351873585107829611",
"20324404785676293345873777662495532381",
"176793043986298169681462780280880668365",
"200440793862497269518802030866707401428",
"255826282608760194903043333126090866236",
"88374148554349175107692977757688935159",
"113449779404404139212682925946616985568",
"316700946401036451374606297646304575739",
"69992035463160489153401089971827938222",
"241223405280659846956899882560935017898"
],
"threshold": 0.9
},
"target": {
"file": "drivers/net/usb/asix_devices.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@662ff765470ad0d11a1153d6d8e99d69a98e60b4",
"signature_version": "v1",
"id": "CVE-2022-49226-f034f911"
},
{
"signature_type": "Function",
"deprecated": false,
"digest": {
"length": 504.0,
"function_hash": "61334275557031946813601919180283209492"
},
"target": {
"file": "drivers/net/usb/asix_common.c",
"function": "asix_check_host_enable"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@662ff765470ad0d11a1153d6d8e99d69a98e60b4",
"signature_version": "v1",
"id": "CVE-2022-49226-fe532097"
}
]