Return-Path: Received: from out1-smtp.messagingengine.com ([66.111.4.25]:59223 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751915AbdHVR4E (ORCPT ); Tue, 22 Aug 2017 13:56:04 -0400 Date: Tue, 22 Aug 2017 10:56:07 -0700 From: Greg KH To: Josh Poimboeuf Cc: changbin.du@intel.com, stable@vger.kernel.org, Linus Torvalds , Peter Zijlstra , Thomas Gleixner , Ingo Molnar Subject: Re: [PATCH] debug: Fix WARN_ON_ONCE() for modules Message-ID: <20170822175607.GB8863@kroah.com> References: <1503390677-17237-1-git-send-email-changbin.du@intel.com> <20170822123642.yc4fr4fd5wtdbeqs@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170822123642.yc4fr4fd5wtdbeqs@treble> Sender: stable-owner@vger.kernel.org List-ID: On Tue, Aug 22, 2017 at 07:36:42AM -0500, Josh Poimboeuf wrote: > On Tue, Aug 22, 2017 at 04:31:17PM +0800, changbin.du@intel.com wrote: > > From: Josh Poimboeuf > > > > commit 325cdacd03c12629aa5f9ee2ace49b1f3dc184a8 upstream. > > > > Mike Galbraith reported a situation where a WARN_ON_ONCE() call in DRM > > code turned into an oops. As it turns out, WARN_ON_ONCE() seems to be > > completely broken when called from a module. > > > > The bug was introduced with the following commit: > > > > 19d436268dde ("debug: Add _ONCE() logic to report_bug()") > > > > That commit changed WARN_ON_ONCE() to move its 'once' logic into the bug > > trap handler. It requires a writable bug table so that the BUGFLAG_DONE > > bit can be written to the flags to indicate the first warning has > > occurred. > > > > The bug table was made writable for vmlinux, which relies on > > vmlinux.lds.S and vmlinux.lds.h for laying out the sections. However, > > it wasn't made writable for modules, which rely on the ELF section > > header flags. > > > > Reported-by: Mike Galbraith > > Tested-by: Masami Hiramatsu > > Signed-off-by: Josh Poimboeuf > > Acked-by: Peter Zijlstra (Intel) > > Cc: Linus Torvalds > > Cc: Peter Zijlstra > > Cc: Thomas Gleixner > > Fixes: 19d436268dde ("debug: Add _ONCE() logic to report_bug()") > > Link: http://lkml.kernel.org/r/a53b04235a65478dd9afc51f5b329fdc65c84364.1500095401.git.jpoimboe@redhat.com > > Signed-off-by: Ingo Molnar > > Cc: # v4.11.x > > Cc: # v4.12.x > > This is only needed for 4.12. 4.11 doesn't have 19d436268dde ("debug: > Add _ONCE() logic to report_bug()"). Thanks, now queued up. greg k-h