Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* Linux/Alpha: VMA not found in verify_area() in SCSI-ioctl
@ 1996-08-05 22:19 Wim van Dorst
  0 siblings, 0 replies; 2+ messages in thread
From: Wim van Dorst @ 1996-08-05 22:19 UTC (permalink / raw)


Hello *,

While tracking a problem with multisession CDs in my Toshiba 
3701B SCSI CD-ROM, I have encountered the following question:

On the one hand, Alphas don't have segmentation (says
~linux/asm-alpha/segment.h), but on the other hand, the 
verify_area() in ~linux/mm/memory.c checks for it, and thus
cannot find a vma to verify (thus EFAULT).

While debugging this latter function, it appears that it is 
not so much used as I thought. Where do I misunderstand the 
use of verify_area, or is the use so little that it hasn't 
been noted yet?

When someone knowledgeable would be so kind as to explain the 
vma-stuff to me, I would be most obliged.

Met vriendelijke groeten, Wim van Dorst
(ps a patch to get my CD-ROM going without error
messages would be nice too :-).
--------------------------------------------------------------------
Blue Baron = Wim van Dorst, Voice (+31) 33 4676365, (+31) 35 5242319
(-:      baron@clifton.hobby.nl       WvD@Chem.AkzoNobel.nl      :-)
--------------------------------------------------------------------

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Linux/Alpha: VMA not found in verify_area() in SCSI-ioctl
@ 1996-08-06  3:26 David Mosberger-Tang
  0 siblings, 0 replies; 2+ messages in thread
From: David Mosberger-Tang @ 1996-08-06  3:26 UTC (permalink / 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1996-08-06  3:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1996-08-06  3:26 Linux/Alpha: VMA not found in verify_area() in SCSI-ioctl David Mosberger-Tang
  -- strict thread matches above, loose matches on Subject: below --
1996-08-05 22:19 Wim van Dorst

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