From: kstailey Date: Thu, 3 Apr 1997 15:46:36 +0000 (+0000) Subject: >Number: 3412 X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4169681dbf3954fdb9fffe52b9e991cc3ee367dc;p=openbsd >Number: 3412 >Category: port-alpha >Synopsis: incorrect use of long crashes netbsd/alpha >Confidential: no >Severity: serious >Priority: low >Responsible: gnats-admin (GNATS administrator) >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Sat Mar 29 23:50:01 1997 >Last-Modified: >Originator: Ross Harvey >Organization: Avalon Computer Systems, Inc. >Release: NetBSD-current >Environment: System: NetBSD epsilon.ghs.com 1.2D NetBSD 1.2D (e) #5: Sat Mar 29 22:32:33 PST 1997 ross@epsilon.ghs.com:/bsd/ross/e alpha >Description: Adding "pseudo-device ipfilter 1" to netbsd/alpha will cause it to crash when ifconfig turns on the interface. Ipfilter code in netinet/fil.c uses pointer arithmetic to effectively make structure-to-scalar casts. It uses long when it really wants an int32 and gets alignment faults that crash netbsd/alpha. General 64 bit problem, not exactly alpha. >How-To-Repeat: Add pseudo-device ipfilter 1. Boot your alpha. 2. Try to come up multiuser. The first packet or so will halt everything. >Fix: Apply patch... --- diff --git a/sys/netinet/fil.c b/sys/netinet/fil.c index cec61eb85b3..f102fd8eaa5 100644 --- a/sys/netinet/fil.c +++ b/sys/netinet/fil.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fil.c,v 1.8 1997/02/11 22:23:08 kstailey Exp $ */ +/* $OpenBSD: fil.c,v 1.9 1997/04/03 15:46:36 kstailey Exp $ */ /* * (C)opyright 1993-1996 by Darren Reed. * @@ -187,8 +187,8 @@ fr_makefrip(hlen, ip, fin) tcp = (tcphdr_t *)((char *)ip + hlen); fin->fin_dp = (void *)tcp; (*(((u_short *)fi) + 1)) = (*(((u_short *)ip) + 4)); - (*(((u_long *)fi) + 1)) = (*(((u_long *)ip) + 3)); - (*(((u_long *)fi) + 2)) = (*(((u_long *)ip) + 4)); + (*(((u_int32_t *)fi) + 1)) = (*(((u_int32_t *)ip) + 3)); + (*(((u_int32_t *)fi) + 2)) = (*(((u_int32_t *)ip) + 4)); fi->fi_fl = (hlen > sizeof(struct ip)) ? FI_OPTIONS : 0; off = (ip->ip_off & 0x1fff) << 3;