In the Linux kernel, the following vulnerability has been resolved:
staging: rtl8723bs: fix potential memory leak in rtwinitdrv_sw()
In rtwinitdrv_sw(), there are various init functions are called to populate the padapter structure and some checks for their return value. However, except for the first one error path, the other five error paths do not properly release the previous allocated resources, which leads to various memory leaks.
This patch fixes them and keeps the success and error separate.
Note that these changes keep the form of rtw_init_drv_sw() in
"drivers/staging/r8188eu/osdep/osintfs.c". As there is no proper device
to test with, no runtime testing was performed.
[
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"179109865298419338724374682689824582438",
"7025779285177078009162018613782226722",
"76771671034367010845836597618008713515",
"30412740957362424629229957899712108849",
"24347511704892992405736179406646713895",
"167133833383002618357222159318494915898",
"180582366492928600169703813826658561314",
"191273831249903052328870298183895802624",
"249975009568412472440693884371187997248",
"226770423600360843323111439095074924232",
"219661562018566198099879139363794025028",
"260675162953833872738354684495309825646",
"252227463061157305021922810180559196330",
"121171988415093598966013585304291285404",
"158008122542506832446290593870588920854",
"34731101658390221808123683699152631147",
"142426614320235585422597323955835680980",
"169262384478838013277693941463263461039",
"147984676352109864861128388279201052769",
"63390626628180538884063139040430261480",
"184302348343886408603894330386576506840",
"142697774022309373643298098873750724486",
"237174850365512628916332409286491589054",
"168834501464008086760913664675000915608",
"118257045571675069725128316377795387797",
"234230056905104077232834006375377901991",
"138833578248901766886794087456030838129",
"199208665649511206952227175952493624705",
"70120632649301202057827638813865876325",
"270435461417604462930457339500845794474",
"4135664760235539068047535880540429655",
"47201707117176207273131661077725997958",
"146969865424531058062965435025768728249",
"301028094607068289191207729485224984956",
"110445126707644158326360370780030566615",
"329971727716315865326793392737226206409",
"116604428409469501855580364284766266157",
"57758984395388342017996697194782934033"
]
},
"deprecated": false,
"id": "CVE-2022-50469-110f7301",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d95d1526d9f06978c1a7186810a5490d72c62742",
"target": {
"file": "drivers/staging/rtl8723bs/os_dep/os_intfs.c"
},
"signature_version": "v1"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"179109865298419338724374682689824582438",
"7025779285177078009162018613782226722",
"76771671034367010845836597618008713515",
"30412740957362424629229957899712108849",
"24347511704892992405736179406646713895",
"167133833383002618357222159318494915898",
"180582366492928600169703813826658561314",
"191273831249903052328870298183895802624",
"249975009568412472440693884371187997248",
"226770423600360843323111439095074924232",
"219661562018566198099879139363794025028",
"260675162953833872738354684495309825646",
"252227463061157305021922810180559196330",
"121171988415093598966013585304291285404",
"158008122542506832446290593870588920854",
"34731101658390221808123683699152631147",
"142426614320235585422597323955835680980",
"169262384478838013277693941463263461039",
"147984676352109864861128388279201052769",
"63390626628180538884063139040430261480",
"184302348343886408603894330386576506840",
"142697774022309373643298098873750724486",
"237174850365512628916332409286491589054",
"168834501464008086760913664675000915608",
"118257045571675069725128316377795387797",
"234230056905104077232834006375377901991",
"138833578248901766886794087456030838129",
"199208665649511206952227175952493624705",
"70120632649301202057827638813865876325",
"270435461417604462930457339500845794474",
"4135664760235539068047535880540429655",
"47201707117176207273131661077725997958",
"146969865424531058062965435025768728249",
"301028094607068289191207729485224984956",
"110445126707644158326360370780030566615",
"329971727716315865326793392737226206409",
"116604428409469501855580364284766266157",
"57758984395388342017996697194782934033"
]
},
"deprecated": false,
"id": "CVE-2022-50469-5708a730",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5a5aa9cce621e2c0e25a1e5d72d6be1749167cc0",
"target": {
"file": "drivers/staging/rtl8723bs/os_dep/os_intfs.c"
},
"signature_version": "v1"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "5094682755077177446102198845796498671",
"length": 832.0
},
"deprecated": false,
"id": "CVE-2022-50469-731c1a3d",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b4573a2bad3c3e2643ef3939079eb7035a30e6ee",
"target": {
"function": "rtw_init_drv_sw",
"file": "drivers/staging/rtl8723bs/os_dep/os_intfs.c"
},
"signature_version": "v1"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"179109865298419338724374682689824582438",
"7025779285177078009162018613782226722",
"76771671034367010845836597618008713515",
"30412740957362424629229957899712108849",
"24347511704892992405736179406646713895",
"167133833383002618357222159318494915898",
"180582366492928600169703813826658561314",
"191273831249903052328870298183895802624",
"249975009568412472440693884371187997248",
"226770423600360843323111439095074924232",
"219661562018566198099879139363794025028",
"260675162953833872738354684495309825646",
"252227463061157305021922810180559196330",
"121171988415093598966013585304291285404",
"158008122542506832446290593870588920854",
"34731101658390221808123683699152631147",
"142426614320235585422597323955835680980",
"169262384478838013277693941463263461039",
"147984676352109864861128388279201052769",
"63390626628180538884063139040430261480",
"184302348343886408603894330386576506840",
"142697774022309373643298098873750724486",
"237174850365512628916332409286491589054",
"168834501464008086760913664675000915608",
"118257045571675069725128316377795387797",
"234230056905104077232834006375377901991",
"138833578248901766886794087456030838129",
"199208665649511206952227175952493624705",
"70120632649301202057827638813865876325",
"270435461417604462930457339500845794474",
"4135664760235539068047535880540429655",
"47201707117176207273131661077725997958",
"146969865424531058062965435025768728249",
"301028094607068289191207729485224984956",
"110445126707644158326360370780030566615",
"329971727716315865326793392737226206409",
"116604428409469501855580364284766266157",
"57758984395388342017996697194782934033"
]
},
"deprecated": false,
"id": "CVE-2022-50469-8e8c02de",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b4573a2bad3c3e2643ef3939079eb7035a30e6ee",
"target": {
"file": "drivers/staging/rtl8723bs/os_dep/os_intfs.c"
},
"signature_version": "v1"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"179109865298419338724374682689824582438",
"7025779285177078009162018613782226722",
"76771671034367010845836597618008713515",
"30412740957362424629229957899712108849",
"24347511704892992405736179406646713895",
"167133833383002618357222159318494915898",
"180582366492928600169703813826658561314",
"191273831249903052328870298183895802624",
"249975009568412472440693884371187997248",
"226770423600360843323111439095074924232",
"219661562018566198099879139363794025028",
"260675162953833872738354684495309825646",
"252227463061157305021922810180559196330",
"121171988415093598966013585304291285404",
"158008122542506832446290593870588920854",
"34731101658390221808123683699152631147",
"142426614320235585422597323955835680980",
"169262384478838013277693941463263461039",
"147984676352109864861128388279201052769",
"63390626628180538884063139040430261480",
"184302348343886408603894330386576506840",
"142697774022309373643298098873750724486",
"237174850365512628916332409286491589054",
"168834501464008086760913664675000915608",
"118257045571675069725128316377795387797",
"234230056905104077232834006375377901991",
"138833578248901766886794087456030838129",
"199208665649511206952227175952493624705",
"70120632649301202057827638813865876325",
"270435461417604462930457339500845794474",
"4135664760235539068047535880540429655",
"47201707117176207273131661077725997958",
"146969865424531058062965435025768728249",
"301028094607068289191207729485224984956",
"110445126707644158326360370780030566615",
"329971727716315865326793392737226206409",
"116604428409469501855580364284766266157",
"57758984395388342017996697194782934033"
]
},
"deprecated": false,
"id": "CVE-2022-50469-a040cf5d",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6b2052b365f8035ab7f09ac24b5b499002b298cb",
"target": {
"file": "drivers/staging/rtl8723bs/os_dep/os_intfs.c"
},
"signature_version": "v1"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "5094682755077177446102198845796498671",
"length": 832.0
},
"deprecated": false,
"id": "CVE-2022-50469-c0981470",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6b2052b365f8035ab7f09ac24b5b499002b298cb",
"target": {
"function": "rtw_init_drv_sw",
"file": "drivers/staging/rtl8723bs/os_dep/os_intfs.c"
},
"signature_version": "v1"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "5094682755077177446102198845796498671",
"length": 832.0
},
"deprecated": false,
"id": "CVE-2022-50469-cf709996",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d95d1526d9f06978c1a7186810a5490d72c62742",
"target": {
"function": "rtw_init_drv_sw",
"file": "drivers/staging/rtl8723bs/os_dep/os_intfs.c"
},
"signature_version": "v1"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "5094682755077177446102198845796498671",
"length": 832.0
},
"deprecated": false,
"id": "CVE-2022-50469-eb37daa9",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@5a5aa9cce621e2c0e25a1e5d72d6be1749167cc0",
"target": {
"function": "rtw_init_drv_sw",
"file": "drivers/staging/rtl8723bs/os_dep/os_intfs.c"
},
"signature_version": "v1"
}
]