* [Linux-ia64] do_mmap_fake question
@ 2000-07-09 8:51 Manfred Spraul
2000-07-10 17:53 ` Don Dugger
0 siblings, 1 reply; 2+ messages in thread
From: Manfred Spraul @ 2000-07-09 8:51 UTC (permalink / raw)
To: linux-ia64
do_mmap_fake seems to be buggy:
You use simple memset/memcpy to initialize user memory.
AFAICS this can oops on SMP: one thread calls do_mmap_fake, and a second
thread calls sys_munmap() for that memory range.
memset/memcpy will fail, and you don't have an exception handler
installed.
Btw, why do you use llseek?
Is there a hidden problem with read(,,,&off)?
- llseek(,,off);
- r = file->f_op->read(file,(char*)addr, len, &file->f_pos);
+ r = file->f_op->read(file,(char*)addr, len, &off);
--
Manfred
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Linux-ia64] do_mmap_fake question
2000-07-09 8:51 [Linux-ia64] do_mmap_fake question Manfred Spraul
@ 2000-07-10 17:53 ` Don Dugger
0 siblings, 0 replies; 2+ messages in thread
From: Don Dugger @ 2000-07-10 17:53 UTC (permalink / raw)
To: linux-ia64
Manfred-
Thanks for looking over the code but I don't think there is a
problem. `do_mmap_fake' is only called from `sys32_mmap' which
grabs the semaphore `current->mm->mmap_sem' (it also grabs the
kernel lock but we won't go into that). Any other thread trying
to unmap memmory will block until `do_mmap_fake' completes.
The call to `llseek' is a hold over from my application programming
days, I'll change that in the next release.
Tnx.
On Sun, Jul 09, 2000 at 10:51:44AM +0200, Manfred Spraul wrote:
> do_mmap_fake seems to be buggy:
>
> You use simple memset/memcpy to initialize user memory.
> AFAICS this can oops on SMP: one thread calls do_mmap_fake, and a second
> thread calls sys_munmap() for that memory range.
> memset/memcpy will fail, and you don't have an exception handler
> installed.
>
> Btw, why do you use llseek?
> Is there a hidden problem with read(,,,&off)?
>
> - llseek(,,off);
> - r = file->f_op->read(file,(char*)addr, len, &file->f_pos);
> + r = file->f_op->read(file,(char*)addr, len, &off);
>
> --
> Manfred
>
>
> _______________________________________________
> Linux-IA64 mailing list
> Linux-IA64@linuxia64.org
> http://lists.linuxia64.org/lists/listinfo/linux-ia64
--
Don Dugger
"Censeo Toto nos in Kansa esse decisse." - D. Gale
n0ano@valinux.com
Ph: 303/938-9838
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-07-10 17:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2000-07-09 8:51 [Linux-ia64] do_mmap_fake question Manfred Spraul
2000-07-10 17:53 ` Don Dugger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox