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: <CAFo99gbGoyf6GEt4ST_Q_WfYe39j+ke7t7XL6QZBYvMesMNZQg@mail.gmail.com>
Date:	Wed, 24 Sep 2014 22:51:14 +0200
From:	Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
To:	Dan Carpenter <dan.carpenter@...cle.com>
Cc:	Andi Kleen <ak@...ux.intel.com>,
	Grant Likely <grant.likely@...aro.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] lib: string.c: Added a funktion function strzcpy

2014-09-24 17:41 GMT+02:00 Dan Carpenter <dan.carpenter@...cle.com>:
> On Wed, Sep 24, 2014 at 07:35:55AM -0700, Andi Kleen wrote:
>> On Wed, Sep 24, 2014 at 10:52:06AM +0300, Dan Carpenter wrote:
>> > On Tue, Sep 23, 2014 at 06:17:53PM -0700, Andi Kleen wrote:
>> > > On Wed, Sep 24, 2014 at 12:13:36AM +0200, Rickard Strandqvist wrote:
>> > > > Added a function strzcpy which works the same as strncpy,
>> > > > but guaranteed to produce the trailing null character.
>> > >
>> > > Do we really need the bizarre strncpy padding semantics for anything?
>> > > Why not just use strlcpy?
>> >
>> > We do need the padding in many places to prevent information leaks.
>>
>> Like where?
>>
>
> You're asking what would break if we switched every strncpy() to
> strlcpy() but it's not an easy question to answer.
>
> I've looked a lot at information leaks, but strings are still a blind
> spot for my Smatch.  My check only looks at normal variables, arrays.
> Eventually I hope to fix this, of course.
>
> I did a git search and Rickard has added some examples, but there were
> definitely other places that rely strncpy() padding before.
>
> regards,
> dan carpenter


Hi

If you want to see examples of this type of error, you can check the
patches I've done over the past two months.
So in linux-next

git log --patch-with-stat

And search for my email address.

And there is also an approximately 20 more patches I waited to see if
I will be able to use a potential strzcpy  :-)


Kind regards
Rickard Strandqvist
--
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