Re: [PATCH V2 net-next] rds: do not call ->conn_alloc with GFP_KERNEL
From: Sowmini VaradhanDate: Tue, 13 Feb 2018 09:05:44 -0800 > 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. > > Fixes: ebeeb1ad9b8a ("rds: tcp: use rds_destroy_pending() to synchronize >netns/module teardown and rds connection/workq management") > Reported-by: syzbot+a0564419941aaae3f...@syzkaller.appspotmail.com > Signed-off-by: Sowmini Varadhan > --- > v2: do not over-engineer. Keep the gfp arg to ->conn_alloc simple. Already applied to 'net', no need to send this again.
[PATCH V2 net-next] 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. Fixes: ebeeb1ad9b8a ("rds: tcp: use rds_destroy_pending() to synchronize netns/module teardown and rds connection/workq management") Reported-by: syzbot+a0564419941aaae3f...@syzkaller.appspotmail.com Signed-off-by: Sowmini Varadhan--- v2: do not over-engineer. Keep the gfp arg to ->conn_alloc simple. net/rds/connection.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/net/rds/connection.c b/net/rds/connection.c index 94e190f..2da3176 100644 --- a/net/rds/connection.c +++ b/net/rds/connection.c @@ -224,7 +224,7 @@ static void __rds_conn_path_init(struct rds_connection *conn, 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); -- 1.7.1
Re: [PATCH V2 net-next] rds: do not call ->conn_alloc with GFP_KERNEL
On 2/13/2018 9:05 AM, Sowmini Varadhan wrote: 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. Fixes: ebeeb1ad9b8a ("rds: tcp: use rds_destroy_pending() to synchronize netns/module teardown and rds connection/workq management") Reported-by: syzbot+a0564419941aaae3f...@syzkaller.appspotmail.com Signed-off-by: Sowmini Varadhan--- Acked-by: Santosh Shilimkar