Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 Dec 2000 17:44:33 -0800
From:      Mike Smith <msmith@freebsd.org>
To:        Jim Browne <jbrowne@jbrowne.com>
Cc:        Matt Dillon <dillon@earth.backplane.com>, freebsd-stable@FreeBSD.ORG, freebsd-hackers@FreeBSD.ORG
Subject:   Re: More on BTX halted / crashes trying to use -stable /boot/loader 
Message-ID:  <200012080144.eB81iXN00495@mass.osd.bsdi.com>
In-Reply-To: Your message of "Thu, 07 Dec 2000 16:29:49 PST." <v04205507b655db9586be@[216.39.8.88]> 

next in thread | previous in thread | raw e-mail | index | archive | help

This is probably an OK workaround.  I think that there's something 
fundamentally wrong with the 'net' filesystems getting called for an open 
against a disk device, but I've paged out all the libstand state and I 
can't get it back fast enough to comment more usefully. 8(

BTW Jim, the stuff you're working on sounds really cool.  Thanks for 
taking it on!

> At 16:02 -0800 12/7/00, Jim Browne wrote:
> >When TFTP tries to open a file, it is expecting struct open_file 
> >member f_devdata to be a pointer to a socket number.  When currdev 
> >is "pxe", that assumption is correct.  When currdev is "disk*", that 
> >assumption is incorrect.  Specifically, tftp.c does:
> >
> >tftpfile->iodesc = io = socktodesc(*(int *) (f->f_devdata));
> >
> >In my case, that often winds up making tftpfile->iodesc = 0.  That 
> >parameter is later passed in tftp_makereq to sendrecv as the iodesc, 
> >which via sendudp (and possibly the ARP functions) winds up calling 
> >netif_put.  netif_put derefs the bogus iodesc to get a function 
> >pointer for the put function of the network interface and calls it. 
> >WHAM.  QED. :)
> 
> How does this look?
> 
> *** tftp.c      Thu Dec  7 16:20:02 2000
> --- tftp2.c     Thu Dec  7 16:20:55 2000
> *************** tftp_open(path, f)
> *** 257,260 ****
> --- 257,262 ----
>  
>          tftpfile->iodesc = io = socktodesc(*(int *) (f->f_devdata));
> +       if (io == NULL)
> +               return (EINVAL);
>          io->destip = servip;
>          tftpfile->off = 0;
> 
> (I suppose I could have included this earlier.  Ugh.)
> 
> Jim Browne                                                jbrowne@jbrowne.com
>     "We lost our lease.  You lose culture" - sign on SF Arts Comission Bldg
> 

-- 
... every activity meets with opposition, everyone who acts has his
rivals and unfortunately opponents also.  But not because people want
to be opponents, rather because the tasks and relationships force
people to take different points of view.  [Dr. Fritz Todt]
           V I C T O R Y   N O T   V E N G E A N C E




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200012080144.eB81iXN00495>