Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp567985lqp; Wed, 12 Jun 2024 09:32:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUvlp6ptIQPFCFnYVe5TBrxA//BIYj+xJ+fmG9vEuJI5xmICxEbDQr4YPPDktistld8KQ3PegWeFGQ4W1XGbqluew4kLvEUnfovREiH/w== X-Google-Smtp-Source: AGHT+IGRaghhw7Jy4DcwIOg28gnDnGRbVaDQYjbQ9q3IDXu/hVGGzL0mETqzfWUKPf0AlMjI7V7q X-Received: by 2002:a05:6870:a408:b0:254:a624:3ada with SMTP id 586e51a60fabf-25514bae736mr2659093fac.15.1718209971367; Wed, 12 Jun 2024 09:32:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718209971; cv=pass; d=google.com; s=arc-20160816; b=P/qLtjMsW31Y14UMYBCXZTgMXet4FsnoBg/FLiP+mXzxTD9lW1bWBJMOBzALm6V46l grvdijM8Y8XB+MIMpiLsCTdEWpnNg/th24DHDvyD75kQRXNzw+XzBilUqezqewneqGtb cL/ZXUGSoispVRFmqE5q+RbYfnzSKzU9Q+k0RBksUR6DO8E8i8+C3s3Gm8nlcprcDKki xn+YatAPccynO2kxEST3ORAbSryhJW+FfkQMJNMrAjOoVbVYCOqUiumj0MMo1KEmfFO8 Avtf6DpCoKaUihWbOVXGzHDJUHQlDjHf/CSp+ckWUnH6uwdxmZwd8bv3jd+hcbMMR5e3 6W3A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=AVQKeUqne9pVv8MuMz9gp/QFH6YkWjqIkw1JxtSnlxk=; fh=mbugLhEtiXxQiEu3AOtCDetalIBvFXsMy4a3NIlhUww=; b=xd5c9oKzJkBIy31xAEEE9uWFZN+RAQRg7YB6SfWm4mDQVolpe8mM+J4QYcLhI58QaH A7MwzFYH//SxQVR9EhkR3gEU28CR7Z5S+j9e1KLttC8/x5cHWKdsZBuDtzYhuxkXE/r4 fN97qTZAl5GJqR7fAfnWRi200H80dGox1b1+9foXybKGZhR6RJXPJ11Omn28FggQOQ5D v+KK3YVgW7+PVtB3C66padg9DhIvEVEdSA9vSNlsCqOvJ5FiaUMP+awqaEXM+3RWLdz8 thaGPICHJ8AoDcI2IhT/9gCwBQmTso47Nb1e3cdEO/m1StHBDET9TqIkBv8VG6SZSeKb 6NvQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pMeJkFwC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-211867-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211867-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6f3bd87e4a7si4943909a12.574.2024.06.12.09.32.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 09:32:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211867-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pMeJkFwC; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-211867-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211867-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 17AB1B26744 for ; Wed, 12 Jun 2024 16:07:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 01E47181D14; Wed, 12 Jun 2024 16:05:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pMeJkFwC" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2465B181BAF; Wed, 12 Jun 2024 16:05:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718208315; cv=none; b=LPS9C6HKkCmbwNz+Db6nMjHMGz8u8tvReYUNO79+A6ZLqXmHHI+UutlXAwrAyEZfcz2co64mXcKpdL3WKb45jvJkKPqDxQNHsjMdjh2EscaqiB4nFohznMtn+e1NVdfSRzqJO6RtXxV3Ory497T4oQdx4zlTJrZz435YCz0IWKA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718208315; c=relaxed/simple; bh=Ny4Zo9sSjpAd2us+A20fiV+uPm/Io6ALD4EkL1KRJLk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rU6iGPZb0gLl2KGW7PrAIjYhJYPt7o3rlqmgQz4x5yCPsduQXE6TrDsTmt9ALbcHWZAbY830+VGpzfpsvwv6YLCJtBgJ1FUrX3UsqiUaQLM3jgmVRV1PlCMdQUNqhRZSAcPVzRIdwssYxybaVFAhFqpxucrPxyW+seRPXoDHeA4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pMeJkFwC; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9465AC116B1; Wed, 12 Jun 2024 16:05:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718208314; bh=Ny4Zo9sSjpAd2us+A20fiV+uPm/Io6ALD4EkL1KRJLk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pMeJkFwCZ0WTDF4ljPjlGfDMyqVn+v64jg2pWTV/0ZblFt2n9uKbnTRBP/Yj7P8yw 8b+s8FesDan3H+w6UiNCQknu/4ogxBnU+JGARIQ6JPGzImR5qyingt2CvuB1HlNOWg 1Hip5h7QoNRv4zau38l6ho6RseBnXOrGPnHS/x9IIgx1CN5JoxcuhZi3t6LSDuZ71p JSiyZlVIaCpotS3SV8sYW//MbhDZMbTsSugtkHLgFGSPB8OcLWtxy2+5jEkCsFW1O+ VfuJniHXFgVSh+lEcLmlgbtFvKUpcV9MjU83c74ym5qXQeH+l2/1UbZldnHBO0B7KC 3uSAYR4rnnXGg== Date: Wed, 12 Jun 2024 09:05:14 -0700 From: Kees Cook To: David Gow Cc: Mark Rutland , Vitor Massaru Iha , Ivan Orlov , Brendan Higgins , 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: Re: [PATCH v2 2/2] usercopy: Convert test_user_copy to KUnit test Message-ID: <202406120903.D0EF1C6@keescook> References: <20240610213055.it.075-kees@kernel.org> <20240610213330.1310156-2-kees@kernel.org> 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=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Jun 12, 2024 at 05:13:39PM +0800, David Gow wrote: > On Tue, 11 Jun 2024 at 05:33, Kees Cook wrote: > > > > Convert the runtime tests of hardened usercopy to standard KUnit tests. > > > > Co-developed-by: Vitor Massaru Iha > > Signed-off-by: Vitor Massaru Iha > > Link: https://lore.kernel.org/r/20200721174654.72132-1-vitor@massaru.org > > Tested-by: Ivan Orlov > > Signed-off-by: Kees Cook > > --- > > This looks good, particularly with the x86 fix applied. Thanks! > It's still hanging on m68k -- I think at the 'illegal reversed > copy_to_user passed' test -- but I'll admit to not having tried to > debug it further. For my own future reference, I have reproduced this with: $ sudo apt install gcc-m68k-linux-gnu $ tools/testing/kunit/kunit.py run --arch m68k --make_option CROSS_COMPILE=m68k-linux-gnu- usercopy I'll figure it out... > One other (set of) notes below about using KUNIT_EXPECT_MEMEQ_MSG(), > otherwise (assuming the m68k stuff isn't actually a regression, which > I haven't tested but I imagine is unlikely), I should really read all the API docs every few releases. :) I will switch to KUNIT_EXPECT_MEMEQ_MSG! -- Kees Cook