From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757441AbcIWEsn (ORCPT ); Fri, 23 Sep 2016 00:48:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43052 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756021AbcIWEsm (ORCPT ); Fri, 23 Sep 2016 00:48:42 -0400 Date: Fri, 23 Sep 2016 00:48:40 -0400 From: Jessica Yu To: Petr Mladek Cc: Rusty Russell , Andrew Morton , Jiri Kosina , Josh Poimboeuf , live-patching@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: taint/module: Clean up global and module taint flags handling Message-ID: <20160923044840.GB30848@packer-debian-8-amd64.digitalocean.com> References: <1474458442-21581-1-git-send-email-pmladek@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <1474458442-21581-1-git-send-email-pmladek@suse.com> X-OS: Linux eisen.io 3.16.0-4-amd64 x86_64 User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 23 Sep 2016 04:48:41 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +++ Petr Mladek [21/09/16 13:47 +0200]: >The commit 66cc69e34e86a231 ("Fix: module signature vs tracepoints: >add new TAINT_UNSIGNED_MODULE") updated module_taint_flags() to >potentially print one more character. But it did not increase the >size of the corresponding buffers in m_show() and print_modules(). > >We have recently done the same mistake when adding a taint flag >for livepatching, see >https://lkml.kernel.org/g/cfba2c823bb984690b73572aaae1db596b54a082.1472137475.git.jpoimboe@redhat.com > >Also struct module uses an incompatible type for mod-taints flags. >It survived from the commit 2bc2d61a9638dab670d ("[PATCH] list module >taint flags in Oops/panic"). There was used "int" for the global taint >flags at these times. But only the global tain flags was later changed >to "unsigned long" by the commit 25ddbb18aae33ad2 ("Make the taint >flags reliable"). > >This patch defines TAINT_FLAGS_COUNT that can be used to create >arrays and buffers of the right size. Note that we could not use >enum because the taint flag indexes are used also in assembly code. > >Then it reworks the table that describes the taint flags. The TAINT_* >numbers can be used as the index. Instead, we add information >if the taint flag is also shown per-module. > >Finally, it uses "unsigned long", bit operations, and the updated >taint_flags table also for mod->taints. > >It is not optimal because only few taint flags can be printed by >module_taint_flags(). But better be on the safe side. IMHO, it is >not worth the optimization and this is a good compromise. > >Signed-off-by: Petr Mladek >--- >Changes against v2: > > + fixed a typo in a comment > > + rebased on top of for-next branch from git/jikos/livepatching.git > that has the commit commit 2992ef29ae01af9983 ("livepatch/module: > make TAINT_LIVEPATCH module-specific"). Reviewed-by: Jessica Yu Hm, quick question, which tree would this patch go to? Though the cleanup is for modules, there is an indirect cross-tree dependency (taint_flag.module needs to be true for TAINT_LIVEPATCH for Josh's patch to still work as intended). The least complicated thing to do would be to just take this through the livepatch tree (with Rusty's approval :-)), no?