Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1715244 > unrolled thread

Possible race in mlx5_ib.ko

Started byAnton Volkov <avolkov@ispras.ru>
First post2017-08-18 17:20 +0200
Last post2017-08-18 17:20 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  Possible race in mlx5_ib.ko Anton Volkov <avolkov@ispras.ru> - 2017-08-18 17:20 +0200

#1715244 — Possible race in mlx5_ib.ko

FromAnton Volkov <avolkov@ispras.ru>
Date2017-08-18 17:20 +0200
SubjectPossible race in mlx5_ib.ko
Message-ID<ufRe2-5vQ-29@gated-at.bofh.it>
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@ispras.ru

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web