Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys



Ah, you are right. We leaks uninitialized memory via mmap.

However, I'm not sure that it is safe to write DMA buffer
above sc->sc_vramsize after bus_dmamap_load?

Thoughts, ARM experts?

Thanks,
rin

On 2019/07/24 0:22, maya%netbsd.org@localhost wrote:
I think we might be leaking uninitialized kernel memory.

in tifb,

         if (bus_dmamem_alloc(sc->sc_dmat, sc->sc_vramsize, 0, 0,
             sc->sc_dmamem, 1, &segs, BUS_DMA_NOWAIT) != 0) {

bus_dma* rounds up to PAGE_SIZE chunks.

         memset((void *)sc->sc_vramaddr, 0, sc->sc_vramsize);

We zero the not-rounded-up size.

What do you think?

On Tue, Jul 23, 2019 at 02:34:12PM +0000, Rin Okuyama wrote:
Module Name:	src
Committed By:	rin
Date:		Tue Jul 23 14:34:12 UTC 2019

Modified Files:
	src/sys/arch/arm/omap: tifb.c
	src/sys/arch/luna68k/dev: lunafb.c
	src/sys/dev/fdt: simplefb.c

Log Message:
For drivers whose framebuffer is located not page-aligned, permit
offset of mmap up to (length of framebuffer) + (page offset of base
address of framebuffer). This is necessary in order to map the
highest page of framebuffer correctly, see,
http://cvsweb.netbsd.org/bsdweb.cgi/xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c#rev1.35



Home | Main Index | Thread Index | Old Index