media: mxl111sf: fix null pointer dereference in mxl111sf_ctrl_msg
Subsystems (2)
PATCH 1/1 media: mxl111sf: fix null pointer dereference in mxl111sf_ctrl_msg
--- drivers/media/usb/dvb-usb-v2/mxl111sf.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/media/usb/dvb-usb-v2/mxl111sf.c +3 -0
@@ -56,6 +56,9 @@ int mxl111sf_ctrl_msg(struct mxl111sf_state *state,int wo = (rbuf ==NULL || rlen ==0 );/* write-only */ int ret; +if (!d) +return -ENODEV ; +if (1 + wlen >MXL_MAX_XFER_SIZE ) {pr_warn ("%s: len=%d is too big!\n" , __func__, wlen);return -EOPNOTSUPP ;
Signature · 1 line
2.34.1
PATCH v2 1/1 media: mxl111sf: fix null pointer dereference in mxl111sf_ctrl_msg
When mxl111sf_ctrl_msg() is called during early probe, state->d may not yet be initialized, causing a null pointer dereference in dvb_usbv2_generic_write() when it accesses d->usb_mutex.
Add a null check for d before proceeding with the USB transfer.
--- drivers/media/usb/dvb-usb-v2/mxl111sf.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/media/usb/dvb-usb-v2/mxl111sf.c +3 -0
@@ -56,6 +56,9 @@ int mxl111sf_ctrl_msg(struct mxl111sf_state *state,int wo = (rbuf ==NULL || rlen ==0 );/* write-only */ int ret; +if (!d) +return -ENODEV ; +if (1 + wlen >MXL_MAX_XFER_SIZE ) {pr_warn ("%s: len=%d is too big!\n" , __func__, wlen);return -EOPNOTSUPP ;
Signature · 1 line
2.34.1
syzbot
syzbotI see the command but can't find the corresponding bug. The email is sent to [email protected] address but the HASH does not correspond to any known bug. Please double check the…
Quoted 31 lines
When
mxl111sf_ctrl_msg()is called during early probe,state->dmay not yet be initialized, causing a null pointer dereference indvb_usbv2_generic_write()when it accessesd->usb_mutex.Add a null check for d before proceeding with the USB transfer.
Fixes d90b336f3f65 ("[media] mxl111sf: Fix driver to use heap allocate buffers for USB messages")Reported-by [email protected]Signed-off-by Moksh Panicker <[email protected]>--- drivers/media/usb/dvb-usb-v2/mxl111sf.c | 3 +++ 1 file changed, 3 insertions(+)drivers/media/usb/dvb-usb-v2/mxl111sf.c +3
-0@@ -56,6 +56,9 @@ int mxl111sf_ctrl_msg(struct mxl111sf_state *state,int wo = (rbuf ==NULL || rlen ==0 );/* write-only */ int ret; +if (!d) +return -ENODEV ; +if (1 + wlen >MXL_MAX_XFER_SIZE ) {pr_warn ("%s: len=%d is too big!\n" , __func__, wlen);return -EOPNOTSUPP ;Signature · 1 line
2.34.1
I see the command but can't find the corresponding bug. The email is sent to [email protected] address but the HASH does not correspond to any known bug. Please double check the address.
PATCH v3 1/1 media: mxl111sf: fix null pointer dereference in mxl111sf_ctrl_msg
In reply to Moksh PanickerWhen mxl111sf_ctrl_msg() is called during early probe, state->d may not yet be initialized, causing a null pointer dereference in dvb_usbv2_generic_write() when it accesses d->usb_mutex.
Add a null check for d before proceeding with the USB transfer.
--- drivers/media/usb/dvb-usb-v2/mxl111sf.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/media/usb/dvb-usb-v2/mxl111sf.c +3 -0
@@ -56,6 +56,9 @@ int mxl111sf_ctrl_msg(struct mxl111sf_state *state,int wo = (rbuf ==NULL || rlen ==0 );/* write-only */ int ret; +if (!d) +return -ENODEV ; +if (1 + wlen >MXL_MAX_XFER_SIZE ) {pr_warn ("%s: len=%d is too big!\n" , __func__, wlen);return -EOPNOTSUPP ;
Signature · 1 line
2.34.1
PATCH v4 1/1 media: mxl111sf: fix null pointer dereference in mxl111sf_ctrl_msg
When mxl111sf_ctrl_msg() is called during early probe, state->d may not yet be initialized, causing a null pointer dereference in dvb_usbv2_generic_write() when it accesses d->usb_mutex.
Add a null check for d before proceeding with the USB transfer.
--- drivers/media/usb/dvb-usb-v2/mxl111sf.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/media/usb/dvb-usb-v2/mxl111sf.c +3 -0
@@ -56,6 +56,9 @@ int mxl111sf_ctrl_msg(struct mxl111sf_state *state,int wo = (rbuf ==NULL || rlen ==0 );/* write-only */ int ret; +if (!d) +return -ENODEV ; +if (1 + wlen >MXL_MAX_XFER_SIZE ) {pr_warn ("%s: len=%d is too big!\n" , __func__, wlen);return -EOPNOTSUPP ;
Signature · 1 line
2.34.1