Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Mar 2001 10:05:48 +0930
From:      Greg Lehey <grog@lemis.com>
To:        Mike Smith <msmith@freebsd.org>
Cc:        Poul-Henning Kamp <phk@critter.freebsd.dk>, John Baldwin <jhb@FreeBSD.org>, leclercn@videotron.ca, freebsd-alpha@FreeBSD.org
Subject:   Re: dev_t size mismatch kernel / userland
Message-ID:  <20010327100548.D40349@wantadilla.lemis.com>
In-Reply-To: <200103270008.f2R08vE02662@mass.dis.org>; from msmith@freebsd.org on Mon, Mar 26, 2001 at 04:08:57PM -0800
References:  <20010327093327.A40349@wantadilla.lemis.com> <200103270008.f2R08vE02662@mass.dis.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, 26 March 2001 at 16:08:57 -0800, Mike Smith wrote:
>>>> I'm new to this subject, so please fill me in: just what in the
>>>> (kernel) dev_t do you want to export to userland ?
>>>
>>> Nothing.  Greg just leaks a dev_t in a structure exchanged between
>>> userland and the kernel, and this bit because dev_t is a different
>>> size between the two on the Alpha; the right fix is simply to not
>>> abuse this structure like this.
>>
>> You're missing a number of things here.  If a dev_t is defined in
>> userland, it should be the same size as in the kernel.  The current
>> situation is obviously a bug.  It's certainly open to discussion
>> whether the dev_t definition in userland gets removed or fixed.
>
> Er, no, it's not a bug.  dev_t is expected to be one thing in userland,
> and quite another in the kernel; the assumption used to be that the two
> were the same; now they are not.

Would you care to explain?

>> The other issue is that exporting expurgated versions of kernel
>> structures is expensive.  We've been exporting the unexpurgated
>> versions for years elsewhere, for example--see the proc size mismatch
>> messages from ps(1).  That got fixed, not because it was "unclean",
>> but because it was a bloody nuisance.  Yes, it's "clean" not to export
>> mutexes and dev_ts and friends, but it requires a fair amount of code
>> to do it, and it requires two structures which need to be kept in
>> sync.  Exporting them doesn't do any harm that I can see.  I don't
>> think that it's self-evident that you need to go to this much trouble.
>
> You basically shoot your own argument dead here.

Your unsubstantiated claim.

> Don't export private data structures to userland.  End of story. 8)

No, categorical statements prove nothing.

Greg
--
Finger grog@lemis.com for PGP public key
See complete headers for address and phone numbers

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




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