Re: need type to carry kernel pointers to user space

From: Mitchell Blank Jr (mitch@sfgoth.com)
Date: Wed Jan 19 2000 - 16:06:43 EST


Richard B. Johnson wrote:
> > Recently, we had a discussion on the linux-atm list about the best approach
> > for passing kernel pointers to user space, and back. The idea is as follows:
> [SNIPPED...]
>
> A pointer in user space is not a pointer in kernel space! Kernel data
> is referenced by a discriptor, referenced as KERNEL_DS, which is not
> accessible from user-mode privilege.

Yes, we (the linux-atm folks) of course know that. The pointer is
treated as an opaque descriptor in user space, just like a file
descriptor is passed back from open(). We just need a type
that is garaunteed to hold a kernel-mode pointer given weird cases
like sparc64 (suppose mips64 and hppa64 will be similar when support
for them arrives)

Personally, I'm advocating __u64. Note that no long-long calculations
need to be done on 32-bit archs - the kernel will cast it down to
"unsigned long" first thing - so all those unpleasantries don't
come into play.

-Mitch

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jan 23 2000 - 21:00:20 EST