From mboxrd@z Thu Jan 1 00:00:00 1970 From: Linus Torvalds Date: Fri, 25 Feb 2011 00:54:44 +0000 Subject: Re: Linux 2.6.38-rc6 Message-Id: List-Id: References: <20110222140349.GA20708@kryptos.osrc.amd.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: Anca Emanuel Cc: Dave Airlie , linux-fbdev@vger.kernel.org, Ben Skeggs , dri-devel@lists.freedesktop.org, Borislav Petkov , Herton Ronaldo Krzesinski , Linux Kernel Mailing List On Thu, Feb 24, 2011 at 4:48 PM, Anca Emanuel wrot= e: > > diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c > index e2bf953..e8f8925 100644 > --- a/drivers/video/fbmem.c > +++ b/drivers/video/fbmem.c > @@ -1511,6 +1511,7 @@ void remove_conflicting_framebuffers(struct > apertures_struct *a, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "%s vs %s - r= emoving generic driver\n", > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 name, registe= red_fb[i]->fix.id); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0unregister_framebuffer(reg= istered_fb[i]); > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 registered_fb[i] =3D NULL; > > Tested the patch, and now I get this: > dmesg: http://pastebin.com/ieMNrA7C > > [ =A0 12.252328] BUG: unable to handle kernel NULL pointer dereference > at 00000000000003b8 > [ =A0 12.252342] IP: [] fb_mmap+0x58/0x1d0 Ok, goodie. Or not so goodie, but it does make it clear that yeah, the fb code seems to be using stale pointers from that registered_fb[] array, and the whole unregistration process is just racing with people using it. Herton had that much bigger patch, can you test it? Linus