lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 21 Jul 2008 18:45:54 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	adobriyan@...il.com
Cc:	agl@...erialviolet.org, netdev@...r.kernel.org
Subject: Re: Recent tcp_syn_options() buglet

From: Alexey Dobriyan <adobriyan@...il.com>
Date: Tue, 22 Jul 2008 05:40:42 +0400

> 	  CHECK   net/ipv4/tcp_output.c
> 	net/ipv4/tcp_output.c:475:7: warning: dubious: !x & y
> 
> 
> And sparse is damn right!
> 
> 	if (unlikely(!OPTION_TS & opts->options))
> 		    ^^^
> 		size += TCPOLEN_SACKPERM_ALIGNED;
> 
> OPTION_TS is (1 << 1), so condition will never trigger.

Thanks, I'll fix it like so:

tcp: Fix bitmask test in tcp_syn_options()

As reported by Alexey Dobriyan:

	  CHECK   net/ipv4/tcp_output.c
	net/ipv4/tcp_output.c:475:7: warning: dubious: !x & y

And sparse is damn right!

	if (unlikely(!OPTION_TS & opts->options))
		    ^^^
		size += TCPOLEN_SACKPERM_ALIGNED;

OPTION_TS is (1 << 1), so condition will never trigger.

Signed-off-by: David S. Miller <davem@...emloft.net>
---
 net/ipv4/tcp_output.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 1fa683c..a00532d 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -472,7 +472,7 @@ static unsigned tcp_syn_options(struct sock *sk, struct sk_buff *skb,
 	}
 	if (likely(sysctl_tcp_sack)) {
 		opts->options |= OPTION_SACK_ADVERTISE;
-		if (unlikely(!OPTION_TS & opts->options))
+		if (unlikely(!(OPTION_TS & opts->options)))
 			size += TCPOLEN_SACKPERM_ALIGNED;
 	}
 
-- 
1.5.6.4.433.g09651

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ