mbox series

[v4,0/4] target: fix NULL pointer dereference

Message ID 1591559913-8388-1-git-send-email-sudhakar.panneerselvam@oracle.com (mailing list archive)
Headers show
Series target: fix NULL pointer dereference | expand

Message

Sudhakar Panneerselvam June 7, 2020, 7:58 p.m. UTC
The following set of commits address a NULL pointer dereference and some
refactoring around this issue.

v4:
 - initialize the LUN in transport_init_se_cmd()

v3:
 - fix NULL pointer dereference when cdb initialization fails

v2:
 - new helper is named as target_cmd_init_cdb()
 - existing function, target_setup_cmd_from_cdb is renamed as
   target_cmd_parse_cdb()

Sudhakar Panneerselvam (4):
  target: factor out a new helper, target_cmd_init_cdb()
  target: initialize LUN in transport_init_se_cmd().
  target: fix NULL pointer dereference
  target: rename target_setup_cmd_from_cdb() to target_cmd_parse_cdb()

 drivers/target/iscsi/iscsi_target.c    | 29 ++++++++++--------
 drivers/target/target_core_device.c    | 19 +++++-------
 drivers/target/target_core_tmr.c       |  4 +--
 drivers/target/target_core_transport.c | 55 ++++++++++++++++++++++++++--------
 drivers/target/target_core_xcopy.c     |  9 ++++--
 drivers/usb/gadget/function/f_tcm.c    |  6 ++--
 include/target/target_core_fabric.h    |  9 +++---
 7 files changed, 83 insertions(+), 48 deletions(-)

Comments

Mike Christie June 7, 2020, 8:37 p.m. UTC | #1
On 6/7/20 2:58 PM, Sudhakar Panneerselvam wrote:
> The following set of commits address a NULL pointer dereference and some
> refactoring around this issue.
> 
> v4:
>   - initialize the LUN in transport_init_se_cmd()
> 
> v3:
>   - fix NULL pointer dereference when cdb initialization fails
> 
> v2:
>   - new helper is named as target_cmd_init_cdb()
>   - existing function, target_setup_cmd_from_cdb is renamed as
>     target_cmd_parse_cdb()
> 
> Sudhakar Panneerselvam (4):
>    target: factor out a new helper, target_cmd_init_cdb()
>    target: initialize LUN in transport_init_se_cmd().
>    target: fix NULL pointer dereference
>    target: rename target_setup_cmd_from_cdb() to target_cmd_parse_cdb()
> 
>   drivers/target/iscsi/iscsi_target.c    | 29 ++++++++++--------
>   drivers/target/target_core_device.c    | 19 +++++-------
>   drivers/target/target_core_tmr.c       |  4 +--
>   drivers/target/target_core_transport.c | 55 ++++++++++++++++++++++++++--------
>   drivers/target/target_core_xcopy.c     |  9 ++++--
>   drivers/usb/gadget/function/f_tcm.c    |  6 ++--
>   include/target/target_core_fabric.h    |  9 +++---
>   7 files changed, 83 insertions(+), 48 deletions(-)
> 

Reviewed-by: Mike Christie <michael.christie@oracle.com>
Martin K. Petersen June 10, 2020, 2:02 a.m. UTC | #2
On Sun, 7 Jun 2020 19:58:29 +0000, Sudhakar Panneerselvam wrote:

> The following set of commits address a NULL pointer dereference and some
> refactoring around this issue.
> 
> v4:
>  - initialize the LUN in transport_init_se_cmd()
> 
> v3:
>  - fix NULL pointer dereference when cdb initialization fails
> 
> [...]

Applied to 5.8/scsi-queue, thanks!

[1/4] scsi: target: Factor out a new helper, target_cmd_init_cdb()
      https://git.kernel.org/mkp/scsi/c/f98c2ddf8ba3
[2/4] scsi: target: Initialize LUN in transport_init_se_cmd()
      https://git.kernel.org/mkp/scsi/c/a36840d80027
[3/4] scsi: target: Fix NULL pointer dereference
      https://git.kernel.org/mkp/scsi/c/9e95fb805dc0
[4/4] scsi: target: Rename target_setup_cmd_from_cdb() to target_cmd_parse_cdb()
      https://git.kernel.org/mkp/scsi/c/987db58737e2