Re: [Linux-fbdev-devel] Re: [PATCH?] Crash in 2.4.17/ptrace

James Simmons (jsimmons@transvirtual.com)
Tue, 29 Jan 2002 16:13:31 -0800 (PST)


> Ah, thanks. Also I missed sbusfb.c (not that it was fatal - the driver
> got it right anyway).

Great.

> Here's the current patch. After some discussion with Ben
> Herrenschmidt, it now sets VM_IO against the vma *before*
> calling the subdriver's mmap method, just in case the
> driver really does want to clear that flag (presumably, a shadow
> buffer in main memory).

I also thought about it as well. Never thought about the issue with shadow
buffers. Is it safe to move it before if (fb->fb_mmap)?

> --- linux-2.4.18-pre7/drivers/video/fbmem.c Fri Dec 21 11:19:14 2001
> +++ linux-akpm/drivers/video/fbmem.c Tue Jan 29 14:57:00 2002
> @@ -541,6 +541,16 @@ fb_mmap(struct file *file, struct vm_are
> if (fb->fb_mmap) {
> int res;
> lock_kernel();
> + /*
> + * This is an IO map - tell maydump to skip this VMA.
> + * If, for some reason, the sub-driver wishes to allow the
> + * mapping to be dumpable and accessible via ptrace then
> + * it may clear VM_IO later.
> + * (This only makes sense if the buffer is actually
> + * in main memory, and is described by a page struct in
> + * mem_map[])
> + */
> + vma->vm_flags |= VM_IO;
> res = fb->fb_mmap(info, file, vma);
> unlock_kernel();
> return res;

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