Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Alvin Starr <alvin@iplink.net>
Subject: Firewall bug in 2.0.27 kernel
Date: Wed, 9 Apr 1997 20:41:08 -0400 (EDT)	[thread overview]
Message-ID: <031221c82df58582b268f97ad23e5b9a.axp-list@archive.invalid> (raw)

Just gotta love C for its ability to do address calculations

in "ip_fw.c" you will find
int ip_fw_chk(struct iphdr *ip, struct device *rif, __u16 *redirport, 
struct ip_fw *chain, int policy, int mode)
{
        struct ip_fw *f;
        struct tcphdr           *tcp=(struct tcphdr *)((unsigned long *)ip+ip->ihl);
        struct udphdr           *udp=(struct udphdr *)((unsigned long *)ip+ip->ihl);
        struct icmphdr          *icmp=(struct icmphdr *)((unsigned long *)ip+ip->ihl);

The problem is that the address calculation multiplies the ihl value by 8 
due to the fact that it points to an "unsigned long". This calculation 
should be infact 
	((char *)ip)+(ip->ihl<<2)

If somebody wants to tell me where to send the patch I will generate a 
patch against 2.0.27 and e-mail it out.

Alvin Starr                   ||   voice: (416)493-3325
Interlink Connectivity        ||   fax:   (416)493-7974
alvin@iplink.net              ||

--
To unsubscribe: send e-mail to axp-list-request@redhat.com with
'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com

             reply	other threads:[~1997-04-10  0:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-10  0:41 Alvin Starr [this message]
  -- strict thread matches above, loose matches on Subject: below --
1997-04-10 14:24 Firewall bug in 2.0.27 kernel Anderson, Greg
1997-04-10 15:43 ` Alvin Starr
1997-04-10 14:24 Anderson, Greg
1997-04-10 14:24 Anderson, Greg
     [not found] <Pine.OSF.3.91.970410113452.29178C-100000@caesar.iplink.net>
1997-04-10 16:30 ` Robert Drotar
1997-04-10 18:31 Anderson, Greg
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox