From: Ralf Baechle <ralf@linux-mips.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "David S. Miller" <davem@davemloft.net>,
linux-hams@vger.kernel.org, netdev@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [patch] netrom: info leak in ->getname()
Date: Tue, 23 Apr 2013 10:52:26 +0200 [thread overview]
Message-ID: <20130423085226.GB10781@linux-mips.org> (raw)
In-Reply-To: <20130423062251.GB15893@elgon.mountain>
On Tue, Apr 23, 2013 at 09:22:51AM +0300, Dan Carpenter wrote:
> The sockaddr_ax25 struct has a 3 byte hole between ->sax25_call and
> ->sax25_ndigis. I've added a memset to avoid leaking uninitialized
> stack data to userspace.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
> index 103bd70..ec0c80f 100644
> --- a/net/netrom/af_netrom.c
> +++ b/net/netrom/af_netrom.c
> @@ -834,6 +834,8 @@ static int nr_getname(struct socket *sock, struct sockaddr *uaddr,
> struct sock *sk = sock->sk;
> struct nr_sock *nr = nr_sk(sk);
>
> + memset(&sax->fsa_ax25, 0, sizeof(struct sockaddr_ax25));
> +
> lock_sock(sk);
> if (peer != 0) {
> if (sk->sk_state != TCP_ESTABLISHED) {
Good catch.
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Ralf
next prev parent reply other threads:[~2013-04-23 8:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-23 6:22 [patch] netrom: info leak in ->getname() Dan Carpenter
2013-04-23 8:52 ` Ralf Baechle [this message]
2013-07-06 6:53 ` linux-ax25 seems to be having problems Cathryn Mataga
2013-04-25 5:48 ` [patch] netrom: info leak in ->getname() 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=20130423085226.GB10781@linux-mips.org \
--to=ralf@linux-mips.org \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-hams@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).