Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp759771lqd; Wed, 24 Apr 2024 16:45:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWjxCDuAqJryYm9w6wok9bSo3qnhmeRDzzgwWFqSJ3N/+beRvHAwWwZniLUToBaaIqIcauielzUygrBMSgrPsY3yIaJIkgnyeLjAnU8KQ== X-Google-Smtp-Source: AGHT+IE53leCEyhAzgjeD8tpInQctAHetVph7NjZOcrvFA9IqgAq4RKokeYZeeD+mznUovW37POi X-Received: by 2002:a05:6512:1095:b0:51b:e46c:19fc with SMTP id j21-20020a056512109500b0051be46c19fcmr3037898lfg.58.1714002346854; Wed, 24 Apr 2024 16:45:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714002346; cv=pass; d=google.com; s=arc-20160816; b=aQFdVTcbHw4MBQrGUd0lQdDifQSs6I5qkrRIMIxZO4AlL84sgoAkjT5TzF+j54LLtw f36LLwTEmfJf8229ps0sJNA1Ge99zJNL1PetdpYHDEZF1gm+e1gqSTTfmrX6QhSYzbEY FUiKoJgj0dpFNADBLOg97QjLeuurhxIelJg86WtLwVarEo3M+uwVHmdSyMbh4tpFnJUW iJwTBzIgfzKhUVlpvEA19kQFjOuDKEFkgjpbNMtnvGhd064cAXFKLmdAM63MBM+J080R kiWeSFuFHxR0KEyTWHnKZpcXfIUg1fJQL0pKehl8e9Z1qh2gN4NvUTXl21vDrJNVfWj/ iKfQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=QZm37LU6QkjSBIlXkQ/R6Hvghsrw/r8BQ4yIk+1vAWI=; fh=j4NrjVTmeYdB94g98koCaCCW+Fkd14HlF4L7f+ibfys=; b=hs2NuwBDKMwR61d3rTWRug2qV++Q0Oe45Dx1S7E11e43wjlldNHfszqtGhyfvcCKDu gPd1qdiJM5devk0NXAE4JhyvfsGuj7kyRMOZ0F7qNojxJCc64zmsuo1/udQJ/r0CRwcK /KYNN7iJfc4uo2wMss55bx4f30rI0EmyRxUw5ThITbi3W/asDfsLonMf+8KiOXyOZVuP q6pnGjGIKr0aWk5wieZyHNJCQ/R5dBKFL58eDbQqCM9LgMuMSvOA/R5Gzj2azAOPtpDC EufmLpJ/SlNd3bmKw9JJSOHUQ5M6gktDiFryLkj+5kFpIMkNu6VCcxEhVhGQGbjycaRY u0zA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lL3ORxFr; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-157856-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157856-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id nc11-20020a1709071c0b00b00a55afd8f5e8si5343466ejc.870.2024.04.24.16.45.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 16:45:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157856-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lL3ORxFr; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-157856-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157856-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org 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 922C81F23EF5 for ; Wed, 24 Apr 2024 23:45:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4D02E16F262; Wed, 24 Apr 2024 23:45:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="lL3ORxFr" Received: from mail-oa1-f46.google.com (mail-oa1-f46.google.com [209.85.160.46]) (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 0D64113A3E6 for ; Wed, 24 Apr 2024 23:45:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714002338; cv=none; b=YsWmJvNtNYWvsIMN6Ogi9jvHrDcEHJSjefP5RV4WM9PMpvWzl45BEhcyCb3QSojwxC2U/++5iEygCpchxuRQtmMqhlk/918uKfpVHaoeZoMhtIXs25rH2GNski4769n8q+ws9JIiugUHzw1z/VbO2sW9c7frhiP+WX/vWZFoWoM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714002338; c=relaxed/simple; bh=YZzLecDMNjlJHaICMLtyO//sLAP5HbJP2X8zw+1KyoY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=ewHVeMyz5tG5zKT7mBaniOfPawztxHyKtA0uKXU7WOE0PkcBBNAq0cwyj1PL2n0zRPLq/ZMH6cPn9vmyRpuQ5yJNe5bzmyxvlJqZB8yzTgxKs0P6BOdcyHMSUGkJY+llb0g88qkfdfW26crYbLfUzhEuB2zhKruXfTECXWo4woI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=lL3ORxFr; arc=none smtp.client-ip=209.85.160.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-233e41de0caso276916fac.0 for ; Wed, 24 Apr 2024 16:45:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714002335; x=1714607135; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QZm37LU6QkjSBIlXkQ/R6Hvghsrw/r8BQ4yIk+1vAWI=; b=lL3ORxFr4BrN8ihblqZoEik9GoMscjpQ0ciyJyoM72TQzKCEFoIIxzxCJN1qDoCWhx sANiuXfqRbse9f7CGW3SZUgLaCId+pjH/OZvivgBQcwYA7bdjho4l2NpkjkDU8CK0enP SKeom3wN4v0YAOBFNjzN9W6aZ8BQRlARl5CAE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714002335; x=1714607135; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=QZm37LU6QkjSBIlXkQ/R6Hvghsrw/r8BQ4yIk+1vAWI=; b=JXldTDRP4JqifosE2dJEHabV/s7QuNuc26/i25S0Ik346W86p9S7nj6bpsnBqq90GN ttrmP5hCGcLWXX6cf+U+BVb1oLdGPlhqZjsNNNhU0E3s2lf7BAxnzsLl5VvVSrDgGjCo e0cVR5zoFvOMFJipFpndJR4JdH+XYfmKbwLDBgaKNPqofkYLlUDP2GI8HBqO7AAIXfCz dmcubkPXm32FVb78dQ1yXJ9qXuZnuao8uF/pjRAvpuVArxMLm0yhSse3pPjt1vSYAhXH y11sCnqMr4NPeVoZ06bjk+khqTG7LYobgD21WOjWy7pMPLKLKX+ITRWdO+rbnFiUJUse rseg== X-Forwarded-Encrypted: i=1; AJvYcCU5nm1KtWFvizxf7Tp5p/7jHhuBUVdJLZWQ0eWmxqA1emxCdzrBZjcGOB7cLvgWCWjuOQtGL/IY0NKr5xwZxB5Mz1deeFRRCOHSt9pX X-Gm-Message-State: AOJu0Yw0h2nxEumxftCoOIxIQ8zwr/DHnu+lbP2AI1PMN2BLJLiKVACu D8zGysci+uQdIrYHriIGtBkrbaltRS09Y+RXRUHTZgb1JW0K01i3yhAd1mAnVA== X-Received: by 2002:a05:6870:c14a:b0:235:489d:ceeb with SMTP id g10-20020a056870c14a00b00235489dceebmr4367954oad.23.1714002335183; Wed, 24 Apr 2024 16:45:35 -0700 (PDT) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id d2-20020aa78142000000b006ed007b3596sm12029990pfn.69.2024.04.24.16.45.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 16:45:34 -0700 (PDT) From: Kees Cook To: Fei Li , Justin Stitt Cc: Kees Cook , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] virt: acrn: replace deprecated strncpy with strscpy Date: Wed, 24 Apr 2024 16:45:31 -0700 Message-Id: <171400232813.3283422.11054250337629213107.b4-ty@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240320-strncpy-drivers-virt-acrn-ioreq-c-v1-1-db6996770341@google.com> References: <20240320-strncpy-drivers-virt-acrn-ioreq-c-v1-1-db6996770341@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit On Wed, 20 Mar 2024 23:27:09 +0000, Justin Stitt wrote: > strncpy() is deprecated for use on NUL-terminated destination strings > [1] and as such we should prefer more robust and less ambiguous string > interfaces. > > We can see that client->name should be NUL-terminated based on its usage > with a %s C-string format specifier. > | client->thread = kthread_run(ioreq_task, client, "VM%u-%s", > | client->vm->vmid, client->name); > > [...] Applied to for-next/hardening, thanks! [1/1] virt: acrn: replace deprecated strncpy with strscpy https://git.kernel.org/kees/c/e8a87d0cd048 Take care, -- Kees Cook