netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Emrah Demir <ed@abdsec.com>
To: linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org, isdn@linux-pingi.de, Emrah Demir <ed@abdsec.com>
Subject: [PATCH] mISDN: Fixing missing validation in base_sock_bind()
Date: Fri,  8 Apr 2016 22:16:11 +0300	[thread overview]
Message-ID: <1460142971-16459-1-git-send-email-ed@abdsec.com> (raw)

From: Emrah Demir <ed@abdsec.com>

Add validation code into mISDN/socket.c

Signed-off-by: Emrah Demir <ed@abdsec.com>
---
 drivers/isdn/mISDN/socket.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c
index 0d29b5a..99e5f97 100644
--- a/drivers/isdn/mISDN/socket.c
+++ b/drivers/isdn/mISDN/socket.c
@@ -715,6 +715,9 @@ base_sock_bind(struct socket *sock, struct sockaddr *addr, int addr_len)
 	if (!maddr || maddr->family != AF_ISDN)
 		return -EINVAL;
 
+	if (addr_len < sizeof(struct sockaddr_mISDN))
+		return -EINVAL;
+
 	lock_sock(sk);
 
 	if (_pms(sk)->dev) {
-- 
2.8.0.rc3

             reply	other threads:[~2016-04-08 19:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-08 19:16 Emrah Demir [this message]
2016-04-14  3:01 ` [PATCH] mISDN: Fixing missing validation in base_sock_bind() 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=1460142971-16459-1-git-send-email-ed@abdsec.com \
    --to=ed@abdsec.com \
    --cc=isdn@linux-pingi.de \
    --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).