Received: by 2002:ab2:715a:0:b0:1fd:c064:50c with SMTP id l26csp65050lqm; Mon, 10 Jun 2024 12:48:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXsVpzE4lQyb4rz6R9baUWjnV/hb/r6yxXKpWALX7H8qrl2p/RkQDUpVp3SXi/VwJkd1ZiR9n2UBu3E+lOo36mOlAsj1ckcIHTjWxMJRw== X-Google-Smtp-Source: AGHT+IHJ1OegpRYDnsJO+oDlnTnOYnD4tmR6NBjBbMjwIbObwwfJiwlu/EfDSP3ptw/BCgJw4NBc X-Received: by 2002:a05:6a20:daa9:b0:1b6:6d41:7bd0 with SMTP id adf61e73a8af0-1b66d4180dcmr5948431637.40.1718048911470; Mon, 10 Jun 2024 12:48:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718048911; cv=pass; d=google.com; s=arc-20160816; b=IvhIkpQKujyq37Wmb1derNe9zxsiGn5hD7qP/tlPqEDGAgzJCamUFTvMbKNFhhs2rV AZuMyAkdFxD6e3AzXNwl+U1B2RXcxgUwH7kFGBBM/jistv0QWUrFsfEwVCu6h3X00bcl xBzJIakQqil5GrImudY1xIfUCzdZSDPfQRPdhh1cbdWppd3J241bHi67gpZ6FhTCI6zd 8RPQdYWGM2soLryoG0++HBSuDYU4Bga3aQC1n0DiZ6c+ajd41mUY0NEtc9RFbwKN2hKA pbVG+rftnG13bZjeUwlYqw30BC1z+cboDHbUT/rz9T6RVwTc0CcjEJbsSvpktRVco52q 1bMw== 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=zFAOWhHlQqgHJFYCU+C89Ga9+4hIRX9dC06RmnLEuwc=; fh=h7/TKfzxe5XXkxql3P0TrUplxXkBsHbfIklvsf412WY=; b=e+O00VuF+aWlST5xbxStmW8scbFQPFnJqUeCjo7Y+y9nZRLswB+6657RLI/zFy2YXl nd0c/9NiJqy5o4mtiOcbzMtL54K32+NhLt9pCAlVzjwp3QLWqyZK6nworTZo/6rtD0DC q6A4MUTX6BvlpmyFGZqMGLqJz6ZMFatlLQyw4xe/0awC67hGfz87Gzetk/jbEz/VEigS EowM7EQCGHjFDorRx/7uxUJz3QITNWsLGq307FXhXssIejhEBzpWqrQ06Np5ycxL0UOr UsZuMvc22xUFZGgZ+gCB47oFwFAJtOMAVGbk5xN5D7aqHeflxl4+Hf6/x3TQNA2zJ91i 0xEA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oFtiEEE1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-208812-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208812-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6e5985cc6d2si5016277a12.446.2024.06.10.12.48.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 12:48:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208812-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oFtiEEE1; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-208812-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208812-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 18DE8285D8E for ; Mon, 10 Jun 2024 19:48:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9B43814E2EC; Mon, 10 Jun 2024 19:48:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oFtiEEE1" 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 BD3DB1BC39; Mon, 10 Jun 2024 19:48:23 +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=1718048903; cv=none; b=g+5dsVNVQ/lviQFuZ5agDpc4ba2OE6eXwpy2XaICtSUHP6UYWVTj64eowUs9XdvJ7hLdYcXUd7VP+XYk5zoSJuWTKGV02DBoIzGm+PP4EbYMLdhQC7Rv9ZIK/R5OeAJUAu3KwlBWiXt+yhmjNYLXbrUBryKRT8B0f4k9INyU2lk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718048903; c=relaxed/simple; bh=y4yr6XQlhvTeATPlaR4oANDTI7XUzBVLj7I//aVWdn4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HeDeK5CDJb+dKzKFtUhR1TvGDnu4eDCttK4oM/PWGyo3ua1oxBbV4b+Wixq92YgCAudU6CM4Ov29I4D9Gtn6THTwja+fDcCfxSGk3MaDtm9S7xi6rA7FQhzOvI9IGbwFDG8wRapWOuP4ldZTkJDj5Yir27qSEwhgYFVbc3r6D1E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oFtiEEE1; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54BF7C32789; Mon, 10 Jun 2024 19:48:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718048903; bh=y4yr6XQlhvTeATPlaR4oANDTI7XUzBVLj7I//aVWdn4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oFtiEEE1zUJXk3fX31cc3rHmSr28aVw4I/cB2DTrltE5wkAUhQecNFnRr60qiJ/6Y SydztAwniQvMUZzK3/rV7bh09ehTEOV+sXA4txhM3EFYvUkTEvZuqM7ecwNR8hHksB 76Es7DjlnYIfxED6BxS1uwg/sQ6JUC9ns6ZPutfZxcRZ1CFKN3RH4sFoU3oeN9LvGV Xt3hJSnF/bLqNJj11S6uJ9nrQpKXRW7zS2eHpqnOS8R5IoV95myRSbStvOvt2Y8vy3 jgSzBjLqj2Or2Hs3l37JJm9H2eSXZNoBS2tdrSOc0cpM+3eiYHbSwsIe1OwOySJ9X0 hk6EkUpxJNqmw== Date: Mon, 10 Jun 2024 12:48:22 -0700 From: Kees Cook To: David Gow Cc: Mark Rutland , Vitor Massaru Iha , 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 2/2] usercopy: Convert test_user_copy to KUnit test Message-ID: <202406101241.C1BE6791@keescook> References: <20240519190422.work.715-kees@kernel.org> <20240519191254.651865-2-keescook@chromium.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 Sat, Jun 08, 2024 at 04:44:10PM +0800, David Gow wrote: > On Mon, 20 May 2024 at 03:12, 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 > > Signed-off-by: Kees Cook > > --- > > This fails here on i386: > > # usercopy_test_invalid: EXPECTATION FAILED at lib/usercopy_kunit.c:278 > > Expected val_u64 == 0, but > > val_u64 == -60129542144 (0xfffffff200000000) Hunh. I can reproduce this with "--arch=i386" but not under UML with SUBARCH=i386. But perhaps it's a difference in the get_user() implementations between the two. And this looks like a bug in the get_user() failure path on i386. I will investigate... > It also seems to be hanging somewhere in usercopy_test_invalid on my > m68k/qemu setup: > ./tools/testing/kunit/kunit.py run --build_dir=.kunit-m68k --arch m68k usercopy Oh, that's weird. I'll need to get an m68k environment set up... > Otherwise, it looks fine. Maybe it'd make sense to split some of the > tests up a bit more, but it's a matter of taste (and only really an > advantage for debugging hangs where more detailed progress is nice). Yeah. I can do this in follow-up patches, perhaps. > With those architecture-specific hangs either fixed, or documented (if > they're actual problems, not issues with the test), this is: > > Reviewed-by: David Gow Thanks! -- Kees Cook