Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp3091495rdb; Tue, 6 Feb 2024 07:03:04 -0800 (PST) X-Google-Smtp-Source: AGHT+IGkUwFWJEFQH/sH7jqTXHjC/it8VykjwXj6XMnRHMPlFAhzrHZB9Blk4TPs0FD9+MRaMxNB X-Received: by 2002:a05:6402:b2f:b0:55f:4602:bf7d with SMTP id bo15-20020a0564020b2f00b0055f4602bf7dmr2232261edb.26.1707231783904; Tue, 06 Feb 2024 07:03:03 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCV+D6jDae/vNwqpAfJxgijRf5o4X/McgyBTSrMctjvHcP/G75WIuepiVPdfhuRADvVwas5gQwM3Wsb7nNx/r7hHKDcZUW7bzLnjpf9IRQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id u20-20020aa7d994000000b0056004e6d007si1194274eds.580.2024.02.06.07.03.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Feb 2024 07:03:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-55167-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=Cj2op3Q0; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-55167-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-55167-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A45B81F223BC for ; Tue, 6 Feb 2024 15:03:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 731F8132C13; Tue, 6 Feb 2024 15:02:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Cj2op3Q0" Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 287041C01; Tue, 6 Feb 2024 15:02:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707231776; cv=none; b=ey3wjaVg6v+KQJ+YpObYmhjplxHjPS4RB+w2nkf/7J9rynCwjLoVi7kY5vvLw1YXy+os5WC4SATzzCxhSMlq76DhlgHYUT3qxkc4+clJSnNDzgonrgHqF+212PcQuKWwhr2IY2YVwCLkbM+00/hs2DK47gKvlNlpg8c5rYTTEtU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707231776; c=relaxed/simple; bh=bAVUStCpnTHy34IuoXOjMIRGDhuXtT/wZlAhqE0qX3M=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=gq8l31ps4IARR/1Vvk/qAgB92ghrB4p9k8Ua3tVTsVVxbJMhavfj+VPg/9ZBh94yFmqOU3XskDg20Y9M9t8o9tvZSrtVT8zJgw+lkO6yliyfDxTLNRMwYqol9G5mqwy8HgumtQPZewvmn6OP6dnNJlzQr0BGQ6QNUUP3LSB1wjs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Cj2op3Q0; arc=none smtp.client-ip=209.85.218.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a3832a61a79so73454366b.1; Tue, 06 Feb 2024 07:02:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707231773; x=1707836573; darn=vger.kernel.org; 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=5SVGM65Du1cHuuQt3q8TxAhLq+zBG9N+zkQfXQrkH+g=; b=Cj2op3Q0tz2CIZQb6g3DXXnQmmJbWnx3l0ltCrswQgxjk6sgo817IIljWH4mgZVzmE rkGIRNgYxuwgAzRO+0eKLPXpKRtRZU+tsqX1e7UPLg9UbCLpjmTTYrwhzwjg/xTCcnrN 6o9cCWn+Ip52MTaLtOAguL12IrRUxJYDcrG5IUX8DBmpkHBiUfef4c6iAC93B9a7PjYh FKqzZM+BKia/R+9k4N5vii1xOb4JPlxFfdA+e9xBMtV/yjLBJjsXx+TFls5EyoLwq8UA tTQZLxzm7oqQdyuB+73qNvh+Sw7XdIQ3Bhh1ipj/7bXFtC7X6+O4uaf43aQvQdbtFNm7 enSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707231773; x=1707836573; 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=5SVGM65Du1cHuuQt3q8TxAhLq+zBG9N+zkQfXQrkH+g=; b=dJ4o1su1MS5a881lr42A1EMfdbxghJdCO5ec6cCSsyKZzKA1kYBAZ9GGq2hsew4tf8 I5vs3C9k+ywq3l6apQ+nvvYPfIILOcfOaFPleXTu6bmn9Qp6+0N9QsVEtO35mtxgqyIi qo/83EztCT3UySVDa7HstbTqbxkXwgHbiSqndCtJbp+wh6gMkx6ut5Sv6T4EREa2vEGj 5LjODj4PUi3vSsGGi22LmNWEJYVqhfgxplnqQekVS3Ihykkfsse/QDP3EZdXVpTp2v6T oBPx5e8AS/CTeiJnula9JcymkrKy/sqH/0fK6Szl+TIzylNE5ABDauMhtMJEj1/Y8gII EiIA== X-Gm-Message-State: AOJu0YxOeQAGsja/xmvVvpwjXLDC1EGUowVhafe6NEymkwFqFTDrNMwB xVagz1zSUrnf+ZcDRGT53X30A5zSkVQ0MvFFmyR5ulyupRURZeDcJ8d2FQrGa8+63ijG+UVLMHe N/eNmEEQAbOKd30WvAFveLJJYY7M= X-Received: by 2002:a17:906:b28c:b0:a37:b1df:30ad with SMTP id q12-20020a170906b28c00b00a37b1df30admr2400439ejz.46.1707231773299; Tue, 06 Feb 2024 07:02:53 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240206142027.make.107-kees@kernel.org> <20240206142221.2208763-4-keescook@chromium.org> In-Reply-To: <20240206142221.2208763-4-keescook@chromium.org> From: Andy Shevchenko Date: Tue, 6 Feb 2024 17:02:16 +0200 Message-ID: Subject: Re: [PATCH v3 4/4] um: Convert strscpy() usage to 2-argument style To: Kees Cook Cc: Andy Shevchenko , Richard Weinberger , linux-um@lists.infradead.org, Justin Stitt , Anton Ivanov , Johannes Berg , Willem de Bruijn , Jason Wang , kernel test robot , Nathan Chancellor , Azeem Shaikh , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Feb 6, 2024 at 4:22=E2=80=AFPM Kees Cook wr= ote: > > The ARCH=3Dum build has its own idea about strscpy()'s definition. Adjust > the callers to remove the redundant sizeof() arguments ahead of treewide > changes, since it needs a manual adjustment for the newly named > sized_strscpy() export. .. > - strscpy(dir, home, sizeof(dir)); > + strscpy(dir, home); > uml_dir++; > } > strlcat(dir, uml_dir, sizeof(dir)); An (unrelated) side note: are we going to get rid of strlcat() as well (after strlcpy() is gone)? .. > if (*umid =3D=3D '\0') { > - strscpy(tmp, uml_dir, sizeof(tmp)); > + strscpy(tmp, uml_dir); > strlcat(tmp, "XXXXXX", sizeof(tmp)); This code is interesting... (Esp. taking into account making a temporary folder out of this...) --=20 With Best Regards, Andy Shevchenko