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: <a5a26ed80402a0abdc83dffc2e7fb28b0b96450f.camel@perches.com>
Date:   Wed, 19 Dec 2018 14:05:32 -0800
From:   Joe Perches <joe@...ches.com>
To:     Bryana Rostedt <bryana@...e.goodmis.org>,
        LKML <linux-kernel@...r.kernel.org>
Cc:     Linus Torvalds <torvalds@...ux-foundation.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Ingo Molnar <mingo@...nel.org>,
        Tom Zanussi <zanussi@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>
Subject: Re: [RFC][PATCH] string.h: Add strncmp_prefix() helper macro

On Wed, 2018-12-19 at 16:32 -0500, Bryana Rostedt wrote:
> a quick grep in the kernel tree found several
> (thousands!) of cases that use this construct. A quick grep also
> revealed that there's probably several bugs in that use case. Some are
> that people forgot the "- 1" (which I found) and others could be that
> the constant for the sizeof is different than the constant (although, I
> haven't found any of those, but I also didn't look hard).

Several dozen cases exist like strncmp(foo, "bar", 4)
where it might as well use strcmp instead.

And a few mismatches exist like:

drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c:2285:		if (!strncmp(opt, "eee_timer:", 6)) {
tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c:318:	if (!strncmp(s, "power", 9))
tools/power/x86/x86_energy_perf_policy/x86_energy_perf_policy.c:321:	if (!strncmp(s, "balance-power", 17))
j

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ