public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
* Possible race in mlx5_ib.ko
@ 2017-08-18 15:17 Anton Volkov
       [not found] ` <64936cc7-12b2-3a8f-b6dc-54f6f7cf7d6a-ufN2psIa012HXe+LvDLADg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Anton Volkov @ 2017-08-18 15:17 UTC (permalink / raw)
  To: matanb-VPRAkNaXOzVWk0Htik3J/w, leonro-VPRAkNaXOzVWk0Htik3J/w
  Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	ldv-project-tpLiQldItUH5n4uC9ZG1Ww, Alexey Khoroshilov

Hello.

While searching for races in the Linux kernel I've come across
"drivers/infiniband/hw/mlx5/mlx5_ib.ko" module. Here are questions that 
I came up with while analyzing results. Lines are given using the info 
from Linux v4.12.

Consider the following case:

Thread 1:              Thread 2:
size_write
->remove_keys          limit_write
     ent->cur--;          if (ent->cur < ent->limit)
     (mr.c: line 234)     (mr.c: line 335)
                             err = add_keys(... ent->limit - ent->cur);

If size_write and limit_write are able to work concurrently with the 
same ent then there is a possibility of a race between the accesses to 
ent->cur. In worst case in limit_write new keys wouldn't be added. Is it 
feasible from your point of view? If so, is it a benign race or a 
serious one?

Thank you for your time.

-- Anton Volkov
Linux Verification Center, ISPRAS
web: http://linuxtesting.org
e-mail: avolkov-ufN2psIa012HXe+LvDLADg@public.gmane.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] 2+ messages in thread

end of thread, other threads:[~2017-08-20 10:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-18 15:17 Possible race in mlx5_ib.ko Anton Volkov
     [not found] ` <64936cc7-12b2-3a8f-b6dc-54f6f7cf7d6a-ufN2psIa012HXe+LvDLADg@public.gmane.org>
2017-08-20 10:15   ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox