From: Dan Carpenter <error27@gmail.com>
To: netdev@vger.kernel.org
Cc: John Fastabend <john.r.fastabend@intel.com>,
Shmulik Ravid <shmulikr@broadcom.com>,
kernel-janitors@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>
Subject: [patch 2/2] dcb: use after free in dcb_flushapp()
Date: Wed, 5 Jan 2011 10:03:44 +0300 [thread overview]
Message-ID: <20110105070344.GB24847@bicker> (raw)
The original code has a use after free bug because it's not using the
_safe() version of the list_for_each_entry() macro.
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index 8881cb5..11bf6a2 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -1650,9 +1650,10 @@ EXPORT_SYMBOL(dcb_setapp);
static void dcb_flushapp(void)
{
struct dcb_app_type *app;
+ struct dcb_app_type *tmp;
spin_lock(&dcb_lock);
- list_for_each_entry(app, &dcb_app_list, list) {
+ list_for_each_entry_safe(app, tmp, &dcb_app_list, list) {
list_del(&app->list);
kfree(app);
}
next reply other threads:[~2011-01-05 7:04 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-05 7:03 Dan Carpenter [this message]
2011-01-06 19:17 ` [patch 2/2] dcb: use after free in dcb_flushapp() David Miller
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=20110105070344.GB24847@bicker \
--to=error27@gmail.com \
--cc=davem@davemloft.net \
--cc=john.r.fastabend@intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=shmulikr@broadcom.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).