]> git.itanic.dy.fi Git - linux-stable/commit
staging: rtl8712: fix use after free bugs
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 30 Aug 2022 14:55:07 +0000 (17:55 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 15 Sep 2022 10:17:03 +0000 (12:17 +0200)
commit9fd6170c5e2d0ccd027abe26f6f5ffc528e1bb27
treefd7bd9218211ce17abb2a7ee66c145e0868ff388
parente4979655a80f50261ffd612c1b4c08a9df7aa37a
staging: rtl8712: fix use after free bugs

commit e230a4455ac3e9b112f0367d1b8e255e141afae0 upstream.

_Read/Write_MACREG callbacks are NULL so the read/write_macreg_hdl()
functions don't do anything except free the "pcmd" pointer.  It
results in a use after free.  Delete them.

Fixes: 2865d42c78a9 ("staging: r8712u: Add the new driver to the mainline kernel")
Cc: stable <stable@kernel.org>
Reported-by: Zheng Wang <hackerzheng666@gmail.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/Yw4ASqkYcUhUfoY2@kili
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8712/rtl8712_cmd.c