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] [thread-next>] [day] [month] [year] [list]
Message-Id: <200803041403.20414.paul.moore@hp.com>
Date:	Tue, 4 Mar 2008 14:03:20 -0500
From:	Paul Moore <paul.moore@...com>
To:	"Denis V. Lunev" <den@...nvz.org>
Cc:	davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH 1/3 net-2.6.26] [IPV4]: Remove unnecessary check for opt->is_data in ip_options_compile.

On Tuesday 04 March 2008 7:22:04 am Denis V. Lunev wrote:
> There is the only way to reach ip_options compile with opt != NULL:
>
> ip_options_get_finish
>     opt->is_data = 1;
>     ip_options_compile(opt, NULL)
>
> So, checking for is_data inside opt != NULL branch is not needed.
>
> Signed-off-by: Denis V. Lunev <den@...nvz.org>
> ---
>  net/ipv4/ip_options.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c
> index baaedd9..d03eec6 100644
> --- a/net/ipv4/ip_options.c
> +++ b/net/ipv4/ip_options.c
> @@ -267,8 +267,7 @@ int ip_options_compile(struct ip_options * opt,
> struct sk_buff * skb) optptr = iph + sizeof(struct iphdr);
>  		opt->is_data = 0;
>  	} else {
> -		optptr = opt->is_data ? opt->__data :
> -					(unsigned char *)&(ip_hdr(skb)[1]);
> +		optptr = opt->__data;
>  		iph = optptr - sizeof(struct iphdr);
>  	}

I personally think this patch should be combined with path #2; if we 
aren't going to honor the 'is_data' field we shouldn't give any callers 
false hope.

-- 
paul moore
linux security @ hp
--
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