Re: SCSI breakage on non-cache coherent architectures



On Mon, Nov 19, 2007 at 04:35:23PM +1100, Benjamin Herrenschmidt wrote:
The other one I'm hitting now is that the SCSI layer nowadays embeds the

'nowadays'? It has always been so.

sense_buffer inside the scsi_cmnd structure without any kind of
alignment whatsoever. I've been hitting irregulary is a crash on SCSI command
completion that seems to be related to corruption of the "request"
pointer in struct scsi_cmnd and I think it might be the cause.
I'm now trying to setup a proper repro-case.

What other drivers do is DMA to their own allocation and then memcpy to
the sense buffer.

There is a movement to allocate the sense data as its own sg list, but
I don't think that patch has even been posted yet.

--
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • Re: [PATCH 03/13] scsi: unify allocation of scsi command and sense buffer
    ... Jens Axboe wrote: ... This sense buffer one is just one of many, ... the separated sense buffer allocation. ... the sense buffer in the command by doing the right alignment, ...
    (Linux-Kernel)
  • Re: [PATCH 03/13] scsi: unify allocation of scsi command and sense buffer
    ... Jens Axboe wrote: ... This sense buffer one is just one of many, ... the separated sense buffer allocation. ... The ->alloc_cmdapproach will be easier to do with an inline ...
    (Linux-Kernel)
  • Re: [PATCH 03/13] scsi: unify allocation of scsi command and sense buffer
    ... James didn't like it so I wrote the current code. ... This sense buffer one is just one of many, ... the separated sense buffer allocation. ... the sense buffer in the command by doing the right alignment, ...
    (Linux-Kernel)
  • Re: Current tools for finding memory overwrites
    ... Fair enough, the whole problem with memory corruptions is that you can only detect a corruption in the area around a memory allocation, not the allocation itself (because it may be a valid write - the only people that can detect a corruption of data in an object are the people that wrote the object, by writing a function for integrity testing and calling it at regular intervals). ... Plus if you know where the data is getting knobbled, the analysis tab coupled with the Allocation History settings can be useful for finding references to your object that also reference parts of previously deleted objects. ...
    (microsoft.public.win32.programmer.tools)
  • Re: [PATCH 03/13] scsi: unify allocation of scsi command and sense buffer
    ... Jens Axboe wrote: ... This sense buffer one is just one of many, ... the separated sense buffer allocation. ... BTW, only alignment is not enough (Boaz didn't point out it, I ...
    (Linux-Kernel)