Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: David Mosberger-Tang <davidm@AZStarNet.com>
Subject: Re: Linux/Alpha: VMA not found in verify_area() in SCSI-ioctl
Date: Mon, 5 Aug 1996 20:26:37 -0700	[thread overview]
Message-ID: <199608060326.UAA27007@panda.azstarnet.com> (raw)

>>>>> 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

             reply	other threads:[~1996-08-06  3:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-06  3:26 David Mosberger-Tang [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-08-05 22:19 Linux/Alpha: VMA not found in verify_area() in SCSI-ioctl Wim van Dorst
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox