From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752466AbbJEQNi (ORCPT ); Mon, 5 Oct 2015 12:13:38 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:34811 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752269AbbJEQNg (ORCPT ); Mon, 5 Oct 2015 12:13:36 -0400 Date: Mon, 5 Oct 2015 18:13:32 +0200 From: Ingo Molnar To: Alexey Dobriyan Cc: cmetcalf@ezchip.com, Linux Kernel , Linus Torvalds , Peter Zijlstra , Thomas Gleixner , "H. Peter Anvin" , Borislav Petkov Subject: Re: [PATCH] string: Improve the generic strlcpy() implementation Message-ID: <20151005161332.GA11063@gmail.com> References: <20151005161121.GA10776@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151005161121.GA10776@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Ingo Molnar wrote: > > * Alexey Dobriyan wrote: > > > I want to say two things: > > > > 1) strlcpy race > > > > > * In addition, the implementation is robust to the string changing out > > > * from underneath it, unlike the current strlcpy() implementation. > > > > Canonical OpenBSD version does byte-by-byte copying, > > this race is purely Linux invention. > > > > 2) strscpy() will copy garbage past NUL from source into destination. > > It won't fault but still, who knows what lies after string. > > So I think your argument is nonsense on several levels: Oh, you are right strscpy() - I mis-read your mail. So the argument that is nonsensical here is mine! Thanks, Ingo