1: 84f6daead10e ! 1: 1467070b3d98 wifi: mwifiex: validate ext_scan buf_size against event buffer length @@ ## Metadata ## -Author: Tristan Madani  +Author: Tristan Madani   ## Commit message ## wifi: mwifiex: validate ext_scan buf_size against event buffer length 2: 8648109c1b23 ! 2: 53fce7639538 wifi: mwifiex: validate command response size against buffer length @@ ## Metadata ## -Author: Tristan Madani  +Author: Tristan Madani   ## Commit message ## wifi: mwifiex: validate command response size against buffer length @@ Commit message response buffer length. A firmware response with an inflated size field causes subsequent handlers to read past the buffer.  - Add a check early in command response processing that validates the - declared response size fits within the response skb. + Add a check in command response processing that validates the declared + response size fits within the response skb.  Fixes: 5e6e3a92b9a4 ("wireless: mwifiex: initial commit for Marvell mwifiex driver") Cc: stable@vger.kernel.org @@ Commit message  ## drivers/net/wireless/marvell/mwifiex/cmdevt.c ##  @@ drivers/net/wireless/marvell/mwifiex/cmdevt.c: int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter) - orig_cmdresp_no = le16_to_cpu(resp->command); - cmdresp_no = (orig_cmdresp_no & HostCmd_CMD_ID_MASK); + timer_delete_sync(&adapter->cmd_timer); + clear_bit(MWIFIEX_IS_CMD_TIMEDOUT, &adapter->work_flags);   + if (le16_to_cpu(resp->size) > adapter->curr_cmd->resp_skb->len) {  + mwifiex_dbg(adapter, ERROR, @@ drivers/net/wireless/marvell/mwifiex/cmdevt.c: int mwifiex_process_cmdresp(struc  + return -1;  + }  + - if (adapter->curr_cmd->cmd_no != cmdresp_no) { - mwifiex_dbg(adapter, ERROR, - "cmdresp error: cmd=0x%x cmd_resp=0x%x\n", + if (adapter->curr_cmd->cmd_flag & CMD_F_HOSTCMD) { + /* Copy original response back to response buffer */ + struct mwifiex_ds_misc_cmd *hostcmd;