Re: 5.1-RELEASE TODO

From: Bernd Walter <ticso_at_cicely12.cicely.de>
Date: Mon, 2 Jun 2003 15:28:48 +0200
On Sun, Jun 01, 2003 at 03:00:09PM +0200, Bernd Walter wrote:
> On Sun, Jun 01, 2003 at 02:26:34AM -0700, Luigi Rizzo wrote:
> > On Sun, Jun 01, 2003 at 03:32:56AM +0200, Bernd Walter wrote:
> > ...
> > > :)
> > > And I hoped a programmer who knows the source could find out and fix
> > > very quickly.
> > 
> > sorry, i missed the offending line number in your previous email.
> > 
> > I think i missed a & in all the first arguments to bcopy in
> > the src/sbin/ipfw2.c changes :(
> > 
> > this happens at lines 818, 1224, 1461 and 1701. Fortunately
> > the kernel part seems correct.
> > 
> > In detail, the fix should be the following:
> > 
> > 818:
> > -       bcopy(rule->next_rule, &set_disable, sizeof(set_disable));
> > +       bcopy(&rule->next_rule, &set_disable, sizeof(set_disable));
> > 
> > 1224:
> > -       bcopy(d->rule, &rulenum, sizeof(rulenum));
> > +       bcopy(&d->rule, &rulenum, sizeof(rulenum));
> > 
> > 1461:
> > -               bcopy(((struct ip_fw *)data)->next_rule,
> > +               bcopy(&((struct ip_fw *)data)->next_rule,
> > 
> > 1701:
> > -                               bcopy(d->rule, &rulenum, sizeof(rulenum));
> > +                               bcopy(&d->rule, &rulenum, sizeof(rulenum));
> 
> Look way bettter now :)
> I wasn't able to crash the kernel with missaligned access any more, but
> the userland tool still does in some situations:
> [59]cicely12# ipfw show
> pid 2121 (ipfw): unaligned access: va=0x1200ac09c pc=0x120003bb4 ra=0x120003bfc op=ldq
> pid 2121 (ipfw): unaligned access: va=0x1200ac0a4 pc=0x120003bdc ra=0x120003bc8 op=ldq
> 00100    5237     824333 allow tcp from any to any dst-port 1-65535,1-65535
> 00200       0          0 allow tcp from any to any dst-port 1-65535,1-65535,1-65535
> pid 2121 (ipfw): unaligned access: va=0x1200ac09c pc=0x120002260 ra=0x1200015ec op=ldq
> pid 2121 (ipfw): unaligned access: va=0x1200ac0a4 pc=0x120002264 ra=0x1200015ec op=ldq
> 65535 5836817 1002036976 allow ip from any to any

I'm currently using the attached diff to ipfw2.c + your other changes.
It seems to work now.
I hope that I catched all missalignemts that were missing.

Thanks for the work on this.
I'm very happy to see this running on alpha.

-- 
B.Walter                   BWCT                http://www.bwct.de
ticso_at_bwct.de                                  info_at_bwct.de


Received on Mon Jun 02 2003 - 04:29:04 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:10 UTC