[PATCH v2] MODSIGN: do not send garbage to stderr when enabling modules signature

From: David Cohen
Date: Tue Apr 09 2013 - 17:36:55 EST


openssl may send garbage to stderr when generating X.509 key pair for
modules signature regardless there was an error or not. It makes more
difficult to create scripts based on kernel error/warning messages.

When compiling kernel with -jN (N > 1), all warning/error messages
printed while openssl is generating key pair may get mixed dots and
other symbols openssl sends to stderr. This patch makes sure openssl
logs go to default stdout.

Example of the garbages:

crypto/anubis.c:581: warning: âinterâ is used uninitialized in this function
Generating a 4096 bit RSA private key
.........
drivers/gpu/drm/i915/i915_gem_gtt.c: In function âgen6_ggtt_insert_entriesâ:
drivers/gpu/drm/i915/i915_gem_gtt.c:440: warning: âaddrâ may be used uninitialized in this function
.net/mac80211/tx.c: In function âieee80211_subif_start_xmitâ:
net/mac80211/tx.c:1780: warning: âchanctx_confâ may be used uninitialized in this function
..drivers/isdn/hardware/mISDN/hfcpci.c: In function âhfcpci_softirqâ:
.....drivers/isdn/hardware/mISDN/hfcpci.c:2298: warning: ignoring return value of âdriver_for_each_deviceâ, declared with attribute warn_unused_result
net/unix/af_unix.c: In function âunix_bindâ:
net/unix/af_unix.c:892: warning: âpath.dentryâ may be used uninitialized in this function
net/unix/af_unix.c:892: warning: âpath.mntâ may be used uninitialized in this function
...++
In file included from drivers/message/i2o/config-osm.c:39:
drivers/message/i2o/i2o_config.c: In function âi2o_cfg_passthruâ:
drivers/message/i2o/i2o_config.c:888: warning: cast to pointer from integer of different size
drivers/message/i2o/i2o_config.c:943: warning: cast to pointer from integer of different size
drivers/net/ethernet/amd/nmclan_cs.c: In function ânmclan_configâ:
drivers/net/ethernet/amd/nmclan_cs.c:625: warning: âpcmcia_request_exclusive_irqâ is deprecated (declared at include/pcmcia/ds.h:201)
drivers/net/ethernet/mellanox/mlx4/mcg.c: In function âfind_entryâ:
.........................................................................................................................................................................................++
writing new private key to 'signing_key.priv'
-----
drivers/net/ethernet/mellanox/mlx4/mcg.c:601: warning: âhashâ may be used uninitialized in this function

Signed-off-by: David Cohen <david.a.cohen@xxxxxxxxx>
---
kernel/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/Makefile b/kernel/Makefile
index bbde5f1..5a51e6c 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -175,7 +175,7 @@ signing_key.priv signing_key.x509: x509.genkey
openssl req -new -nodes -utf8 -$(CONFIG_MODULE_SIG_HASH) -days 36500 \
-batch -x509 -config x509.genkey \
-outform DER -out signing_key.x509 \
- -keyout signing_key.priv
+ -keyout signing_key.priv 2>&1
@echo "###"
@echo "### Key pair generated."
@echo "###"
--
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/