Re: [PATCH v2 17/36] target: Fix a reference leak in transport_cmd_check_stop_to_fabric()

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

 



On Mon, Feb 06, 2017 at 05:21:09PM +0000, Bart Van Assche wrote:
> Hello Christoph,
> 
> transport_cmd_finish_abort() skips transport_put_cmd() if
> transport_cmd_check_stop_to_fabric() returns 1 because CMD_T_STOP is
> set. The only function in kernel v4.9 that sets CMD_T_STOP is
> __transport_wait_for_tasks(). That function doesn't drop the cmd
> refcount so I think this patch really fixes a reference leak.
> 
> The reason why this has not yet been noticed is probably because in
> kernel v4.9 a few functions bypass the reference counting mechanism.
> E.g. target_wait_for_sess_cmds() and transport_generic_free_cmd() call
> .release_cmd() directly instead of calling kref_put().

So it fixes the missing drop of the reference, but probably not
a leak of the actual memoery because of the latter.  I really don't
like the way this has been handled before, so I welcome your patch
in principle.  I just need to review it very carefully as this area
is rather hairy, and good comments help with that.
--
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