Re: [PATCH] SCSI: fix /proc memory leak in the SCSI core

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

 



On Mon, 1 Dec 2008, Boaz Harrosh wrote:

> Alan Stern wrote:
> > The SCSI core calls scsi_proc_hostdir_add() from within
> > scsi_host_alloc(), but the corresponding scsi_proc_hostdir_rm()
> > routine is called from within scsi_remove_host().  As a result, if a
> > host is allocated and then deallocated without ever being registered,
> > the host's directory in /proc is leaked.
> > 
> > This patch (as1181) fixes this bug in the SCSI core by moving
> > scsi_proc_hostdir_add() into scsi_host_add().
> > 
> > Signed-off-by: Alan Stern <stern@xxxxxxxxxxxxxxxxxxx>
> > 
> 
> Nice this also fixes the premature visibility of the directory
> and the theoretical races, that can cause.

I'm not so sure about that...  There's still a window in which the
directory is visible but empty; it's just smaller than before.

Besides, the window that really matters is between sending out the
uevent notification (during device_add) and populating the directory.
The patch doesn't address that problem.  Should it?

Alan Stern

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