Re: [PATCH 5/5] SCSI: fix target allocation outside of scan_mutex

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

 



On Fri, 2010-02-12 at 12:14 -0500, Alan Stern wrote:
> This patch (as1337) fixes a bug in __scsi_add_device().  It calls
> scsi_alloc_target() outside the protection of the host's scan_mutex,
> meaning that it might find an incompletely-initialized target or it
> might create a duplicate target.

I don't think this is correct.  scsi_alloc_target should be completely
atomic on the host lock, if you look.  It allocates the proposed target,
takes the lock and searches the host target list ... if it finds
something it drops the lock, destroys the proposed target allocations
and returns what it found.  If it finds nothing, it adds the proposed
target to the list drops the lock and returns it.  There's some
complexity around finding dying targets, but nothing that I think needs
to be mediated by the scan mutex.

James


--
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