mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [BUG] IB/hfi1: might sleep under spinlock in hfi1_ioctl()
@ 2015-10-30 21:32 Alexey Khoroshilov
  2015-10-30 23:58 ` ira.weiny
  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, devel, linux-kernel, ldv-project

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


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

* Re: [BUG] IB/hfi1: might sleep under spinlock in hfi1_ioctl()
  2015-10-30 21:32 [BUG] IB/hfi1: might sleep under spinlock in hfi1_ioctl() Alexey Khoroshilov
@ 2015-10-30 23:58 ` ira.weiny
  2015-11-11  5:53   ` ira.weiny
  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, devel, linux-kernel, ldv-project

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


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

* Re: [BUG] IB/hfi1: might sleep under spinlock in hfi1_ioctl()
  2015-10-30 23:58 ` ira.weiny
@ 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, devel, linux-kernel, ldv-project

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


^ 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
2015-10-30 23:58 ` ira.weiny
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

Powered by JetHome