Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp224358rwd; Tue, 6 Jun 2023 22:00:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5B7BIBVLFkMN6y6fhncwfjzD/EHI9iLRHYfKr9JM9nJsr5O4BNcN1jJ6rUTcurTOHP6Fp1 X-Received: by 2002:a17:902:8343:b0:1b0:3ab6:5133 with SMTP id z3-20020a170902834300b001b03ab65133mr13580250pln.24.1686114041262; Tue, 06 Jun 2023 22:00:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686114041; cv=none; d=google.com; s=arc-20160816; b=oHS/IO39EY81UFWcCNiRZv4q9VhA0+y5EcODCR4/nr6tfoaxo1a5WYCHMAtXYMTIzI 0v3cwIF6fLYm/iFbMOYK4oiMtO7CnKFPD4pqE+jhdi8KESQ3HrUnhKDQM6TqMNaC11Ag GuJqNGTFdNIuF5FS2jTB8TeE7i0Ch9ti6a2SwTUlFxq6hFwjvyYmgr1J5+dFuRsqnpIg YvvKYf7XQNPFb1icSOxQ4PBCB5ElZ5KDV9WAPnlZ7WVdHMnkwQQfP/GmWMGxCjTHuNFS DsFsbe52VpTSd9++v2gddurO6jEDReNYZzhwb9+7GakZRDcHCTCGpPDOybQ4+mtuk2Pn /COw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=eo5U/EsuEWFFOQeZ1hzgm+nKmzqxKnIhlLsGieqbE78=; b=POPh7x1YXjoPyji0ugWiSaAHZfARwmUlw3stwxewOmzLhL047vzd4hYh3ValjKP2Q1 n1DrK3qbTsCWSDhGxN9LT0xeq1i9k1We7f1qHgfDsEUWDl4e/c1FkT8FVkAIwD8Hfm4x eEkMPaMX/Z/bbZY28fyHUiHmI1NBVHgA2v22eboOsOjyhDapy9QeyI5xViX7fYOw3Evx Dh8Pg3od+nDZPCWZa8PwKW40I0JCs+KdV4q6YEI7SBZzvVDEcMtcTojwvG9hQc9k1Z4o JhE3Gge+UBuvG6DVNw4yQCPb7vd3zxtZ+BSc/fz8mP2DJt5EaYKR4+ku4K9kja6rK9bS AFhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DiIynji1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h8-20020a170902748800b001a1f6671a6dsi1445152pll.397.2023.06.06.22.00.27; Tue, 06 Jun 2023 22:00:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DiIynji1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234190AbjFGE10 (ORCPT + 99 others); Wed, 7 Jun 2023 00:27:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233856AbjFGE0p (ORCPT ); Wed, 7 Jun 2023 00:26:45 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE2091FD7; Tue, 6 Jun 2023 21:23:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0446463A10; Wed, 7 Jun 2023 04:23:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DE47C433EF; Wed, 7 Jun 2023 04:23:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686111822; bh=7sP96yW6yc29Ckr2GzZEmGrtPlO4yW5CLupbhWesCjw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DiIynji1RhG+2QeeyvmhHbOno6Sf1ehLKKPh4D68VDruy2w3ooysdrKASf+z6UGoU Ojcfzah5qzg6fTfj3JKiSHkpBgxECJS0H9XspVRQ77a+KwZVoc84jTBQP2kxI7EJdq 8UIprPkCU5ZKZeeZ2RvJ9Nwl+R7k78kMMerb+DOyIKtJG4ugllMGFmA6XTyKIh+35W OO+BIePAbHh3N29muyQJwGaMCacx3VnomE3Gw+ABC5fR3F/lt8JoAg9Aeyn2sJqLC0 9b7IQsKlGBz9cYbtOL6X+ogSl8dnU+1Eeqw3cd0bh2vjps9Z/C7CWk5k0UZOWPqDfW 3pnOpfnstswPA== Date: Tue, 6 Jun 2023 21:23:40 -0700 From: Eric Biggers To: Azeem Shaikh Cc: Richard Weinberger , Maxim Krasnyansky , anton ivanov , Johannes Berg , linux-hardening , linux-kernel , linux-um , "Jason A. Donenfeld" , kernel test robot Subject: Re: [PATCH v2] uml: Replace strlcpy with strscpy Message-ID: <20230607042340.GA941@sol.localdomain> References: <20230606182410.3976487-1-azeemshaikh38@gmail.com> <1833651082.3690424.1686084717406.JavaMail.zimbra@nod.at> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 06, 2023 at 05:08:27PM -0400, Azeem Shaikh wrote: > On Tue, Jun 6, 2023 at 4:51 PM Richard Weinberger wrote: > > > > ----- Ursprüngliche Mail ----- > > > Von: "Azeem Shaikh" > > > strlcpy() reads the entire source buffer first. > > > This read may exceed the destination size limit. > > > This is both inefficient and can lead to linear read > > > overflows if a source string is not NUL-terminated [1]. > > > In an effort to remove strlcpy() completely [2], replace > > > strlcpy() here with strscpy(). > > > No return values were used, so direct replacement is safe. > > > > > > [1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy > > > [2] https://github.com/KSPP/linux/issues/89 > > > > > > Signed-off-by: Azeem Shaikh > > > Reported-by: kernel test robot > > > Closes: > > > https://lore.kernel.org/oe-kbuild-all/202305311135.zGMT1gYR-lkp@intel.com/ > > > > Are you sure Reported-by and Closes make sense? > > AFAIK the report was only on your first patch and nothing against upstream. > > So stating this in the updated patch is in vain. > > I left the metadata in only for the sake of posterity. If it's not > helpful, I'm ok with removing it. > IMO using Reported-by in cases like this is harmful, as it makes commits seem like bug fixes when they are not. - Eric