Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp7659639rwd; Tue, 6 Jun 2023 14:20:31 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ773XMBPeamktqYaNMXrTdqeoU/LWQ5CkqgqrVB+zKxi6CbV4E05o5rWnqAS+xshW9CGYoV X-Received: by 2002:ac8:5a53:0:b0:3f6:e2:398a with SMTP id o19-20020ac85a53000000b003f600e2398amr1295462qta.31.1686086430796; Tue, 06 Jun 2023 14:20:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686086430; cv=none; d=google.com; s=arc-20160816; b=IEv1GJZbxNFr2AKcrQP6f5ATXX5nx98p+BM6UtS27WsPlgCDcaML6z+ewAof64E8hP IUz7/BW/pu1d5icmIGAhXYc8LMjrSGxf/pHJrcjQhew1fM6v5Ov7eDTzyS4IX50ped1I YkxN4sMwwxgYLDs/UZHUo3cjkfSEgAQWVJu+B5NhHxJGo1dL+xpUUmm9DFwgK1KqIMql wdJN8HRx9SzZTiU2+gMzysn2z0pE93JHJ63RI7b4NS67QBvkNV2KX/OQdTzAnkbaigAH 2Vj6PzcDfZXKUJi+8IdTK/Ob0J4XSF8zMCuFrJDzdW9b7VZpPbqvEvRr4wSK09Dyk/Tv IXBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=BJ+tI/3uLBG3Hm6G+QtfUFEyGE7CCKdik+X8IMe59lQ=; b=rDT/Ao+w+mfo7tTTRpTK7N95OHCb4T8GFzj7U7ZmXOWx81JYCwDLeWTC+JWk4SNj08 juUAdLlvkSSuTVH9Wi0qenIyntEfUig1om27aHxnIz1XJIXMsdbFXvc2/efbK18DZVvo rJZRnxoeyWWQaE0LkqTYOSDGoqP/+RR0+4Sk9GlyEN4QqoLzuHEPlA6c0NYhLbJWLagK 84YahiuPoejUIWAMDJJR5vVyiiiIapJLZq/iIPKIJECd08f/bT8P9bokMdvkPoUwgPEx qZEH79JFQS1LgBjEmdAm+NSbfmagNn2Wrb1sGBfvfXNDODOjdjrXvUkVXg/son/Ftqfi l/uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=q+BgJN8G; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q22-20020a05622a031600b003f956866859si3558032qtw.210.2023.06.06.14.20.10; Tue, 06 Jun 2023 14:20:30 -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=@gmail.com header.s=20221208 header.b=q+BgJN8G; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239670AbjFFVIw (ORCPT + 99 others); Tue, 6 Jun 2023 17:08:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237575AbjFFVIr (ORCPT ); Tue, 6 Jun 2023 17:08:47 -0400 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CF6E19A2; Tue, 6 Jun 2023 14:08:41 -0700 (PDT) Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-30c2bd52f82so6693613f8f.3; Tue, 06 Jun 2023 14:08:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686085719; x=1688677719; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=BJ+tI/3uLBG3Hm6G+QtfUFEyGE7CCKdik+X8IMe59lQ=; b=q+BgJN8G10a0ZuOuN0UDx5Ro+/Sh5n3Z0AV4viAqhr6Es2Jx8P6aWMqFo1i2Tyb4jB eUZya8GS6kaJfF30rSFT/CtGWc8jazWug8LN24Yp7JWYmsjMDsZYyrwesFZP7TPaBvHn fHKP+9FGUPXlUziO0G6Dpcx1DlAH0mjGGq8ppUlMV4sN+PM1cx3SjokfuL7m7uXpibWh pZoVDrnrklHh/fO842OC6731MdoQBNLNy2r6wFpsnsKmoCO+YyrQcEAG8pYVHTZ0yKEF zZHOyiAS3zuhP6I16UGDb5YcEtyZQL1/Hd2GsFhnVR0me3SUrY5W3cO+pnD0ncaUfC/A LqEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686085719; x=1688677719; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=BJ+tI/3uLBG3Hm6G+QtfUFEyGE7CCKdik+X8IMe59lQ=; b=X4I6kfO5xw4D6wKwIk7FPzzaocQQvb2d2ZC+ILKr2kUbLLoZTuD3ZB1xNHNzhZQT8p ve2ItZXP4U1lAcL5GJdveE1RvYhmHGjS7yTRGi6X8mJ7NH9lPUpWPgjBj9cTQ93qcKT1 PfMn6ihO5/aSTMK0dJV9/78ecL6fnGJVOv/Tp81YdjIxpZrOg/KJcKvIUH992jJ/PqEQ JCCEkWx6732kkiq1WILJEfuO8/5FhvGxylVvLsOSlBeceNbXkfB6YXAarGQzANiPbBhJ aA1EU3UqEo+ibO1yOO/dTnzLuCR8UJJRqr2AylefNxw3Uwa/GU+tGNIO9wdf7UknlkXe nikA== X-Gm-Message-State: AC+VfDyjJktjPK/+7KWtHFvXIXxA2uTQHoBlPpb411cNyeGctqxd0bu2 xOvQfLACzSSSVZg81AeaImC3An95gaG7mSjFi2k= X-Received: by 2002:a05:6000:1952:b0:309:49e6:d1af with SMTP id e18-20020a056000195200b0030949e6d1afmr2609981wry.2.1686085719138; Tue, 06 Jun 2023 14:08:39 -0700 (PDT) MIME-Version: 1.0 References: <20230606182410.3976487-1-azeemshaikh38@gmail.com> <1833651082.3690424.1686084717406.JavaMail.zimbra@nod.at> In-Reply-To: <1833651082.3690424.1686084717406.JavaMail.zimbra@nod.at> From: Azeem Shaikh Date: Tue, 6 Jun 2023 17:08:27 -0400 Message-ID: Subject: Re: [PATCH v2] uml: Replace strlcpy with strscpy To: Richard Weinberger Cc: Maxim Krasnyansky , anton ivanov , Johannes Berg , linux-hardening , linux-kernel , linux-um , "Jason A. Donenfeld" , kernel test robot Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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 6, 2023 at 4:51=E2=80=AFPM Richard Weinberger = wrote: > > ----- Urspr=C3=BCngliche 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#strl= cpy > > [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.c= om/ > > Are you sure Reported-by and Closes make sense? > AFAIK the report was only on your first patch and nothing against upstrea= m. > 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. > Other than that, > Acked-by: Richard Weinberger Thanks!