From: Frank Sorenson <sorenson@redhat.com>
To: linux-nfs@vger.kernel.org
Subject: [nfs-utils PATCH] statd: fix use-after-free in monitor list if insertion fails
Date: Sat, 1 Sep 2018 01:07:21 -0500 [thread overview]
Message-ID: <d93ed8c0-0f17-4671-a852-8cea6330f5ba@redhat.com> (raw)
If nsm_insert_monitored_host() fails while saving the record to
stable storage, we can't just assume the entry was new. Existing
records must be removed from the list before being freed.
Signed-off-by: Frank Sorenson <sorenson@redhat.com>
diff --git a/utils/statd/monitor.c b/utils/statd/monitor.c
index 45c4346..9400048 100644
--- a/utils/statd/monitor.c
+++ b/utils/statd/monitor.c
@@ -197,7 +197,7 @@ sm_mon_1_svc(struct mon *argp, struct svc_req *rqstp)
if (!nsm_insert_monitored_host(dnsname,
(struct sockaddr *)(char *)&my_addr, argp)) {
- nlist_free(NULL, clnt);
+ nlist_free(existing ? &rtnl : NULL, clnt);
goto failure;
}
next reply other threads:[~2018-09-01 10:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-01 6:07 Frank Sorenson [this message]
2018-09-05 14:10 ` [nfs-utils PATCH] statd: fix use-after-free in monitor list if insertion fails Chuck Lever
2018-09-06 14:24 ` Steve Dickson
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=d93ed8c0-0f17-4671-a852-8cea6330f5ba@redhat.com \
--to=sorenson@redhat.com \
--cc=linux-nfs@vger.kernel.org \
/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).