Received: by 2002:a05:6520:3645:b029:c0:f950:43e0 with SMTP id l5csp332967lki; Mon, 22 Feb 2021 07:42:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8pUPefKqNeM8a3NWwTnimJVz/LO+k/eQSzRZe/EJsES+pwqY+BqmOO7mb4tqcBQ4GYLbR X-Received: by 2002:a17:907:104e:: with SMTP id oy14mr21188887ejb.218.1614008555064; Mon, 22 Feb 2021 07:42:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614008555; cv=none; d=google.com; s=arc-20160816; b=y96CeoovNNDf/0sCnPz4wAbg9Bf3WwPlWwLSsoTJyGqrlVzqn1mldDiOy3bweIhsM3 DRdVjyWNYKIXLJBpKnCBVj7CI5hyjg+HZYAMhecwdihdOvIe2sPv/+mHdUY2JY4quTw4 AqvrFtzunW9DkH7sjaKp54JfOoKGUHviib+xE+kMmqKSdwRGRSF7gBWKK9R6s7+/zAoE nqoSwVa9hqg8FwkH2Nl1fNh8LZlYQtg8KpfMNgvqOrdmjwFL1uLGf8aJSm3pj+9xYoO1 cC7RP9jG2hSMRce+zWxCXbVX8pL8LBNSMn/xs5ICsH6iytVCOKmaUOg/ZABvrFxCCGI3 UilQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date; bh=RkqixPgPDetGThjRBd/cT8DefqBzK/XfIbYEPNh0xMg=; b=qYXkEwroEp2JeMe//FZ7ezcPleLPg8y9AXgnjOGw94ZTwANr9x44LdxbPW2vQaPxn6 AiVoSW/136BqytgLSiPKzLzgMCXP/l2pYeQac1LE9e7PQYfcjD/4hHObUC5Qt4QqhiDB Bp9mXQjB2u8vPNpDc2mf4XuplRb79mf5mBiB14sOrkCmn0LSMhxMF2Z0bDtTx9M/C2pc OTwnIqfVxdHuv9gfXLESVA7k8pVFP8svCKSJ/GLVE8aQaOkL/puU0lEU5K8Zov3YjwRA T5c2XMjQeFVgP2zSDYzuBn+k+3xSU2Gm1ISIR4kCzANCNJiFScPcP9Jc+ekXOSPgCcjZ TQvA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t8si10563921edr.132.2021.02.22.07.42.12; Mon, 22 Feb 2021 07:42:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230463AbhBVPki (ORCPT + 99 others); Mon, 22 Feb 2021 10:40:38 -0500 Received: from mx2.suse.de ([195.135.220.15]:48582 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231232AbhBVPkQ (ORCPT ); Mon, 22 Feb 2021 10:40:16 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 39E24AF8E; Mon, 22 Feb 2021 15:39:33 +0000 (UTC) Date: Mon, 22 Feb 2021 16:39:33 +0100 Message-ID: From: Takashi Iwai To: Romain Perier Cc: Kees Cook , kernel-hardening@lists.openwall.com, Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 15/20] ALSA: usb-audio: Manual replacement of the deprecated strlcpy() with return values In-Reply-To: <20210222151231.22572-16-romain.perier@gmail.com> References: <20210222151231.22572-1-romain.perier@gmail.com> <20210222151231.22572-16-romain.perier@gmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 22 Feb 2021 16:12:26 +0100, Romain Perier wrote: > > The strlcpy() reads the entire source buffer first, it is dangerous if > the source buffer lenght is unbounded or possibility non NULL-terminated. > It can lead to linear read overflows, crashes, etc... > > As recommended in the deprecated interfaces [1], it should be replaced > by strscpy. > > This commit replaces all calls to strlcpy that handle the return values > by the corresponding strscpy calls with new handling of the return > values (as it is quite different between the two functions). > > [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy > > Signed-off-by: Romain Perier The strlcpy() usage in sound/* have been already converted on the latest Linus tree. So please drop this one. thanks, Takashi