Re: [PATCH 1/2] target: Reject SCSI data overflow for fabrics using transport_generic_map_mem_to_cmd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2011-11-16 at 08:57 -0500, Christoph Hellwig wrote:
> On Wed, Nov 16, 2011 at 08:32:20AM +0000, Nicholas A. Bellinger wrote:
> > From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
> > 
> > This patch changes transport_generic_map_mem_to_cmd() to reject SCSI data
> > overflow and to send exception status with CHECK_CONDITION + TCM_INVALID_CDB_FIELD
> > for fabrics that are passing a pre-populated struct scatterlist (eg: tcm_loop
> > and iscsi-target) being mapped into se_cmd->t_data_sg and se_cmd->t_data_nents.
> > 
> > This addresses an OOPs where transport_allocate_data_tasks() would walk
> > the incorrect post OVERFLOW cmd->data_length value beyond the end of
> > the passed scatterlist.
> 
> Maybe this is a sign that at least the iscsi target should stop
> allocating its own pages and switch back to the core allocation, which
> should be easily possible after the s/g list conversion.
> 

I started thinking about this a bit too, but got distracted with other
non iscsi-target related items..

Handling SCSI overflow properly for iscsi-target would be nice, but it's
probably not a huge item atm.  The main thing that makes this type of
conversion somewhat difficult is the immediate data handling w/o having
to take the extra context switch.

AFAICT this would be a reasonable conversion, but would have to consider
the details more.

> I also wonder if keeping this special case for tcm_loop is a good idea -
> it surely is a nice optimization, but then again tcm_loop is more a
> debugging and testing tool than something we should optimize for.
> 

Well, this is the main path for a virtio host driver as well..

--nab

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux