From: Shakil A Khan <shakilk1729@gmail.com>
To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: edumazet@google.com, davem@davemloft.net,
Shakil A Khan <shakilk1729@gmail.com>
Subject: [PATCH] Freeing dst when the reference count <0 causes general protection fault, it could be a major security flaw as rogue app can modify dst to crash kernel.
Date: Sat, 13 Sep 2014 01:27:13 -0700 [thread overview]
Message-ID: <1410596833-2548-1-git-send-email-shakilk1729@gmail.com> (raw)
Signed-off-by: Shakil A Khan <shakilk1729@gmail.com>
---
net/core/dst.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/core/dst.c b/net/core/dst.c
index a028409..6a848b0 100644
--- a/net/core/dst.c
+++ b/net/core/dst.c
@@ -284,7 +284,10 @@ void dst_release(struct dst_entry *dst)
int newrefcnt;
newrefcnt = atomic_dec_return(&dst->__refcnt);
- WARN_ON(newrefcnt < 0);
+
+ if (WARN(newrefcnt < 0, "dst reference count less than zero"))
+ return;
+
if (unlikely(dst->flags & DST_NOCACHE) && !newrefcnt)
call_rcu(&dst->rcu_head, dst_destroy_rcu);
}
--
1.9.3
next reply other threads:[~2014-09-13 8:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-13 8:27 Shakil A Khan [this message]
2014-09-13 10:13 ` [PATCH] Freeing dst when the reference count <0 causes general protection fault, it could be a major security flaw as rogue app can modify dst to crash kernel Hannes Frederic Sowa
2014-09-13 11:50 ` Eric Dumazet
2014-09-13 18:35 ` shakil A Khan
2014-09-14 3:54 ` Eric Dumazet
[not found] ` <CAGiEYNd7HEURq0vSh+MgmzG-jyWLF_8UcnbO7EeNMS_vznyX6g@mail.gmail.com>
2014-09-13 19:32 ` 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=1410596833-2548-1-git-send-email-shakilk1729@gmail.com \
--to=shakilk1729@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@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).