Re: [PATCH] SCSI: fix unsafe operations related to sshdr in scsi_test_unit_ready()

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

 



On Tue, 14 Sep 2010 09:47:05 -0500
James Bottomley <James.Bottomley@xxxxxxx> wrote:

> On Tue, 2010-09-14 at 21:26 +0800, Hillf Danton wrote:
> > The kzalloc for sshdr is replaced with sshdr struct on stack, then it
> > looks safer.
> 
> This premise is completely wrong.  There are lots of times stack can be
> wrong for driver code especially: DMA or aligment but for general code,

This patch looks fine about DMA because scsi_execute_req() doesn't do
DMA with sshdr. scsi_execute_req() allocates a buffer for DMA with
kzalloc.


> since we went to 4k stacks we have very little space; a lot of arrays
> and structures got moved to kmalloc to reduce stack consumption.

Yes but scsi_sense_hdr is just 8 bytes so I think that this conversion
could be fine. Actually, I sent a patch to do the same long ago.
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux