netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
To: davem@davemloft.net, netdev@vger.kernel.org
To: sowmini.varadhan@oracle.com
Cc: sowmini.varadhan@oracle.com, santosh.shilimkar@oracle.com,
	rds-devel@oss.oracle.com
Subject: [PATCH net-next] rds: do not call ->conn_alloc with GFP_KERNEL
Date: Mon, 12 Feb 2018 15:30:38 -0800	[thread overview]
Message-ID: <1518478238-164533-1-git-send-email-sowmini.varadhan@oracle.com> (raw)

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 __rds_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: syzbot+a0564419941aaae3fe3c@syzkaller.appspotmail.com
Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Fixes: ebeeb1ad9b8a ("rds: tcp: use rds_destroy_pending() to synchronize
netns/module teardown and rds connection/workq management")
---
 net/rds/connection.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/rds/connection.c b/net/rds/connection.c
index 94e190f..d0f5889 100644
--- a/net/rds/connection.c
+++ b/net/rds/connection.c
@@ -221,6 +221,8 @@ static void __rds_conn_path_init(struct rds_connection *conn,
 		conn->c_path[i].cp_index = i;
 	}
 	rcu_read_lock();
+	gfp &= ~GFP_KERNEL;
+	gfp |= GFP_ATOMIC;
 	if (rds_destroy_pending(conn))
 		ret = -ENETDOWN;
 	else
-- 
1.7.1

             reply	other threads:[~2018-02-12 23:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-12 23:30 Sowmini Varadhan [this message]
2018-02-13 17:04 ` [PATCH net-next] rds: do not call ->conn_alloc with GFP_KERNEL David Miller
2018-02-13 17:07   ` Sowmini Varadhan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1518478238-164533-1-git-send-email-sowmini.varadhan@oracle.com \
    --to=sowmini.varadhan@oracle.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=rds-devel@oss.oracle.com \
    --cc=santosh.shilimkar@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).