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>] [<thread-prev] [day] [month] [year] [list]
Date:	Tue, 20 Sep 2011 07:56:12 -0700
From:	Linus Torvalds <torvalds@...ux-foundation.org>
To:	Alexander Sverdlin <asv@...go.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] init: Carefuly handle loglevel option passed to kernel cmdline.

On Tue, Sep 20, 2011 at 6:45 AM, Alexander Sverdlin <asv@...go.com> wrote:
>
> Carefuly handle loglevel option passed to kernel cmdline.

Ugh. I dislike how you misuse the error numbers - it *happens* to
work, but we return negative error numbers, not positive ones in the
kernel.

Also, doing an if/else when one arm does a return just looks overly complicated.

Does this (whitespace-damaged) patch work for you?

                 Linus

---
 init/main.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/init/main.c b/init/main.c
index 9c51ee7adf3d..5827722ec491 100644
--- a/init/main.c
+++ b/init/main.c
@@ -209,7 +209,11 @@ early_param("quiet", quiet_kernel);

 static int __init loglevel(char *str)
 {
-       get_option(&str, &console_loglevel);
+       int loglevel;
+
+       if (!get_option(&str, &loglevel))
+               return -EINVAL;
+       console_loglevel = loglevel;
        return 0;
 }
--
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