From mboxrd@z Thu Jan 1 00:00:00 1970 From: Herton Ronaldo Krzesinski Subject: Re: Linux 2.6.38-rc6 Date: Fri, 25 Feb 2011 11:49:21 -0300 Message-ID: <20110225144920.GA2337@herton-IdeaPad-Y430> References: <1298596499.10585.27.camel@clockmaker-el6> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Anca Emanuel Cc: Dave Airlie , Linus Torvalds , linux-fbdev@vger.kernel.org, Ben Skeggs , dri-devel@lists.freedesktop.org, Borislav Petkov , Linux Kernel Mailing List , Andy Whitcroft List-Id: dri-devel@lists.freedesktop.org On Fri, Feb 25, 2011 at 03:56:20AM +0200, Anca Emanuel wrote: > On Fri, Feb 25, 2011 at 3:47 AM, Anca Emanuel wrote: > > On Fri, Feb 25, 2011 at 3:14 AM, Dave Airlie w= rote: > >> On Thu, 2011-02-24 at 16:54 -0800, Linus Torvalds wrote: > >>> On Thu, Feb 24, 2011 at 4:48 PM, Anca Emanuel wrote: > >>> > > >>> > 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(stru= ct > >>> > apertures_struct *a, > >>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 "%s= vs %s - removing generic driver\n", > >>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 nam= e, registered_fb[i]->fix.id); > >>> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0unregister_frame= buffer(registered_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 dere= ference > >>> > 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 cod= e > >>> 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? > >> > >> I think Andy's patch worked, not sure why it fell between the crac= ks, > >> either didn't appear on lkml or in my inbox at all. > >> > >> if we can get Herton to repost it properly + a tested by I'm happy= for > >> it to go in. > >> > >> Dave. > >> > >> > > > > Tested Andy's patch and it works ! > > http://kernel.ubuntu.com/git?p=3Dubuntu/ubuntu-natty.git;a=3Dcommit= ;h=3Dc5a742b5f78e161d6a13853a7e3e6e1dfa429e69 > > > > Tested-by: Anca Emanuel > > >=20 > link to patch: http://is.gd/otIfGc Adding Andy on CC (btw he is away for today, may get some time to answe= r). Andy, can you repost the patch? -- []'s Herton