Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Aug 1995 13:38:08 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, davidg@Root.COM
Cc:        freebsd-hackers@freefall.cdrom.com, gclarkii@freefall.cdrom.com
Subject:   Re: FoxPro II.1
Message-ID:  <199508090338.NAA03049@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>>>CALL fcntl(0x4,0x6,0xefbfbf34)
>...
>>This is consistent with a valid process group/PID.  F_SETOWN on /dev/null
>>...
>   No, 0xefbfbf34 can never be a valid process group. ...but you're also
>correct that this operation isn't support on /dev/null, either.

It's obviously a stack address so I thought an indirection was involved.
Anyway, (int)0xefbfbf34 < 0, so fcntl() interprets it as the negative of
a pid, and for some reason (sloppiness?) it doesn't check that the pid
is in use.

FIOSETOWN is no better.

ttioctl() does a pgfind() to check that the process group exists but
most other ioctl routines don't do any more checking.  ttioctl()'s check
is bogus if the number is actually a pid.  F*SETOWN has removed the
special encoding of for pids so it isn't clear how device-specific ioctl
routines can DTRT.  ttioctl() can only support F_SETOWN to the session
leader (if any) but the man page doesn't mention any restrictions other
than existence of the pgrp/pid, not even permissions restrictions.  I
think the restrictions for kill() should apply.

Bruce



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