Files
android_kernel_xiaomi_sm8450/net/rds
Andy Grover 86357b19bc RDS: Fix potential race around rds_i[bw]_allocation
"At rds_ib_recv_refill_one(), it first executes atomic_read(&rds_ib_allocation)
for if-condition checking,

and then executes atomic_inc(&rds_ib_allocation) if the condition was
not satisfied.

However, if any other code which updates rds_ib_allocation executes
between these two atomic operation executions,
it seems that it may result race condition. (especially when
rds_ib_allocation + 1 == rds_ib_sysctl_max_recv_allocation)"

This patch fixes this by using atomic_inc_unless to eliminate the
possibility of allocating more than rds_ib_sysctl_max_recv_allocation
and then decrementing the count if the allocation fails. It also
makes an identical change to the iwarp transport.

Reported-by: Shin Hong <hongshin@gmail.com>
Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-30 15:06:38 -07:00
..
2009-10-30 15:06:37 -07:00
2009-08-23 19:13:07 -07:00
2009-08-23 19:13:07 -07:00
2009-08-23 19:13:07 -07:00
2009-02-26 23:39:25 -08:00
2009-02-26 23:39:33 -08:00
2009-02-26 23:39:26 -08:00
2009-02-26 23:39:26 -08:00
2009-08-23 19:13:07 -07:00
2009-10-30 15:06:37 -07:00
2009-10-30 15:06:37 -07:00
2009-08-23 19:13:07 -07:00
2009-08-23 19:13:07 -07:00
2009-08-23 19:13:07 -07:00
2009-02-26 23:39:26 -08:00
2009-08-23 19:13:02 -07:00
2009-08-23 19:13:02 -07:00
2009-08-23 19:13:02 -07:00
2009-08-23 19:13:02 -07:00
2009-08-23 19:13:02 -07:00
2009-08-23 19:13:07 -07:00