From: David Miller <davem@davemloft.net>
To: meissner@suse.de
Cc: netdev@vger.kernel.org, max@suse.de
Subject: Re: Bad behaviour when unintentionally mixing ipv4 and ipv6 addresses
Date: Wed, 01 Jun 2011 21:03:59 -0700 (PDT) [thread overview]
Message-ID: <20110601.210359.2079286191194442010.davem@davemloft.net> (raw)
In-Reply-To: <20110525155918.GA27869@suse.de>
From: Marcus Meissner <meissner@suse.de>
Date: Wed, 25 May 2011 17:59:18 +0200
> @@ -465,6 +465,9 @@ int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
> if (addr_len < sizeof(struct sockaddr_in))
> goto out;
>
> + if (addr->sin_family != AF_INET)
> + goto out;
> +
> chk_addr_ret = inet_addr_type(sock_net(sk), addr->sin_addr.s_addr);
Since we haven't been validating the sin_family field for 18+ years, the
chance to break some applications is very real.
But I think it's more important to fix this (and force any broken apps
to set sin_family correctly). So I will apply this, thanks.
next prev parent reply other threads:[~2011-06-02 4:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-25 15:59 Bad behaviour when unintentionally mixing ipv4 and ipv6 addresses Marcus Meissner
2011-06-02 4:03 ` David Miller [this message]
2011-06-06 13:47 ` Reinhard Max
2011-06-06 16:00 ` [PATCH] net/ipv6: check for mistakenly passed in non-AF_INET6 sockaddrs Marcus Meissner
2011-06-06 21:48 ` David Miller
2011-06-07 7:25 ` Reinhard Max
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=20110601.210359.2079286191194442010.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=max@suse.de \
--cc=meissner@suse.de \
--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).