Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp168283lqq; Wed, 12 Jun 2024 22:04:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVMRoNxdIJcaJEHZsCJ+EgO3FYlUTURPTX9gMBA1Z7nPzAmRU+uqaLVJ2uHokY8ioIXpv94eAmFu63dd72LjK4A2fJ5ve5REirw/MmL1A== X-Google-Smtp-Source: AGHT+IGMpx8SDe4cXYrTv1xixlaQA+ldEJuZ5jeyDJv5di0eitUzuBC0pvGh7yjDoXh5m16Sbnse X-Received: by 2002:a05:6102:363:b0:48c:3801:1382 with SMTP id ada2fe7eead31-48d91e25e3emr3872562137.21.1718255043526; Wed, 12 Jun 2024 22:04:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718255043; cv=pass; d=google.com; s=arc-20160816; b=UmzlEMZprLThC6qyIvtuEqimobFB3FwnVNpUVgwcge3lDcQkxQrsJ+AMunhVOmkxsU mH6ZES7nxDWy3tLB40NFwLtnjvZpZCv+37C+wxHmiOTSOagr0Ed/R4XS7OfpcKYWhFI4 mAVKa1G5f5GyQU2FkV4/umMetPsrkUGwiHY1AXWbgWv9J7otVfpC9s7UxJ3Nnh6Fw2+K 9gKiLtWC6KhWz0kPK23iNjrzeSq+AEjqm1qekuZHegnAiycyYeqBldcwLvBFXFeqQsOL XRqrXzfOeL8UzJ1YdOpun/Ds1x2XDcVt57Eaom1YwqIgqOhChVrPC7nZtMaXiPpnH3Si dV4w== 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=xTeUbRunuf2uWIPjfwPlhKK0DJKhQ0Lqy+g4mvgVesg=; fh=mbugLhEtiXxQiEu3AOtCDetalIBvFXsMy4a3NIlhUww=; b=aJ2YiGFgJoDeEOCOYRjIA9gUePHJyy1g5vbT8SiI2b2FHAz0BgRo5dkmqEiBWwxkFR CkAws8YFGoVGQzsCbJDCDsmUISo1ArI/fgmV8d1VWXM2Qt6n79BpPy5tNiDtJ+W7DhQS uyXzVAmPokePad7rUuM0HDqFhReonpjLwrDHND8Iq+fWg3pufRStagaanKM6xuXylj3O gN1VDQ2T04xsjWuxpH3dwMJAIGvHm0qsmmnTlli0xWaU2QNxIn76mO12smBC+HcVmVXn wN+A2Sxr6T+0iWJtd/yExfJjNw58jFoWWs/swWxWBOI+36wosGCFi8z6Zc724yxkvXV8 dhxg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=helzs7hf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-212565-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212565-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-798b9f084c8si41041485a.116.2024.06.12.22.04.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 22:04:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212565-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=helzs7hf; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-212565-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212565-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 3B34A1C227D8 for ; Thu, 13 Jun 2024 05:04:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A613134410; Thu, 13 Jun 2024 05:03:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="helzs7hf" 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 3B0737E1; Thu, 13 Jun 2024 05:03:56 +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=1718255037; cv=none; b=EwmutxDLrv7Zvltst4wZD6OXSzuNljR1hl6pz9Rukvf8Jdw0t8Q8b3B6ADdQ60EIeo/rHc5N47mEKlsY4OSQPb+aqiqxKEeW/2fR1yLk8kYQ0C6kbzjuzsTW6/KQL98LzM1anoyHVPPmkIL4WTEwYDfCK7oxDsaf7Kgou+pmGQY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718255037; c=relaxed/simple; bh=GX2a40HEDEHHW6TPclVUxneUVRJo7Bvo8UyHXhijbxY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CKXsakBN6+JQXmwOOmNJHl9g/I2z2O6LvvdYl/iHuzAXLw5vjN0uJKhpi5jaebtSt1ByP+wwa9HvC/NeSrfY69+QlBWboZ1m0U0/ACzQlfuj84L7xggoEqh1iBFNSpEbO5VJqu2fzrRaQLMawoObDfiKb5cw6MLC7RClWnoQkVo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=helzs7hf; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B02C4C32789; Thu, 13 Jun 2024 05:03:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718255036; bh=GX2a40HEDEHHW6TPclVUxneUVRJo7Bvo8UyHXhijbxY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=helzs7hfLHd4OevazVNmYpfJPJThbMPx8BLH1rhyA9ViX4aNR29vadgRYLbZtYBeJ RMJtKIh2uzunFghOQDVsIABXKt3bYhowTCqrdgVpTdELu+OBQqgag+lozCVZ03S3Vj vl5wa8q6I8Sjld4BDHKmEu/Tk0O9gyM1YbRl7/3NfE8kiPSyW0Lh4PnGv1uaGNyiOI 84FfetFBMZ5J8yweot2iO09SYWY+MiZTE5l5VR65FPyn+pxcYZjXoJLckQeZXiqSjV JmduIKQ71X1VkZrIZM26UsYA87cxDRdJolGA29jEnSSY2c2Tw6NTRC6/mWqkeQhGVd yiHXVr88ClGoA== Date: Wed, 12 Jun 2024 22:03:56 -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 v3 0/2] usercopy: Convert test_user_copy to KUnit test Message-ID: <202406122203.475178DE@keescook> References: <20240612195412.make.760-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 Thu, Jun 13, 2024 at 12:41:43PM +0800, David Gow wrote: > On Thu, 13 Jun 2024 at 03:59, Kees Cook wrote: > > > > 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. > > > > v3: > > - use MEMEQ KUnit helper (David) > > - exclude pathological address confusion test for systems with separate > > address spaces, noticed by David > > - add KUnit-conditional exports for alloc_mm() and arch_pick_mmap_layout() > > noticed by 0day > > v2: https://lore.kernel.org/lkml/20240610213055.it.075-kees@kernel.org/ > > v1: https://lore.kernel.org/lkml/20240519190422.work.715-kees@kernel.org/ > > > > -Kees > > > > [1] https://lore.kernel.org/lkml/20230321122514.1743889-2-mark.rutland@arm.com/ > > Thanks! This looks good to me (and passes everything here). Unless > there's a compelling reason not to, I think we can take this via the > KUnit tree. That would be lovely, thank you! :) -- Kees Cook