lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Mon, 29 Jan 2007 03:59:29 -0500 (EST)
From:	"Robert P. J. Day" <rpjday@...dspring.com>
To:	Linux kernel mailing list <linux-kernel@...r.kernel.org>
Subject: finding "dead" CONFIG variables -- an exercise for the reader


  FYI, the majority of patches i've submitted lately related to
potentially "dead" CONFIG variables in the source tree were identified
by a short script "dead_config.sh" i wrote you can find here:

http://www.fsdev.dreamhosters.com/wiki/index.php?title=Dead_CONFIG_variables

  that script scans the source tree (or whatever subdirectory you pass
as an argument), collects all of the "CONFIG_" type macros in
conditional preprocessor statements, then spits out any of them that
aren't defined in *any* Kconfig in the entire source tree.

  as a random example, let's check the subdirectory drivers/media/dvb:

$ dead_config.sh drivers/media/dvb
========== DVB_DIBCOM_DEBUG ==========
drivers/media/dvb/frontends/dib3000mb.c:#ifdef CONFIG_DVB_DIBCOM_DEBUG
drivers/media/dvb/frontends/dib3000mb.c:#ifdef CONFIG_DVB_DIBCOM_DEBUG
drivers/media/dvb/frontends/dib3000mb_priv.h:#ifdef CONFIG_DVB_DIBCOM_DEBUG

  so there's a single CONFIG macro somewhere in that tree that is
being tested (three times) for which there is no Kconfig entry.  that
doesn't mean this macro is necessarily wrong -- it might be defined in
a Makefile, perhaps -- but it at least deserves closer examination.

  another random example:

$ dead_config.sh arch/ppc/8xx_io
========== FEC_PACKETHOOK ==========
arch/ppc/8xx_io/fec.c:#ifdef CONFIG_FEC_PACKETHOOK
arch/ppc/8xx_io/fec.c:#ifdef CONFIG_FEC_PACKETHOOK
arch/ppc/8xx_io/fec.c:#ifdef CONFIG_FEC_PACKETHOOK
arch/ppc/8xx_io/fec.c:#ifdef CONFIG_FEC_PACKETHOOK
arch/ppc/8xx_io/fec.c:#endif /* CONFIG_FEC_PACKETHOOK */
arch/ppc/8xx_io/fec.c:#ifdef CONFIG_FEC_PACKETHOOK
arch/ppc/8xx_io/fec.c:#ifdef CONFIG_FEC_PACKETHOOK
arch/ppc/8xx_io/fec.c:#ifdef CONFIG_FEC_PACKETHOOK
arch/ppc/8xx_io/fec.c:#ifdef CONFIG_FEC_PACKETHOOK
arch/ppc/8xx_io/fec.c:#ifdef CONFIG_FEC_PACKETHOOK
arch/ppc/8xx_io/fec.c:#ifdef CONFIG_FEC_PACKETHOOK
arch/ppc/8xx_io/fec.c:#ifdef CONFIG_FEC_PACKETHOOK
arch/ppc/8xx_io/fec.c:#ifdef CONFIG_FEC_PACKETHOOK
arch/ppc/8xx_io/fec.c:#ifdef CONFIG_FEC_PACKETHOOK
arch/ppc/8xx_io/fec.c:#ifdef CONFIG_FEC_PACKETHOOK

  feel free to run the script on the subtree of your choice.  when i
first ran this script against the entire tree, i identified 347 unique
macros like this.

rday

p.s.  in some cases, the macro doesn't appear in any Kconfig file
since it's meant only for internal use by the maintainer, as you can
see by the suffix "_DEBUG".  but if that's the case, it's my feeling
that macros like that should *not* start with the "CONFIG_" prefix,
which should be reserved for user-configurable selections only.

  but that's just my $0.02.

rday

-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://www.fsdev.dreamhosters.com/wiki/index.php?title=Main_Page
========================================================================
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ