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] [thread-next>] [day] [month] [year] [list]
Message-ID: <1500546142.29303.133.camel@linux.intel.com>
Date:   Thu, 20 Jul 2017 13:22:22 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Rasmus Villemoes <linux@...musvillemoes.dk>
Cc:     Rasmus Villemoes <rasmus.villemoes@...vas.dk>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        linux-kernel@...r.kernel.org,
        Alessandro Zummo <a.zummo@...ertech.it>,
        Alexandre Belloni <alexandre.belloni@...e-electrons.com>,
        linux-rtc@...r.kernel.org
Subject: Re: [PATCH v1 01/25] lib/vsprintf: Remove useless NULL checks

On Thu, 2017-06-08 at 22:59 +0200, Rasmus Villemoes wrote:
> On Thu, Jun 08 2017, Andy Shevchenko <andriy.shevchenko@...ux.intel.co
> m> wrote:
> > The pointer can't be NULL since it's first what has been done in the
> > pointer().
 
> > -	if (ZERO_OR_NULL_PTR(addr))
> > -		return string(buf, end, NULL, spec);	/* NULL
> > pointer */
> > -
> > -
> 
> Well, ZERO_OR_NULL_PTR checks for a little more than !addr, but I
> suppose that if anyone passes the result from kmalloc(0) to %ph,
> they'd
> better also pass 0 as the size, so the .field_width tests should be
> sufficient.

If we care about kmalloc(0) check we better to do this in pointer()?

> > -	if (!IS_ENABLED(CONFIG_HAVE_CLK) || !clk)
> > -		return string(buf, end, NULL, spec);
> > -
> 
> Well, it may be safe, but removing the IS_ENABLED(CONFIG_HAVE_CLK)
> check
> means that clock() becomes a much bigger function when
> !IS_ENABLED(CONFIG_HAVE_CLK).

I return back this in v2.

-- 
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Intel Finland Oy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ