Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 2 Jul 2019 10:25:04 -0700
From: Kees Cook <keescook@...omium.org>
To: Stephen Kitt <steve@....org>
Cc: Nitin Gote <nitin.r.gote@...el.com>, jannh@...gle.com,
	kernel-hardening@...ts.openwall.com
Subject: Re: [PATCH] checkpatch: Added warnings in favor of strscpy().

On Sat, Jun 29, 2019 at 06:15:37PM +0200, Stephen Kitt wrote:
> On Fri, 28 Jun 2019 17:25:48 +0530, Nitin Gote <nitin.r.gote@...el.com> wrote:
> > 1. Deprecate strcpy() in favor of strscpy().
> 
> This isn’t a comment “against” this patch, but something I’ve been wondering
> recently and which raises a question about how to handle strcpy’s deprecation
> in particular. There is still one scenario where strcpy is useful: when GCC
> replaces it with its builtin, inline version...
> 
> Would it be worth introducing a macro for strcpy-from-constant-string, which
> would check that GCC’s builtin is being used (when building with GCC), and
> fall back to strscpy otherwise?

How would you suggest it operate? A separate API, or something like the
existing overloaded strcpy() macros in string.h?

-- 
Kees Cook

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.