Re: [PATCH] scsi_transport_srp: Fix shost to rport translation

2018-04-13 Thread Bart Van Assche
On Fri, 2018-04-13 at 08:11 +0200, Hannes Reinecke wrote: > On Thu, 12 Apr 2018 13:32:07 -0600 > "Bart Van Assche" wrote: > > +static int find_child_rport(struct device *dev, void *data) > > +{ > > + struct device **child = data; > > + > > + if (scsi_is_srp_rport(dev)) { > > + WARN_O

Re: [PATCH] scsi_transport_srp: Fix shost to rport translation

2018-04-12 Thread Hannes Reinecke
On Thu, 12 Apr 2018 13:32:07 -0600 "Bart Van Assche" wrote: > Since an SRP remote port is attached as a child to shost->shost_gendev > and as the only child, the translation from the shost pointer into an > rport pointer must happen by looking up the shost child that is an > rport. This patch fix

[PATCH] scsi_transport_srp: Fix shost to rport translation

2018-04-12 Thread Bart Van Assche
Since an SRP remote port is attached as a child to shost->shost_gendev and as the only child, the translation from the shost pointer into an rport pointer must happen by looking up the shost child that is an rport. This patch fixes the following KASAN complaint: BUG: KASAN: slab-out-of-bounds in s