From: Dan Rosenberg <drosenberg@vsecurity.com>
To: chas@cmf.nrl.navy.mil, davem@davemloft.net, kuznet@ms2.inr.ac.ru,
pekkas@netcore.fi, jmorris@namei.org, yoshfuji@linux-ipv6.org,
kaber@trash.net, remi.denis-courmont@nokia.com
Cc: netdev@vger.kernel.org, security@kernel.org, stable@kernel.org
Subject: [PATCH 3/9] Fix leaking of kernel heap addresses in net/
Date: Sun, 07 Nov 2010 11:31:48 -0500 [thread overview]
Message-ID: <1289147508.3090.140.camel@Dan> (raw)
Signed-off-by: Dan Rosenberg <drosenberg@vsecurity.com>
diff -urp linux-2.6.37-rc1.orig/net/ipv4/af_inet.c linux-2.6.37-rc1/net/ipv4/af_inet.c
--- linux-2.6.37-rc1.orig/net/ipv4/af_inet.c 2010-11-01 07:54:12.000000000 -0400
+++ linux-2.6.37-rc1/net/ipv4/af_inet.c 2010-11-07 10:31:41.000000000 -0500
@@ -139,12 +139,13 @@ void inet_sock_destruct(struct sock *sk)
sk_mem_reclaim(sk);
if (sk->sk_type == SOCK_STREAM && sk->sk_state != TCP_CLOSE) {
- pr_err("Attempt to release TCP socket in state %d %p\n",
- sk->sk_state, sk);
+ pr_err("Attempt to release TCP socket in state %d %lu\n",
+ sk->sk_state, sock_i_ino(sk));
return;
}
if (!sock_flag(sk, SOCK_DEAD)) {
- pr_err("Attempt to release alive inet socket %p\n", sk);
+ pr_err("Attempt to release alive inet socket %lu\n",
+ sock_i_ino(sk));
return;
}
diff -urp linux-2.6.37-rc1.orig/net/ipv4/raw.c linux-2.6.37-rc1/net/ipv4/raw.c
--- linux-2.6.37-rc1.orig/net/ipv4/raw.c 2010-11-01 07:54:12.000000000 -0400
+++ linux-2.6.37-rc1/net/ipv4/raw.c 2010-11-07 10:15:44.000000000 -0500
@@ -949,12 +949,12 @@ static void raw_sock_seq_show(struct seq
srcp = inet->inet_num;
seq_printf(seq, "%4d: %08X:%04X %08X:%04X"
- " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p %d\n",
+ " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %d %d\n",
i, src, srcp, dest, destp, sp->sk_state,
sk_wmem_alloc_get(sp),
sk_rmem_alloc_get(sp),
0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp),
- atomic_read(&sp->sk_refcnt), sp, atomic_read(&sp->sk_drops));
+ atomic_read(&sp->sk_refcnt), 0, atomic_read(&sp->sk_drops));
}
static int raw_seq_show(struct seq_file *seq, void *v)
diff -urp linux-2.6.37-rc1.orig/net/ipv4/tcp_ipv4.c linux-2.6.37-rc1/net/ipv4/tcp_ipv4.c
--- linux-2.6.37-rc1.orig/net/ipv4/tcp_ipv4.c 2010-11-01 07:54:12.000000000 -0400
+++ linux-2.6.37-rc1/net/ipv4/tcp_ipv4.c 2010-11-07 10:15:21.000000000 -0500
@@ -2389,7 +2389,7 @@ static void get_openreq4(struct sock *sk
int ttd = req->expires - jiffies;
seq_printf(f, "%4d: %08X:%04X %08X:%04X"
- " %02X %08X:%08X %02X:%08lX %08X %5d %8d %u %d %p%n",
+ " %02X %08X:%08X %02X:%08lX %08X %5d %8d %u %d %d%n",
i,
ireq->loc_addr,
ntohs(inet_sk(sk)->inet_sport),
@@ -2404,7 +2404,7 @@ static void get_openreq4(struct sock *sk
0, /* non standard timer */
0, /* open_requests have no inode */
atomic_read(&sk->sk_refcnt),
- req,
+ 0,
len);
}
@@ -2444,7 +2444,7 @@ static void get_tcp4_sock(struct sock *s
rx_queue = max_t(int, tp->rcv_nxt - tp->copied_seq, 0);
seq_printf(f, "%4d: %08X:%04X %08X:%04X %02X %08X:%08X %02X:%08lX "
- "%08X %5d %8d %lu %d %p %lu %lu %u %u %d%n",
+ "%08X %5d %8d %lu %d %d %lu %lu %u %u %d%n",
i, src, srcp, dest, destp, sk->sk_state,
tp->write_seq - tp->snd_una,
rx_queue,
@@ -2454,7 +2454,7 @@ static void get_tcp4_sock(struct sock *s
sock_i_uid(sk),
icsk->icsk_probes_out,
sock_i_ino(sk),
- atomic_read(&sk->sk_refcnt), sk,
+ atomic_read(&sk->sk_refcnt), 0,
jiffies_to_clock_t(icsk->icsk_rto),
jiffies_to_clock_t(icsk->icsk_ack.ato),
(icsk->icsk_ack.quick << 1) | icsk->icsk_ack.pingpong,
@@ -2479,10 +2479,10 @@ static void get_timewait4_sock(struct in
srcp = ntohs(tw->tw_sport);
seq_printf(f, "%4d: %08X:%04X %08X:%04X"
- " %02X %08X:%08X %02X:%08lX %08X %5d %8d %d %d %p%n",
+ " %02X %08X:%08X %02X:%08lX %08X %5d %8d %d %d %d%n",
i, src, srcp, dest, destp, tw->tw_substate, 0, 0,
3, jiffies_to_clock_t(ttd), 0, 0, 0, 0,
- atomic_read(&tw->tw_refcnt), tw, len);
+ atomic_read(&tw->tw_refcnt), 0, len);
}
#define TMPSZ 150
diff -urp linux-2.6.37-rc1.orig/net/ipv4/udp.c linux-2.6.37-rc1/net/ipv4/udp.c
--- linux-2.6.37-rc1.orig/net/ipv4/udp.c 2010-11-01 07:54:12.000000000 -0400
+++ linux-2.6.37-rc1/net/ipv4/udp.c 2010-11-07 10:11:07.000000000 -0500
@@ -2046,12 +2046,12 @@ static void udp4_format_sock(struct sock
__u16 srcp = ntohs(inet->inet_sport);
seq_printf(f, "%5d: %08X:%04X %08X:%04X"
- " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p %d%n",
+ " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %d %d%n",
bucket, src, srcp, dest, destp, sp->sk_state,
sk_wmem_alloc_get(sp),
sk_rmem_alloc_get(sp),
0, 0L, 0, sock_i_uid(sp), 0, sock_i_ino(sp),
- atomic_read(&sp->sk_refcnt), sp,
+ atomic_read(&sp->sk_refcnt), 0,
atomic_read(&sp->sk_drops), len);
}
next reply other threads:[~2010-11-07 16:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-07 16:31 Dan Rosenberg [this message]
2010-11-07 17:11 ` [PATCH 3/9] Fix leaking of kernel heap addresses in net/ Eric Dumazet
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=1289147508.3090.140.camel@Dan \
--to=drosenberg@vsecurity.com \
--cc=chas@cmf.nrl.navy.mil \
--cc=davem@davemloft.net \
--cc=jmorris@namei.org \
--cc=kaber@trash.net \
--cc=kuznet@ms2.inr.ac.ru \
--cc=netdev@vger.kernel.org \
--cc=pekkas@netcore.fi \
--cc=remi.denis-courmont@nokia.com \
--cc=security@kernel.org \
--cc=stable@kernel.org \
--cc=yoshfuji@linux-ipv6.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.