linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] IB/hfi1: might sleep under spinlock in hfi1_ioctl()
@ 2015-10-30 21:32 Alexey Khoroshilov
       [not found] ` <1446240749-5003-1-git-send-email-khoroshilov-ufN2psIa012HXe+LvDLADg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey Khoroshilov @ 2015-10-30 21:32 UTC (permalink / raw)
  To: Mike Marciniszyn
  Cc: Alexey Khoroshilov, Doug Ledford, Sean Hefty, Hal Rosenstock,
	Greg Kroah-Hartman, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	ldv-project-tpLiQldItUH5n4uC9ZG1Ww

Hello,

hfi1_ioctl() contains many calls to might sleep functions with
dd->hfi1_snoop.snoop_lock spinlock held (for example, access_ok,
copy_from_user, kzalloc(GFP_KERNEL), etc.).

Should dd->hfi1_snoop.snoop_lock be acquired just before updating state?

Found by Linux Driver Verification project (linuxtesting.org).

--
Alexey Khoroshilov
Linux Verification Center, ISPRAS
web: http://linuxtesting.org

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG] IB/hfi1: might sleep under spinlock in hfi1_ioctl()
       [not found] ` <1446240749-5003-1-git-send-email-khoroshilov-ufN2psIa012HXe+LvDLADg@public.gmane.org>
@ 2015-10-30 23:58   ` ira.weiny
       [not found]     ` <20151030235817.GA13800-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: ira.weiny @ 2015-10-30 23:58 UTC (permalink / raw)
  To: Alexey Khoroshilov
  Cc: Mike Marciniszyn, Doug Ledford, Sean Hefty, Hal Rosenstock,
	Greg Kroah-Hartman, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	ldv-project-tpLiQldItUH5n4uC9ZG1Ww

On Sat, Oct 31, 2015 at 12:32:29AM +0300, Alexey Khoroshilov wrote:
> Hello,
> 
> hfi1_ioctl() contains many calls to might sleep functions with
> dd->hfi1_snoop.snoop_lock spinlock held (for example, access_ok,
> copy_from_user, kzalloc(GFP_KERNEL), etc.).
> 
> Should dd->hfi1_snoop.snoop_lock be acquired just before updating state?

I believe you are correct.

I am currently in the process of pushing fixes to the staging tree.

We have a patch which fixes this queued up but it depends on at least one other
patch in my queue.

I will do my best to get this submitted soon.

Thanks,
Ira

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [BUG] IB/hfi1: might sleep under spinlock in hfi1_ioctl()
       [not found]     ` <20151030235817.GA13800-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
@ 2015-11-11  5:53       ` ira.weiny
  0 siblings, 0 replies; 3+ messages in thread
From: ira.weiny @ 2015-11-11  5:53 UTC (permalink / raw)
  To: Alexey Khoroshilov
  Cc: Mike Marciniszyn, Doug Ledford, Sean Hefty, Hal Rosenstock,
	Greg Kroah-Hartman, linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	ldv-project-tpLiQldItUH5n4uC9ZG1Ww

On Fri, Oct 30, 2015 at 07:58:18PM -0400, ira. weiny wrote:
> On Sat, Oct 31, 2015 at 12:32:29AM +0300, Alexey Khoroshilov wrote:
> > Hello,
> > 
> > hfi1_ioctl() contains many calls to might sleep functions with
> > dd->hfi1_snoop.snoop_lock spinlock held (for example, access_ok,
> > copy_from_user, kzalloc(GFP_KERNEL), etc.).
> > 
> > Should dd->hfi1_snoop.snoop_lock be acquired just before updating state?
> 
> I believe you are correct.
> 
> I am currently in the process of pushing fixes to the staging tree.
> 
> We have a patch which fixes this queued up but it depends on at least one other
> patch in my queue.
> 
> I will do my best to get this submitted soon.

I have just posted a series which addresses this problem as well as doing
general clean up on hfi1_ioctl.  The specific fix is contained in this patch.

[PATCH 7/8] staging/rdma/hfi1: Reduce snoop locking scope in IOCTL handler.

Thanks for the report,
Ira

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-11-11  5:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-30 21:32 [BUG] IB/hfi1: might sleep under spinlock in hfi1_ioctl() Alexey Khoroshilov
     [not found] ` <1446240749-5003-1-git-send-email-khoroshilov-ufN2psIa012HXe+LvDLADg@public.gmane.org>
2015-10-30 23:58   ` ira.weiny
     [not found]     ` <20151030235817.GA13800-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2015-11-11  5:53       ` ira.weiny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).