From: Matthias Dellweg <2500@gmx.de>
To: David Miller <davem@davemloft.net>
Cc: Peter Lieven <pl@dlh.net>,
sparclinux@vger.kernel.org, alan@lxorguk.ukuu.org.uk,
torvalds@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: PATCH: tcp rfc 2385 security/bugfix for sparc64
Date: Tue, 16 Oct 2007 18:47:56 +0200 [thread overview]
Message-ID: <200710161848.18443.2500@gmx.de> (raw)
Hi David,
while reviewing the tcp_md5-related code further i came across with another
two of these casts which you probably have missed. I don't actually think
that they impose a problem by now, but as you said we should remove them.
Matthias
--- linux-2.6.23.1.orig/net/ipv4/tcp_ipv4.c 2007-10-16 17:25:05.000000000 +0200
+++ linux-2.6.23.1/net/ipv4/tcp_ipv4.c 2007-10-16 17:50:05.000000000 +0200
@@ -857,16 +857,16 @@ int tcp_v4_md5_do_add(struct sock *sk, _
u8 *newkey, u8 newkeylen)
{
/* Add Key to the list */
- struct tcp4_md5sig_key *key;
+ struct tcp_md5sig_key *key;
struct tcp_sock *tp = tcp_sk(sk);
struct tcp4_md5sig_key *keys;
- key = (struct tcp4_md5sig_key *)tcp_v4_md5_do_lookup(sk, addr);
+ key = tcp_v4_md5_do_lookup(sk, addr);
if (key) {
/* Pre-existing entry - just update that one. */
- kfree(key->base.key);
- key->base.key = newkey;
- key->base.keylen = newkeylen;
+ kfree(key->key);
+ key->key = newkey;
+ key->keylen = newkeylen;
} else {
struct tcp_md5sig_info *md5sig;
--- linux-2.6.23.1.orig/net/ipv6/tcp_ipv6.c 2007-10-16 17:47:57.000000000 +0200
+++ linux-2.6.23.1/net/ipv6/tcp_ipv6.c 2007-10-16 17:49:25.000000000 +0200
@@ -560,16 +560,16 @@ static int tcp_v6_md5_do_add(struct sock
char *newkey, u8 newkeylen)
{
/* Add key to the list */
- struct tcp6_md5sig_key *key;
+ struct tcp_md5sig_key *key;
struct tcp_sock *tp = tcp_sk(sk);
struct tcp6_md5sig_key *keys;
- key = (struct tcp6_md5sig_key*) tcp_v6_md5_do_lookup(sk, peer);
+ key = tcp_v6_md5_do_lookup(sk, peer);
if (key) {
/* modify existing entry - just update that one */
- kfree(key->base.key);
- key->base.key = newkey;
- key->base.keylen = newkeylen;
+ kfree(key->key);
+ key->key = newkey;
+ key->keylen = newkeylen;
} else {
/* reallocate new list if current one is full. */
if (!tp->md5sig_info) {
Signed-off-by: Matthias M. Dellweg <2500@gmx.de>
next reply other threads:[~2007-10-16 16:48 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-16 16:47 Matthias Dellweg [this message]
2007-10-30 3:51 ` PATCH: tcp rfc 2385 security/bugfix for sparc64 David Miller
-- strict thread matches above, loose matches on Subject: below --
2007-09-28 20:42 Peter Lieven
2007-09-28 21:20 ` David Miller
2007-09-28 21:30 ` 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=200710161848.18443.2500@gmx.de \
--to=2500@gmx.de \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=pl@dlh.net \
--cc=sparclinux@vger.kernel.org \
--cc=torvalds@linux-foundation.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