Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1006557ybk; Fri, 15 May 2020 21:06:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxyPfCdonIJAEWO5c8CZfzmuJ4bdz4MDBc4613DFYyp7Uei2S5DOiuPQVbLKa9IZgwBUwl6 X-Received: by 2002:a05:6402:8c9:: with SMTP id d9mr5396723edz.357.1589601971674; Fri, 15 May 2020 21:06:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589601971; cv=none; d=google.com; s=arc-20160816; b=YWw1M0bDEnVDxiNX3ZzLuAPOfgnI85o2CU2z4pJxpyfAy7+ogg8bsRUigdJjOlFzt0 pXOLByALlPPjgooJscUVFagvDFpPVMDUIKq5xdM7v3G7ML5RCBGtsux6ZgkDJhnriXhi QyNgevVoSVS+a9twkOFeRT3BiEfnO8Csw9YsV53JEK19ZDRyGFJAbvHSk53/dDCfKDL/ hkZ4y8JolYIzmQvx/N8ZLUmsgFJYO16jvlE0by0ZDSJv8NjBW5mrgPx2g6IvGIY3AQ8L ZjpegwIDTvtKO2SmZnVs0Xb4Sa7o9maU+uLRZWtpYehRygyI0sPlBn8NM0ooosPBk45E laSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=bPuMwbOjUImOtjQj+iLZNHFF2rUtvqlmQymq+yZrOyo=; b=VQsqG6OI1j3EjoCZkXawemTiEkFp4qt370alc32nLSCGq9lhzDAzwEkhfyzIBerJNc Up+H69/S/ttzUxts5UV74fyegOq0H1rWcHvKyfdFVn9P4NaBmiJlO3wWwN6XP/KgwXgN yh7s8ZdNOP7O/dqQ2lugumE5q0IQ7y+zORyimpR35HH1YgoAvqwr24BD762kEB72R1Vn A7RL75hQzhqbS8zK2GaU/FiYHcymDrgCmEF1Sbs2msln/DbBKRNtVCrvn63LIMt4Ob+E CFUjmG3IL3WOCIWt/9GpSJ1842PFWUBkXfCu6jeiFPRFVsMxLooOTUnrXJipY9PEj/wh x2LQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=idTY6zd1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y20si2684213ejf.224.2020.05.15.21.05.44; Fri, 15 May 2020 21:06:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=idTY6zd1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725997AbgEPEEM (ORCPT + 99 others); Sat, 16 May 2020 00:04:12 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:57850 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725275AbgEPEEM (ORCPT ); Sat, 16 May 2020 00:04:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589601851; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bPuMwbOjUImOtjQj+iLZNHFF2rUtvqlmQymq+yZrOyo=; b=idTY6zd1fVWMm1xtpNQ535joVsaFj1ahxn4nq26b6BU0Aix9147mTAec6n5fXXGMgo6S/7 X5HEU9CfoIskiUPiAEzxKOlaBodcIxwsxHgPycR9Nx0NrIW7SjDdmIXKKBBtV4Aue6BbQZ lbKfMG9KvB/rb9BgzhJ/p/8Wy6Sadvo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-75-mGNI0z85MFWhHnb1rh4xKw-1; Sat, 16 May 2020 00:04:06 -0400 X-MC-Unique: mGNI0z85MFWhHnb1rh4xKw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4E1FB1800D42; Sat, 16 May 2020 04:04:03 +0000 (UTC) Received: from x1-fbsd (unknown [10.3.128.10]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 67D615D9C9; Sat, 16 May 2020 04:03:52 +0000 (UTC) Date: Sat, 16 May 2020 00:03:48 -0400 From: Rafael Aquini To: Luis Chamberlain Cc: jeyu@kernel.org, akpm@linux-foundation.org, arnd@arndb.de, rostedt@goodmis.org, mingo@redhat.com, cai@lca.pw, dyoung@redhat.com, bhe@redhat.com, peterz@infradead.org, tglx@linutronix.de, gpiccoli@canonical.com, pmladek@suse.com, tiwai@suse.de, schlad@suse.de, andriy.shevchenko@linux.intel.com, keescook@chromium.org, daniel.vetter@ffwll.ch, will@kernel.org, mchehab+samsung@kernel.org, kvalo@codeaurora.org, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 01/15] taint: add module firmware crash taint support Message-ID: <20200516040348.GA3182@x1-fbsd> References: <20200515212846.1347-1-mcgrof@kernel.org> <20200515212846.1347-2-mcgrof@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200515212846.1347-2-mcgrof@kernel.org> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 15, 2020 at 09:28:32PM +0000, Luis Chamberlain wrote: > Device driver firmware can crash, and sometimes, this can leave your > system in a state which makes the device or subsystem completely > useless. Detecting this by inspecting /proc/sys/kernel/tainted instead > of scraping some magical words from the kernel log, which is driver > specific, is much easier. So instead provide a helper which lets drivers > annotate this. > > Once this happens, scrapers can easily look for modules taint flags > for a firmware crash. This will taint both the kernel and respective > calling module. > > The new helper module_firmware_crashed() uses LOCKDEP_STILL_OK as this > fact should in no way shape or form affect lockdep. This taint is device > driver specific. > > Signed-off-by: Luis Chamberlain > --- > Documentation/admin-guide/tainted-kernels.rst | 6 ++++++ > include/linux/kernel.h | 3 ++- > include/linux/module.h | 13 +++++++++++++ > include/trace/events/module.h | 3 ++- > kernel/module.c | 5 +++-- > kernel/panic.c | 1 + > tools/debugging/kernel-chktaint | 7 +++++++ > 7 files changed, 34 insertions(+), 4 deletions(-) > Reviewed-by: Rafael Aquini