Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1586676lqa; Mon, 29 Apr 2024 12:44:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVb3mRpjMgzUSQ2LKyHcHKMVqgkI+kq6WXyE22fA70/bDHIVyf0FVOwsOiKBbMojOy9tuaL+KfCu1oLD8ji3SgWLDGNppHE6VJbuUawgQ== X-Google-Smtp-Source: AGHT+IHZ8Li2hoq5qaM5tGiE7kyAsM97wsKCTlHFFznSYtRUXBmDxFmAr6xxgnnOq7UOCkmi3jOO X-Received: by 2002:a50:d588:0:b0:572:6ea3:a7e5 with SMTP id v8-20020a50d588000000b005726ea3a7e5mr418342edi.19.1714419845282; Mon, 29 Apr 2024 12:44:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714419845; cv=pass; d=google.com; s=arc-20160816; b=AF/zZOMjwCcXfubMSsZ0jL7LgICWtoVAwGldk5rEujbDzK6+pWwu/vKRdvA27ZEsa/ BOYoULpH8sqXjUfzp9rko5CVzm0EfU3hhyQnrRI0LLH1zw/kRKz3NND2/yjJkQ1xMhvT YM/T1i+nC33iGFUW4RjVDtQ8BL12IEgwswWA1+Tdl3nZX9MVgVQ7nt9A89n7qQG6so5d 173w16yBbuxNOmnXVTdd6p/xtFd1fWJxI/+5g1O1RvqHoohTB1+fcid5RRDn041sXGWx QIMHjAjtPT4S4a/bq9Cn1MUorDSAlKaK8ugGYAPux32J1lhXXJicRt6LuzlrDygHWjKw Q6uw== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=fKDr4fJvmSW109ZvoEEynaQf9bTi64PsX/IPJzqOlYI=; fh=5jOUbsR7Ns6kyUrLUucXZilPbH1rwC8T1I8bOwIfTTA=; b=aRdlrqdIejXmWwhSpzv6RCughDVCZAHjsj6Vmeb5XwKPnH53DFWEuwvSzOCOsPpn2e d+r4+kHlM/rYSG0qb5XEZrv8kcP0nnBY4w6wMr/BeCOw04luSd/VFoDmjSiCXrShH7m3 i07CnO+qd49Mo/rWti+I9VEJ+XbVv+5DbWHO+6QzXiEjBu92VzOc6W9PmYQC5Sjw1StD LyWDKh2UtnWznic6zGuQg8HRBKour4dtwL0jkGtKjDVPHqRGSKqJWOq1tNJG6H10J7nP Wbe/baZhRzPA4s9jXSRuPATmo7hTH0D3RtXzlK6DFJoDjSWFnmhLtsblGrNDWDPw3tpT t6eg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=P0Xozhv9; 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-162962-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162962-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. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id q3-20020a50cc83000000b005727dcdc009si1898363edi.584.2024.04.29.12.44.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 12:44:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162962-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=pass header.i=@chromium.org header.s=google header.b=P0Xozhv9; 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-162962-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162962-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 CBB161F21C7C for ; Mon, 29 Apr 2024 19:44:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6DC0F13C3DD; Mon, 29 Apr 2024 19:43:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="P0Xozhv9" Received: from mail-pf1-f179.google.com (mail-pf1-f179.google.com [209.85.210.179]) (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 6C8CE13B2BC for ; Mon, 29 Apr 2024 19:43:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714419827; cv=none; b=SwcV8kaPGRF/qOGDfrE5HKfqfOeSSg19zDo95ZbdWjNalzz+cfOKQ0nK5EKoiXGE7+HDY+2xjzY+x2OeDTlWUdhnZIrwuQjqFP3w1gYmnCfZZ4rM3lTjQxVP7lxC/41yhmQ7MGQHpRFO3uZ3m0mIeAJah/WfoC2E4kOxdmkw1KM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714419827; c=relaxed/simple; bh=VIy9QVTN2qcxjefTX2tH+Yz/iQIFnIJTdKGucOLxoMk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=nRmTz+ky5+/BZx6f69RAVusNcwy41GJYkunC5YJblBU31Ytm2q06+hO4qLfeTM3z61iSSUoNDs3zs0dR5rGGOuPzdpjwkd/eIUJLYbENbDOOZQ9zqT2NAzhl+GrpTLpxVY/8u6scYDSv1e63OrHyHLdl1f5kHRriEMwRZ6zRbJY= 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=P0Xozhv9; arc=none smtp.client-ip=209.85.210.179 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-pf1-f179.google.com with SMTP id d2e1a72fcca58-6ecf05fd12fso4381729b3a.2 for ; Mon, 29 Apr 2024 12:43:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714419826; x=1715024626; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=fKDr4fJvmSW109ZvoEEynaQf9bTi64PsX/IPJzqOlYI=; b=P0Xozhv9RS37ym5xZoGikRXXzF6BUvw0DwbemdHtvrjLOJqiDY4GPt88PKHzzWIR+Y j2aeg8Y8PnXxjiUdM+M3O2ZgXDoaqZl9DAZOUoqOxLFuXFiI+HVbDrbhnOfbHnJsT0Zl wTSIFhO0ITK8YcwFbumzZDus+C8g07vF/jloo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714419826; x=1715024626; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fKDr4fJvmSW109ZvoEEynaQf9bTi64PsX/IPJzqOlYI=; b=hIbRdA9TfGsNuYqKLr2HOnNv9li3L7JSNoFIqLHME+3YtEAtIgNhLEK5v/lqWvnzqd uC6Ilz/EAfZERM0VJp/kHr4g6GcynIid7WANZ3EkQvErp8jK9TV9qoA6zYXI8xT6g02S a0b4F7nT8deu2xlRfxYwOYEBrcHdDa23QjLCIe+OE0eRBdhSPCDOb43D09frP9S+0V9G eqcm3gR1VLKlhf3nhqbJb0/rEWNXyWweBM1z9JvvHoEc9mZueyXcgre4V98cupszcb2N fq1uGh9TL36JTBclWqt9cNwOuid/BQLZsQt0TiMKxjIu25S8UN10/sOEMjZ0Bg11UbIa 1w/g== X-Forwarded-Encrypted: i=1; AJvYcCVoD0293PRzgkBOKsNdh/C3yfOt2/av7MXjQa7c+jDbwtHXJulO2gzU4ARV0j0B/701j73HARty2ga7bKJWV/2B1QN8AVxRDYFka6/s X-Gm-Message-State: AOJu0Yy0yZ1qMI8g2CeCHNhc1VZHzMZGFURE+Kj5thImDWl4nwqnT4Am IAWA9l/0NbdiDn90fVc2Z4dWQtcLVTRhIE8i1qXF6tlF9vxCC+l7W0moiO5U/w== X-Received: by 2002:a05:6a21:1f24:b0:1a7:91b0:4f14 with SMTP id ry36-20020a056a211f2400b001a791b04f14mr627637pzb.23.1714419825750; Mon, 29 Apr 2024 12:43:45 -0700 (PDT) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id px11-20020a17090b270b00b002ae071346a2sm13389365pjb.36.2024.04.29.12.43.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 12:43:43 -0700 (PDT) From: Kees Cook To: linux-hardening@vger.kernel.org Cc: Kees Cook , "Gustavo A. R. Silva" , linux-kernel@vger.kernel.org Subject: [PATCH 0/3] kunit/fortify: Add memcpy() tests Date: Mon, 29 Apr 2024 12:43:38 -0700 Message-Id: <20240429194019.work.664-kees@kernel.org> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=604; i=keescook@chromium.org; h=from:subject:message-id; bh=VIy9QVTN2qcxjefTX2tH+Yz/iQIFnIJTdKGucOLxoMk=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBmL/httbmsQItvMY0uFd6j4hYaYCstXS3BgqKHL p0ncvc8EceJAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCZi/4bQAKCRCJcvTf3G3A JhLKD/4w53qKNAGkHRjVUlL3JoDVZHy+a4JqhPXqb8GmjsPB4621MjVd4rsZ6XmiKcwk2fnqbvU CHS6xbdOUc1AC9N6Xwmghk9x0r0l54IHzLMMXm1MqQNIl4syp5uc0i5xcqjwMqzpkHC+3ORQqTZ OrASafSnHzJxAfEgOQpZO8x3vejG6/2xBt46twYfrddMXXcENntF2TYjrM0LMzZAdex20gJbKtg kkgB/j4LxAfKQAoioOafYY35vvRtpoGQkjQBc6qVDxSTg1qRqmjDRe03GiKtW4rYxxzIZziJPE7 3d4e2V7wIjOIvjkIs+bpgPUIfGEbgonoQ+hVW2FZvsHdtOLuxxlg40j15ZM6le+MFMAnUTWrUen YQVUmTJHbWU5nl4QYNajhO8rmiezNiTGw6qkDpQEL3WaflIM41qzHlF9PHY2GgtleDA2ZB/gEKm pJP1d8SthelDtscHXc1yri6Ha1XHs0SM7kT7ZiAysCx+QKZt0HhpZYCq0HP4sfrEJvqOZcxCKMU rm8+rIz5i3GGrBR22svxrMoCNobGpwBl/6/pHgJBByu6o9gkLI9bm5JUf83f7Tnhxl01W8/XEsz nP9czNbmvxQDBov3/YqO2xukp4Ajn1ufJ+Nudhx5M7xhQFWv5V8+WEQ/7T8+6TSGmqNl0HLREoL r1PEON62 rLiag4g== X-Developer-Key: i=keescook@chromium.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 Content-Transfer-Encoding: 8bit Hi, This adds memcpy() fortify KUnit tests, similar to how the others were done. This is in preparation for removing the 0-sized destination exclusion now that we seem to be in good shape now after removing all our 0-sized arrays. -Kees Kees Cook (3): kunit/fortify: Rename tests to use recommended conventions kunit/fortify: Do not spam logs with fortify WARNs kunit/fortify: Add memcpy() tests include/linux/fortify-string.h | 6 +- lib/fortify_kunit.c | 174 ++++++++++++++++++++++++--------- 2 files changed, 135 insertions(+), 45 deletions(-) -- 2.34.1