From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <199608060326.UAA27007@panda.azstarnet.com> Date: Mon, 5 Aug 1996 20:26:37 -0700 From: David Mosberger-Tang Subject: Re: Linux/Alpha: VMA not found in verify_area() in SCSI-ioctl >>>>> On Tue, 6 Aug 1996 00:19:59 +0200 (CEST), baron@clifton.hobby.nl (Wim van Dorst) said: Wim> On the one hand, Alphas don't have segmentation (says Wim> ~linux/asm-alpha/segment.h), but on the other hand, the Wim> verify_area() in ~linux/mm/memory.c checks for it, and thus Wim> cannot find a vma to verify (thus EFAULT). Wim> While debugging this latter function, it appears that it is not Wim> so much used as I thought. Where do I misunderstand the use of Wim> verify_area, or is the use so little that it hasn't been noted Wim> yet? Wim> When someone knowledgeable would be so kind as to explain the Wim> vma-stuff to me, I would be most obliged. This is a known problem---it occurred with the (initial) ELF patches and with knfsd as well. We discussed this briefly and Linus suggested that we emulate the get_fs()/set_fs() calls to keep track whether what the current "fs" value is---if get_fs()==KERNEL_DS, argument checking is bypassed (interpreted liberally) and otherwise, argument checking occurs. I appended the relevant part of a mail by Linus that gives some more detail. Needless to say, neither of us ever got around to do this. On the other hand, I'm quite certain Linus would be happy to receive these patches. Or, if he doesn't want them for 2.0.x, I'll gladly incorporate them into my patches. --david -- A more correct fix is to make a "shadow" fs in the "struct tss_struct", and then modify the set_fs()/get_fs() stuff like this: #define set_fs(x) (current->tss.segment = x) #define get_fs() (current->tss.segment) instead of the current hard-coding of "get_fs()" to USER_DS (and then fork() and friends would have to initialize tss.segment to USER_DS). Does that fix it for you? (I should also rename some functions: get_fs() -> get_user_segment() set_fs() -> set_user_segment() memcpy_fromfs() -> memcpy_fromuser() memcpy_tofs() -> memcpy_touser() etc, but I'm too lazy) Feel free to send me patches.. Linus -- To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null