rds: do not call ->conn_alloc with GFP_KERNEL
authorSowmini Varadhan <[email protected]>
Tue, 13 Feb 2018 17:46:16 +0000 (09:46 -0800)
committerDavid S. Miller <[email protected]>
Tue, 13 Feb 2018 18:52:02 +0000 (13:52 -0500)
commitd4014d8cc6dfa964e3e66df525de2384e3583018
tree7571e6aa6e2a1025c33735300cc8dbd3c8996789
parentf7219bf31122e2f70887ed48ba7c4c15dad45da0
rds: do not call ->conn_alloc with GFP_KERNEL

Commit ebeeb1ad9b8a ("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: ebeeb1ad9b8a ("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]>
net/rds/connection.c