From patchwork Fri Jan 19 21:14:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 189677 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2bc4:b0:101:a8e8:374 with SMTP id hx4csp1286497dyb; Fri, 19 Jan 2024 13:15:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IEW7yEl5HllWGAI5ljtxsXqr5FVu8mP0q/35TOnmlgys+1fMAo3kajqrXo4Zku2odes8uHf X-Received: by 2002:a05:6830:2095:b0:6e0:d3cb:21ad with SMTP id y21-20020a056830209500b006e0d3cb21admr437461otq.37.1705698926515; Fri, 19 Jan 2024 13:15:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705698926; cv=pass; d=google.com; s=arc-20160816; b=PIAa4mZNeO4UILjFPH5r4BTeDGCS+H1VuuoNjbjsBGznPOZD/1JadMHnAtPH4MSC/I e5iaGMW8LBfxhhnmMGiXXEcUpp5JqM/f67FjFsgcDv1m1EKmcoS+T4SvEyiR2XFre9Gj TmeLltrgBEuAJVT30GAEXdpO5JwqqxVkSH9DigNMLYEs7qGyLnfUtfQ0Pmw21rba6ipF +t/g0PgF/Wx22zWST7JyMiF5mMbVtdUgyQQSJizLV6Nc8Com6/A3nfiFVWPjDWVSPzj9 +gwBmc3vN7AsVQJMBjV8x9Y28pnnKQy6H2bP3R4a80GPXDxqj6uM3QRHeiUr5rpdW72F 0lGA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:message-id:subject:cc:to:from:date :dkim-signature; bh=1jO5gTxlFcZqy3fTlQWHVnYXrLv/qAX0Mnxwu0zISok=; fh=ig7nm3iBt6uuI3B9pZr4Ok32r8tnnv9ScxFMjH+85/c=; b=XhiSbj4WCKr4wEwlLVfue5FmhbrhElxAR9fvq3aitiTFo7l7OPiC2bBT5U8kJz2gpM eHGYU0YSK+PU+SW+0IH80xtWoWKGFgJWxbP0YMh99kKQVZNZRRoii+WaNxE8TZhGe/7L shhT60jhFO9JDP+dUmJ/2ex3QdJCsa7AoG81jxgWV+Dfmvvo+WmeUaqi11IaNsZdj+CQ oMtv1fUVmW6F0vRbVOfreGywayiuAntoDnKWfwirtCmjz8gMmgcA79NnQ0uFQGxfXhV4 gDSJ2ULAldS300atVgFurySRjO8iOnBaI+7mnXPPZtKeWYSAeOtOw9yQsL6kEdpRhwKq CosA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Npu+jXgd; 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-31564-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31564-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f34-20020a05622a1a2200b00429d3c4029asi78424qtb.463.2024.01.19.13.15.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 13:15:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-31564-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Npu+jXgd; 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-31564-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-31564-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 40F0B1C20EBA for ; Fri, 19 Jan 2024 21:15:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D38E58231; Fri, 19 Jan 2024 21:15:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Npu+jXgd" Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (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 136C938E for ; Fri, 19 Jan 2024 21:14:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705698898; cv=none; b=iekIKqporAU9EJEVXqd84kFG45tnyWNFtkfSak9KTGTW5V00DbQMPx6h5YVCMcT2Vmg8pQaQCmzRV9Qyr2dSHgHiESM1mhBQuGU3FVNMq9dkwnGrw44L91ggix53ldDdju1yhEK3BMnOOMxpHVdjneqxb3kwzYtDqd8FUZEgM+A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1705698898; c=relaxed/simple; bh=F9F2GNKmjLUbux+84Pb89lxHGN+eZi/eIvcnBt3MVnw=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=Sq/MXvw3hrPMdq9p5lxUJE/+pMOA7mxkeaTiKIj+2bfTv1fFJldXLIG6fopZBeT6rwmcglTYNXyYSpdqlWsRI5Xi1195gYtBOc24JgPL9+wCEY20stCu7/1kkvb4UBfiNxnp4B9CuIHZF0Wpvafb+xxVt9dGG49706Mk+bjT48A= 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=Npu+jXgd; arc=none smtp.client-ip=209.85.214.175 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-pl1-f175.google.com with SMTP id d9443c01a7336-1d5f1e0e32eso8923365ad.3 for ; Fri, 19 Jan 2024 13:14:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1705698896; x=1706303696; darn=vger.kernel.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=1jO5gTxlFcZqy3fTlQWHVnYXrLv/qAX0Mnxwu0zISok=; b=Npu+jXgdh1m5j24CHVteSOvlcRn7MaK7MqofDUJIix+GgSLeP6O6k2Tdb1ohzCK4ZC nPRTHJhdhxwbJ9dl1oZ2Gn5aGuhcWMSgrFQvEMjunPub5aB9ZlNaznsFBMdObUs82kso +z1973MPe3ZAWGYSKC29TH0D+kevL0dTJDUMI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705698896; x=1706303696; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1jO5gTxlFcZqy3fTlQWHVnYXrLv/qAX0Mnxwu0zISok=; b=b0jyZ7k7Gkw2ZGq0O50DYH3SP4kaQG3LaDp/afcddlsvbKTzlSM7E9qsBgbWqwUaz1 EBTE8FEk37Y/pJ8haDya6qDiLWgAtEbsMtT+kgb6bWTqy1+3OYmw1AxhheIjYyQkRXPX NlE9gxkkdiF8szWtdjAHiBD72G/xoGCDb2qbn52T/c1+Cz3JHkvM8ogydKnh0PSoj8uG ASma5LAwGd3hcGcp6/4k40h1NQd3hggyolz3Rpctzqi3QX0DgxtNkHYV850EDMxGe2YD R5QhSxMadzq80jO0/3aYOYQymK+twZe1t+iJSe/ROd2sCfPOrWPNYtlKKOuNoNKT4XbC yUDw== X-Gm-Message-State: AOJu0YyWUV7k/jNL7KDvLrJY4rWITxTOOxQfR2ZPUGhFeFjUNsri30fM M3mfN9yjnW9ieqKJyQZO8h69Mt2caPN1fnvqvWukBPlYRU/DuhOzgvxqFgLcoA== X-Received: by 2002:a17:902:db05:b0:1d7:20a4:4a91 with SMTP id m5-20020a170902db0500b001d720a44a91mr502945plx.109.1705698896431; Fri, 19 Jan 2024 13:14:56 -0800 (PST) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id kh6-20020a170903064600b001d5e1353693sm3433530plb.266.2024.01.19.13.14.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 13:14:55 -0800 (PST) Date: Fri, 19 Jan 2024 13:14:55 -0800 From: Kees Cook To: Linus Torvalds Cc: linux-kernel@vger.kernel.org, Andrew Morton , Andy Shevchenko , Andy Whitcroft , Azeem Shaikh , Brian Foster , Dwaipayan Ray , Joe Perches , Kees Cook , Kent Overstreet , linux-bcachefs@vger.kernel.org, linux-hardening@vger.kernel.org, Lukas Bulwahn Subject: [GIT PULL] strlcpy removal for v6.8-rc1 Message-ID: <202401191311.B6AA79D@keescook> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788554957582335227 X-GMAIL-MSGID: 1788554957582335227 Hi Linus, Please pull this strlcpy removal for v6.8-rc1. As promised, it is the "part 2" of the hardening tree, late in -rc1 now that all the other trees with strlcpy() removals have landed. One new user appeared (in bcachefs) but was a trivial refactor. The kernel is now free of the strlcpy() API! Thanks! -Kees The following changes since commit b0d326da462e20285236e11e4cbc32085de9f363: Merge tag 'sched-urgent-2024-01-18' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip (2024-01-18 11:57:33 -0800) are available in the Git repository at: https://git.kernel.org/pub/scm/linux/kernel/git/kees/linux.git tags/strlcpy-removal-v6.8-rc1 for you to fetch changes up to d26270061ae66b915138af7cd73ca6f8b85e6b44: string: Remove strlcpy() (2024-01-19 11:59:11 -0800) ---------------------------------------------------------------- strlcpy removal for v6.8-rc1 - Remove of the final (very recent) user of strlcpy() (in bcachefs). - Remove the strlcpy() API. Long live strscpy(). ---------------------------------------------------------------- Kees Cook (2): bcachefs: Replace strlcpy() with strscpy() string: Remove strlcpy() fs/bcachefs/super.c | 4 +-- include/linux/fortify-string.h | 51 --------------------------- include/linux/string.h | 3 -- lib/nlattr.c | 2 +- lib/string.c | 15 -------- lib/test_fortify/write_overflow-strlcpy-src.c | 5 --- lib/test_fortify/write_overflow-strlcpy.c | 5 --- 7 files changed, 3 insertions(+), 82 deletions(-) delete mode 100644 lib/test_fortify/write_overflow-strlcpy-src.c delete mode 100644 lib/test_fortify/write_overflow-strlcpy.c Acked-by: Kent Overstreet