linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] MODSIGN: do not send garbage to stderr when enabling modules signature
@ 2013-04-09 21:39 David Cohen
  2013-04-09 21:43 ` Gross, Mark
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: David Cohen @ 2013-04-09 21:39 UTC (permalink / raw)
  To: rusty, dhowells; +Cc: linux-kernel, mark.gross, David Cohen

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@intel.com>
---
 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


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* RE: [PATCH v2] MODSIGN: do not send garbage to stderr when enabling modules signature
  2013-04-09 21:39 [PATCH v2] MODSIGN: do not send garbage to stderr when enabling modules signature David Cohen
@ 2013-04-09 21:43 ` Gross, Mark
  2013-04-10  7:29   ` Rusty Russell
  2013-04-10 10:32 ` Rusty Russell
  2013-04-10 12:20 ` David Howells
  2 siblings, 1 reply; 8+ messages in thread
From: Gross, Mark @ 2013-04-09 21:43 UTC (permalink / raw)
  To: Cohen, David A, rusty, dhowells; +Cc: linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-8", Size: 3601 bytes --]

> -----Original Message-----
> From: Cohen, David A
> Sent: Tuesday, April 09, 2013 2:39 PM
> To: rusty@rustcorp.com.au; dhowells@redhat.com
> Cc: linux-kernel@vger.kernel.org; Gross, Mark; Cohen, David A
> Subject: [PATCH v2] MODSIGN: do not send garbage to stderr when enabling
> modules signature
> 
> 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@intel.com>
> ---
>  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
Reviewed-by: mark gross<mark.gross@intel.com>
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH v2] MODSIGN: do not send garbage to stderr when enabling modules signature
  2013-04-09 21:43 ` Gross, Mark
@ 2013-04-10  7:29   ` Rusty Russell
  2013-04-10 16:23     ` Gross, Mark
  0 siblings, 1 reply; 8+ messages in thread
From: Rusty Russell @ 2013-04-10  7:29 UTC (permalink / raw)
  To: mark gross, Cohen, David A, dhowells; +Cc: linux-kernel

"Gross, Mark" <mark.gross@intel.com> writes:
> Reviewed-by: mark gross<mark.gross@intel.com>

Not sure that's a valid email address, so I added a space.

Cheers,
Rusty.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] MODSIGN: do not send garbage to stderr when enabling modules signature
  2013-04-09 21:39 [PATCH v2] MODSIGN: do not send garbage to stderr when enabling modules signature David Cohen
  2013-04-09 21:43 ` Gross, Mark
@ 2013-04-10 10:32 ` Rusty Russell
  2013-04-10 16:15   ` David Cohen
  2013-04-10 12:20 ` David Howells
  2 siblings, 1 reply; 8+ messages in thread
From: Rusty Russell @ 2013-04-10 10:32 UTC (permalink / raw)
  To: David Cohen, dhowells; +Cc: linux-kernel, mark.gross, David Cohen

David Cohen <david.a.cohen@intel.com> writes:
> 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.

Ah!  Not garbage, but it writes progress dots and status messages to
stderr?

I trimmed your commit message as shown below.

Thanks!
Rusty.

From: David Cohen <david.a.cohen@intel.com>
Subject: MODSIGN: do not send garbage to stderr when enabling modules signature

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 garbage on stderr:

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

Signed-off-by: David Cohen <david.a.cohen@intel.com>
Reviewed-by: mark gross <mark.gross@intel.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 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 "###"


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] MODSIGN: do not send garbage to stderr when enabling modules signature
  2013-04-09 21:39 [PATCH v2] MODSIGN: do not send garbage to stderr when enabling modules signature David Cohen
  2013-04-09 21:43 ` Gross, Mark
  2013-04-10 10:32 ` Rusty Russell
@ 2013-04-10 12:20 ` David Howells
  2 siblings, 0 replies; 8+ messages in thread
From: David Howells @ 2013-04-10 12:20 UTC (permalink / raw)
  To: Rusty Russell; +Cc: dhowells, David Cohen, linux-kernel, mark.gross

Rusty Russell <rusty@rustcorp.com.au> wrote:

> From: David Cohen <david.a.cohen@intel.com>
> Subject: MODSIGN: do not send garbage to stderr when enabling modules signature
> 
> 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 garbage on stderr:
> 
> 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
> 
> Signed-off-by: David Cohen <david.a.cohen@intel.com>
> Reviewed-by: mark gross <mark.gross@intel.com>
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Acked-by: David Howells <dhowells@redhat.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] MODSIGN: do not send garbage to stderr when enabling modules signature
  2013-04-10 10:32 ` Rusty Russell
@ 2013-04-10 16:15   ` David Cohen
  2013-04-11  3:59     ` Rusty Russell
  0 siblings, 1 reply; 8+ messages in thread
From: David Cohen @ 2013-04-10 16:15 UTC (permalink / raw)
  To: Rusty Russell; +Cc: dhowells, linux-kernel, mark.gross

On 04/10/2013 03:32 AM, Rusty Russell wrote:
> David Cohen <david.a.cohen@intel.com> writes:
>> 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.
> Ah!  Not garbage, but it writes progress dots and status messages to
> stderr?
>
> I trimmed your commit message as shown below.

Thanks! The new commit message looks fine.
But it's not the dots. It prints the whole logs to stderr, but the dots 
are more likely to get mixed.

Br, David

>
> Thanks!
> Rusty.
>
> From: David Cohen <david.a.cohen@intel.com>
> Subject: MODSIGN: do not send garbage to stderr when enabling modules signature
>
> 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 garbage on stderr:
>
> 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
>
> Signed-off-by: David Cohen <david.a.cohen@intel.com>
> Reviewed-by: mark gross <mark.gross@intel.com>
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
> ---
>   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 "###"
>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH v2] MODSIGN: do not send garbage to stderr when enabling modules signature
  2013-04-10  7:29   ` Rusty Russell
@ 2013-04-10 16:23     ` Gross, Mark
  0 siblings, 0 replies; 8+ messages in thread
From: Gross, Mark @ 2013-04-10 16:23 UTC (permalink / raw)
  To: Rusty Russell, Cohen, David A, dhowells; +Cc: linux-kernel

Sorry.  I don't use my outlook email on LMKL stuff hardly ever because of this sort of thing.

--mgross
http://umgwiki.intel.com/wiki/?title=Kernel

> -----Original Message-----
> From: Rusty Russell [mailto:rusty@rustcorp.com.au]
> Sent: Wednesday, April 10, 2013 12:29 AM
> To: Gross, Mark; Cohen, David A; dhowells@redhat.com
> Cc: linux-kernel@vger.kernel.org
> Subject: RE: [PATCH v2] MODSIGN: do not send garbage to stderr when enabling
> modules signature
> 
> "Gross, Mark" <mark.gross@intel.com> writes:
> > Reviewed-by: mark gross<mark.gross@intel.com>
> 
> Not sure that's a valid email address, so I added a space.
> 
> Cheers,
> Rusty.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] MODSIGN: do not send garbage to stderr when enabling modules signature
  2013-04-10 16:15   ` David Cohen
@ 2013-04-11  3:59     ` Rusty Russell
  0 siblings, 0 replies; 8+ messages in thread
From: Rusty Russell @ 2013-04-11  3:59 UTC (permalink / raw)
  To: David Cohen; +Cc: dhowells, linux-kernel, mark.gross

David Cohen <david.a.cohen@intel.com> writes:
> On 04/10/2013 03:32 AM, Rusty Russell wrote:
>> David Cohen <david.a.cohen@intel.com> writes:
>>> 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.
>> Ah!  Not garbage, but it writes progress dots and status messages to
>> stderr?
>>
>> I trimmed your commit message as shown below.
>
> Thanks! The new commit message looks fine.
> But it's not the dots. It prints the whole logs to stderr, but the dots 
> are more likely to get mixed.
>
> Br, David

Seems like Linus didn't bite, so I've put it in my modules-next tree.

Thanks,
Rusty.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-04-11  4:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-09 21:39 [PATCH v2] MODSIGN: do not send garbage to stderr when enabling modules signature David Cohen
2013-04-09 21:43 ` Gross, Mark
2013-04-10  7:29   ` Rusty Russell
2013-04-10 16:23     ` Gross, Mark
2013-04-10 10:32 ` Rusty Russell
2013-04-10 16:15   ` David Cohen
2013-04-11  3:59     ` Rusty Russell
2013-04-10 12:20 ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).