Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2077883lqo; Sun, 19 May 2024 12:13:18 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVipqyZZO/M1NXn+QwOedUwd60tebk7QSyPDRuNaRSl6aFoMPLJ5Rzp63QK4tQcci48fVJ/31b6AldX+Ti7MlTkImrMgA9yo+kzVY1/3g== X-Google-Smtp-Source: AGHT+IGp8IZUz3Pi42r78qvH5vXxLPYclmrjHbBec5aAf6zX+607Rtg78oHlx5+j27rF+HDgZKjq X-Received: by 2002:a05:6a00:2e9c:b0:6ed:41f3:cd06 with SMTP id d2e1a72fcca58-6f4e0298a79mr38543175b3a.7.1716145997777; Sun, 19 May 2024 12:13:17 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716145997; cv=pass; d=google.com; s=arc-20160816; b=yvWLSTfGVAEuPy4ekWqrIp15rHt4L5YBssKU1JRBnL8awF/N2oCq2awU5mMf77qJwn jKNEoXVP2zR6mlwxqgxubV1hWxLj2FkApkEAZ7kZkWkLTLqjYMmW/P0SsYb7kBe6P0S5 Gd4h91/6xCX+knaleFRRMF5AHMSEzmbK7YDl/vASfyNTrSkHaq/gGH6KBJgtLQTX+8N0 AzJuOhBT2g7npzJmtnFzLiV17O2PYfP/NrJPA60OC5V42SFqWkYfpOphmBLJKfBJky2/ aupY3238dXDernA0qXZI1u02k3D4Itkhh6Wpb2yGG8nwxLrTRvcuT3JliEa4gNSwjJ4K 9+fg== 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=ejuUaE8Tf+21HDVBQI8KoPt1q5m6R7BpPs5rhgo54Cw=; fh=eUuWPBmqHjhpkwjREpwsdHzB4EbUrqd5FkKv09G5vCs=; b=WWmPOoy/XpsfXYgWP5rzP4yhEysl/tb0SDj5zaPjSVnHafJKYMnCy+BGOMC5yoiiOJ 0Kb2DLdFChXD+SzQKIuSAAnjhsC3QvtMfkGVFuaZrp0EBJZ0aTwZ9RAhw7pWKRIuoBUv OFfV/Nxz8T7DJuQLuXf5VQznFoRRWYA8PKRELBlTlpQ5JnrUPvPev7PTvCtpbtCFDxBb PzCLSi7ZioJwthR/Qt9yVA2KKPPchECbPx4fypU+3bzvGqLfqTXtOFosJiBqXrvhCiSP gGB76qOZ9yvP2qF93tKlo6aBhx3+7vhaSgEB2gVD85QnrK3yOndiml4YewRo4++FTUhR 7akg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gPYddY8v; 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-183220-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183220-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 41be03b00d2f7-654b2e8c1d5si9138811a12.858.2024.05.19.12.13.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 12:13:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183220-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gPYddY8v; 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-183220-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183220-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6A2752810A1 for ; Sun, 19 May 2024 19:13:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8705050A93; Sun, 19 May 2024 19:12:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="gPYddY8v" Received: from mail-il1-f175.google.com (mail-il1-f175.google.com [209.85.166.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 4BE946FE21 for ; Sun, 19 May 2024 19:12:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716145978; cv=none; b=iuBQC5vkpUlJi6pbuM96C7yvm7JFRCIGKsjH69LKccWHXsBNnj8uMkrh2UkC/4/WOY3BF7xftKbjVrIOnyQ2bp+q/FFzNTbwYeYn+XL3CklLTGrK8nvmsAr7pjyjfdtS52WO2MSnjOGvuKhoXayfG2cnQm9bZxZtGay0SsqlFHg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716145978; c=relaxed/simple; bh=TvYiE6RK2shFoVTWXPZeqyoZ8YKAjkG6Ellf0yg/u7Y=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Y5PINR5qYIQu/Pin917/ApqTxnM4J4ybIrEIMAI/cosTlmJvR9HIUAbdAMleDSD2D+ivH9uY/O8dO/FHFNMjPOx06WKLkrANKHlA17VFHoRxashRgkEvFGvyvhHGsfPbzBOtjRDiQUVySlh64yjd74cX4Wlf+koNfQQj2IW5MWQ= 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=gPYddY8v; arc=none smtp.client-ip=209.85.166.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-il1-f175.google.com with SMTP id e9e14a558f8ab-36c6e69180fso7712865ab.3 for ; Sun, 19 May 2024 12:12:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716145976; x=1716750776; 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=ejuUaE8Tf+21HDVBQI8KoPt1q5m6R7BpPs5rhgo54Cw=; b=gPYddY8v6VNIb8mBKGQg5fi8moa5PQZojxzpbfLHisKxPd54pxSAg1joBhvooMl7dE 614g0hOPOIlRX8jjpkpxnVMT8C8B1zoYGIcyPr6hRkjSCTUl3RaJgV0Xzr9zzaksge2Y +WtaCCsxfovTlfgX/tuJnnZzyqFQRZjKaL5dY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716145976; x=1716750776; 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=ejuUaE8Tf+21HDVBQI8KoPt1q5m6R7BpPs5rhgo54Cw=; b=oYgX5h4rsF2yTfd2foOeW6XxcJ6VIxdw7ujkV35PEcEBUl93Xc6v1NfVThEilrweLS qotSfpLw1Ez6KYBrLPY/tQRPnN9aR1fKEWFmEkFTPzCfJ5CWlS9WOxsEvDTSQnw7Dk2d APu6oHiRVT0ipr/gGLEkFByzC377XOFiLpvlqBytaCv9u9ew/YHzQwgoGWllNAC9ct+3 Y4nDOxB3wSpe/y8AEso4znYWLl2Sa7L4yv5+PMmIBadsjtwIjCJnXIw0wuskNyXlpsQL hn/n+qii+S+w5iMA/cWFO32HFR/0Z/FOVMkBvg5Vz21T8JJQH0TjsMsPoqRzwtBekLrd /blg== X-Forwarded-Encrypted: i=1; AJvYcCUpjhmisM8ZW9AO/tzjsbHttA7nDeNwPn+oj55Wv4Be7Ya4Fe50sPnnXV2n2ytGDL5z7GlSlydeH7k73adMsmMgTFlbVBwr9TmNsB0r X-Gm-Message-State: AOJu0YyQXgis2bLS8i5jFKi4XF4gDsEny7Zm4pJebTbuOqOsT/5hmBqn BKWZFvv88bTEF0UEXIIrvj7RftHLpqmVb6UTgIZnBqRC/UFCgPngyotgLzcjTQ== X-Received: by 2002:a05:6e02:17c6:b0:36a:352c:44d6 with SMTP id e9e14a558f8ab-36cc14424c8mr319581855ab.13.1716145976473; Sun, 19 May 2024 12:12:56 -0700 (PDT) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-665eaa5108fsm2450328a12.7.2024.05.19.12.12.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 12:12:55 -0700 (PDT) From: Kees Cook To: Mark Rutland Cc: Kees Cook , Vitor Massaru Iha , Brendan Higgins , David Gow , Rae Moar , "Gustavo A. R. Silva" , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-hardening@vger.kernel.org Subject: [PATCH 0/2] usercopy: Convert test_user_copy to KUnit test Date: Sun, 19 May 2024 12:12:51 -0700 Message-Id: <20240519190422.work.715-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=1061; i=keescook@chromium.org; h=from:subject:message-id; bh=TvYiE6RK2shFoVTWXPZeqyoZ8YKAjkG6Ellf0yg/u7Y=; b=owEBbQKS/ZANAwAKAYly9N/cbcAmAcsmYgBmSk815MmLWo2vRuElgQ1FSs0sA1xblomw+Xqbt tmURv+t7Y6JAjMEAAEKAB0WIQSlw/aPIp3WD3I+bhOJcvTf3G3AJgUCZkpPNQAKCRCJcvTf3G3A JuEmD/4nCIUvqCOjE0Mo2VIX1bHMWtY80KIg/79W7VPn/1qIZ+MmRDTNWVpZ/dz0EbAffYTb56p Oj9GKp09vCwmi4tQ83ha7ZYpKlwMDW3tbGrrmOF5FGLak/gPLg9uwt3swqh5VYjcNK2Rh4upDow dEFZrILnKqdSmOxgUsiA+7NXR2G/EvGgy14zMeKKzLK+HveIXqa6PdXaKWn262gOcawn2vl05NY HaEbd4i1KFdVRZpMhq4XVnxo7etflWjYNKAfXa5wcSk0pKhMO1Dtdm1kzQCWU55waZK/xlewVY2 2iDWaynNbWczJvg9l9o9R/sQ4OY0U1K90pEVbR5DxruG89nWoCHQdB1Q8nM0ik93d7zzvqBpx6J milPQIdiyzlFOYRJUxCDZ0X/2nxe6p2klL2cw7umWE8MOgGklfGyjSKJCKuQ10i2RfWW5fRpVYj z5cV0UU8Xk2bSHt6V58km4obdTgPMQSNogupKFuaU8Ry7gIXfOt1768JZBWz4KjVDvCDtOqiV9N Y8mbKPGWh+ZgixIqI1MBD29Zi69nXR9meibFu96JPoYXjX1KQhwFAJeYhc6AZa4T2ABg0KqWeYD W9nqK7ixiB4vZVfUbHDmQNRTAIMyHYF/uL7Moh+kwBZ17cU0vLCTZdx3c5Vdzst+oC4bHf719hG Y3urkwD DljoLGuQ== X-Developer-Key: i=keescook@chromium.org; a=openpgp; fpr=A5C3F68F229DD60F723E6E138972F4DFDC6DC026 Content-Transfer-Encoding: 8bit Hi, This builds on the proposal[1] from Mark and lets me convert the existing usercopy selftest to KUnit. Besides adding this basic test to the KUnit collection, it also opens the door for execve testing (which depends on having a functional current->mm), and should provide the basic infrastructure for adding Mark's much more complete usercopy tests. -Kees [1] https://lore.kernel.org/lkml/20230321122514.1743889-2-mark.rutland@arm.com/ Kees Cook (2): kunit: test: Add vm_mmap() allocation resource manager usercopy: Convert test_user_copy to KUnit test MAINTAINERS | 1 + include/kunit/test.h | 17 ++ lib/Kconfig.debug | 21 +- lib/Makefile | 2 +- lib/kunit/test.c | 139 +++++++++++- lib/{test_user_copy.c => usercopy_kunit.c} | 252 ++++++++++----------- 6 files changed, 288 insertions(+), 144 deletions(-) rename lib/{test_user_copy.c => usercopy_kunit.c} (52%) -- 2.34.1