mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
rds: do not call ->conn_alloc with GFP_KERNEL
Commitebeeb1ad9b("rds: tcp: use rds_destroy_pending() to synchronize netns/module teardown and rds connection/workq management") adds an rcu read critical section to __rd_conn_create. The memory allocations in that critcal section need to use GFP_ATOMIC to avoid sleeping. This patch was verified with syzkaller reproducer. Reported-by: [email protected] Fixes:ebeeb1ad9b("rds: tcp: use rds_destroy_pending() to synchronize netns/module teardown and rds connection/workq management") Signed-off-by: Sowmini Varadhan <[email protected]> Acked-by: Santosh Shilimkar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
This commit is contained in:
1 parent
f7219bf311
commit
d4014d8cc6
1 file changed
+1
-1
@@ -224,7 +224,7 @@ static struct rds_connection *__rds_conn_create(struct net *net,
|
||||
if (rds_destroy_pending(conn))
|
||||
ret = -ENETDOWN;
|
||||
else
|
||||
ret = trans->conn_alloc(conn, gfp);
|
||||
ret = trans->conn_alloc(conn, GFP_ATOMIC);
|
||||
if (ret) {
|
||||
rcu_read_unlock();
|
||||
kfree(conn->c_path);
|
||||
|
||||
Reference in new issue
Block a user