Re: ptrace broken on latest CURRENT ?

From: Craig Rodrigues <rodrigc_at_crodrigues.org>
Date: Sun, 28 Nov 2004 01:52:38 -0500
On Sat, Nov 27, 2004 at 09:04:11PM -0500, Craig Rodrigues wrote:
> On Sat, Nov 27, 2004 at 07:30:36PM -0500, Craig Rodrigues wrote:
> > --- sys_generic.c.orig	Sat Nov 27 19:14:39 2004
> > +++ sys_generic.c	Sat Nov 27 19:17:09 2004
> > _at__at_ -503,7 +503,7 _at__at_
> >          if ((size > IOCPARM_MAX) ||
> >              ((com & (IOC_VOID  | IOC_IN | IOC_OUT)) == 0) ||
> >              ((com & IOC_VOID) && size > 0) ||
> > -            ((com & (IOC_IN | IOC_OUT)) && size == 0)) {
> > +            ((com & IOC_OUT) && size == 0)) {
> >                  fdrop(fp, td);
> >                  return (ENOTTY);
> >          }
> 
> 
> Hi,
> 
> If we leave the define of PIOCBIS as: 
> # define       PIOCBIS _IOC(IOC_IN, 'p', 1, 0)
> 
> then the length of this ioctl is going to be 0 (from IOCPARM_LEN).
> I'm not sure if that is a good thing.   This is what tripped
> up the original ioctl() code in sys_generic.c.
> 
> If we don't change sys_generic.c, then the other approach
> to this problem is to fix the ioctl() calls in the procfs.
> Any comments on this?

Hi,

If PIOCBIS is redefined according to the patch which I submitted, then
strace needs to be patched as well.   I'm not sure of the best way
to do this other than bumping __FreeBSD_version__ and checking it.

Here are my patches to procfs and strace.  
Comments?

--
Craig Rodrigues        
http://crodrigues.org
rodrigc_at_crodrigues.org


Received on Sun Nov 28 2004 - 05:52:43 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:23 UTC