Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2156714rda; Tue, 24 Oct 2023 14:19:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFARSDrH8RRRRfIW2uFZ3DRBsNPKV9q0uxyNONw+uHvrGLEYk24/01312ah9p2PPsQioLEN X-Received: by 2002:a05:6a00:b53:b0:68b:f529:a329 with SMTP id p19-20020a056a000b5300b0068bf529a329mr11314065pfo.5.1698182352165; Tue, 24 Oct 2023 14:19:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698182352; cv=none; d=google.com; s=arc-20160816; b=Ft1L5uyYoDNJ76WKg9YXvE0bm1rTmih7P2RIstDxxEciFsUMLsUjkId9l6s/gwoTyr bdQbXxvo0vL8JTEOJXjV2iPUHDhaU5zD3a4SohSOYXff+SW43iAyvFx825WUbVH1ZTHp dC0wbPKSxFGfb4kGNF6mSGhpDe1+Zk1AzTSJXo+aLs31rKZW6b2jdzKRI3DzFWcaisyX d6eDT6Y4CIE/F8VMmDmVoVWp3XDcrdYDqwlPsrVyLuK90eONdQG/Y5P7KAMxmRJVfX3R G4Q/tf+KGIVYLzaHznu9ZAjNDnhpx13E/GRDxWX1xJRyzy7MaZxqU35LSKyIVBEMCeWT 3HBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=z44BPeMtE2kACzCzizrt3sSV/gaHEispvl8DNfLTFYw=; fh=ECm0sWxuqPMPJrOvbl8BCdoHgHcK7uYeFF2VkdZd0Co=; b=ukWLGiORQyTld+hQmaELKWxYcsmj8Ux9Uq3DIXdEyR5Bdeuzc8TOkzLh8jU8H61qpE rE34BVUv8eVmNoq6bfgt1K6nxFYucpfJqDOC3EuVF1jMGf0LbhY3DKaw/juNCinT8tyi /sNnz1YmrHblju1CGILRD4jx0mxa9xjN8ewq5U+kEZQ5WIPiNDX690lrmFc344rXJKG4 3PN1CSvQyQKHrEb7FYiukIx+OuShkA3UFbL5hGyzLyojcubw97T3tPO/O4q+dVLVQXza vIz/o7TCvqAo/x8chfayiGeN79xeWH6wPsV6PNls4sl8KpWFv2uO8n5dK5cuH5SFtnRW xC7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TIwa1Q7X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id e8-20020a056a001a8800b0068fba6a7375si9101710pfv.321.2023.10.24.14.19.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 14:19:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=TIwa1Q7X; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id F2A04802AF38; Tue, 24 Oct 2023 14:19:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343815AbjJXVTI (ORCPT + 99 others); Tue, 24 Oct 2023 17:19:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233364AbjJXVTH (ORCPT ); Tue, 24 Oct 2023 17:19:07 -0400 Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2AC410CE for ; Tue, 24 Oct 2023 14:19:05 -0700 (PDT) Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-6b6f4c118b7so4088643b3a.0 for ; Tue, 24 Oct 2023 14:19:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1698182345; x=1698787145; 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=z44BPeMtE2kACzCzizrt3sSV/gaHEispvl8DNfLTFYw=; b=TIwa1Q7X3jjYVUJNeubx/TLG21qBuyU/zU+FucIySGmdWBABnr2q3jmvATXm6Rb+XN kK40MgjdpuwcNx4ZEKuz5OtQklHK2GOydJfpef+F7f9b/C6PGlZLAIzYa17Ye4j7pLF/ qpefgOmGI71QvMciI2kOOCOJN+IcChKulKSGA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698182345; x=1698787145; 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=z44BPeMtE2kACzCzizrt3sSV/gaHEispvl8DNfLTFYw=; b=pgcSayNcM3TikXoUtSKN6zNgPxBKw6O1U3T44daIEjJ6efZTXOeVjQGqaPgIvFiYE3 /x6qDWPE2UnIOhKzS7OQ0IaBb6dKBCpJfZjvDvfL155CaWUvWcqZGmpyRsVAI1q8y2G7 P+j5dYP4duSgqEuXwxWpha2NxG0mP3YGZEZhqp+Bqz69DNspPnW043FzFPRNSOYy7WxR zmKqMApJqEaZPvj2KB/c3ysHIWs3waMvZwEnJntY9DcfHQ8ZCM+BvZW4Z+yeFKExzijK snxjjTJ3vIvuUEaSuDD6eG7MbWczSmG8FwF73shGyYJM0Kw9EtWJ4e1AKXVRHdaTpVmS 2c5w== X-Gm-Message-State: AOJu0Ywc8QBjpU2Q9kGAJrm49DnwQZNtHlWIfnoEUTuX0wZIyba8Lk9a W8HRU/DQDyH5qrZzm89vaL8qgWNb32bVPHKxC54= X-Received: by 2002:a05:6a00:1595:b0:6be:22db:7a13 with SMTP id u21-20020a056a00159500b006be22db7a13mr11429436pfk.25.1698182345417; Tue, 24 Oct 2023 14:19:05 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id x12-20020aa79a4c000000b006bf536bcd23sm6081290pfj.161.2023.10.24.14.19.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 14:19:04 -0700 (PDT) From: Kees Cook To: Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, Justin Stitt Cc: Kees Cook , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] dm log userspace: replace deprecated strncpy with strscpy Date: Tue, 24 Oct 2023 14:18:52 -0700 Message-Id: <169818232969.2100071.1483595444634836042.b4-ty@chromium.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230925-strncpy-drivers-md-dm-log-userspace-base-c-v1-1-030d7bcf1004@google.com> References: <20230925-strncpy-drivers-md-dm-log-userspace-base-c-v1-1-030d7bcf1004@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 24 Oct 2023 14:19:11 -0700 (PDT) On Mon, 25 Sep 2023 07:06:03 +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. > > `lc` is already zero-allocated: > | lc = kzalloc(sizeof(*lc), GFP_KERNEL); > ... as such, any future NUL-padding is superfluous. > > [...] Applied to for-next/hardening, thanks! [1/1] dm log userspace: replace deprecated strncpy with strscpy https://git.kernel.org/kees/c/f8cff5441800 Take care, -- Kees Cook