Message ID | 75eba82a2666b0caa96ed0484a713037045ed114.1678926164.git.ackerleytng@google.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78B29C7618B for <linux-mm@archiver.kernel.org>; Thu, 16 Mar 2023 00:31:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1C8736B007E; Wed, 15 Mar 2023 20:31:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 17A776B0080; Wed, 15 Mar 2023 20:31:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0401F6B0081; Wed, 15 Mar 2023 20:31:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id E7CA46B007E for <linux-mm@kvack.org>; Wed, 15 Mar 2023 20:31:21 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id A2DB312110E for <linux-mm@kvack.org>; Thu, 16 Mar 2023 00:31:21 +0000 (UTC) X-FDA: 80572882362.06.1E789CE Received: from mail-pj1-f73.google.com (mail-pj1-f73.google.com [209.85.216.73]) by imf16.hostedemail.com (Postfix) with ESMTP id C2ECA18000E for <linux-mm@kvack.org>; Thu, 16 Mar 2023 00:31:19 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=PAaXwSJq; spf=pass (imf16.hostedemail.com: domain of 3VmMSZAsKCI0rt1v82vFA4xx55x2v.t532z4BE-331Crt1.58x@flex--ackerleytng.bounces.google.com designates 209.85.216.73 as permitted sender) smtp.mailfrom=3VmMSZAsKCI0rt1v82vFA4xx55x2v.t532z4BE-331Crt1.58x@flex--ackerleytng.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678926679; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=vx2+K6b7VucsfYU5uvwShdem3MP0VCFQdKNh537WPsg=; b=hg1N9yO5lhDQDJVu4EHjp1dR3XnIZbMNJqFqO1XYN8WUVeJ/DXpepfbM4/BhOPoj6igiVu tm+9JLbZRxdWUJUKPujxxqpZNHOQWgn+92eGvnVPgwPEQmjIZzRBwuWl2ne84SZVp8zL7d h1FRQQgqr6oBu7Mmvj/1QeBUfG3AwSo= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=PAaXwSJq; spf=pass (imf16.hostedemail.com: domain of 3VmMSZAsKCI0rt1v82vFA4xx55x2v.t532z4BE-331Crt1.58x@flex--ackerleytng.bounces.google.com designates 209.85.216.73 as permitted sender) smtp.mailfrom=3VmMSZAsKCI0rt1v82vFA4xx55x2v.t532z4BE-331Crt1.58x@flex--ackerleytng.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678926679; a=rsa-sha256; cv=none; b=sl9jE++hpA7u9gRm2LS6aoDcApzUvlo+MZdYJ+7X8iV5/Gfy0DlGKM0i3u5zhZvuHpv0WQ 2NatSqr9pwJ707VXNn/RAe/mcK6BCkOav9VU3T3Xyl/+5k4QfwhyOYfH9n5vGdgQ4jKcWV Dqd93p3jvts80bM97ytf3QXeYyiBgf4= Received: by mail-pj1-f73.google.com with SMTP id q24-20020a17090a2e1800b00237c37964d4so1704963pjd.8 for <linux-mm@kvack.org>; Wed, 15 Mar 2023 17:31:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1678926678; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=vx2+K6b7VucsfYU5uvwShdem3MP0VCFQdKNh537WPsg=; b=PAaXwSJqPjUc6R/biIaCW2VNIfg9P921yoYdsBglXW7n/3lysnZkeEeswRZxCHBdd2 vae46IBUMuPrhA/m6sIKIzqdGOnQo5Ax7q3XOoZhIMO7H4xC0VbFQ0N3vE+qhGQUMHzu kPA+f6sp7rqp+TQqvoN2RVgjN8fnA/s8vq6Qc0ND26uA1J32QTIzKCh5QE6EZ2HKVyvQ j5NA1EYtTCtaS4iuVqchmK8CE1Gi+C6RcXJmBHwvadsPdAFJPwZbs86of6yw4m2yRstH qut3sHXQ3PqToSUKXfBRc1s9T+WqYiB5itYUbgh+khi4BVYb6F2EdusOJNoVl2aI0MUq SNww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678926678; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vx2+K6b7VucsfYU5uvwShdem3MP0VCFQdKNh537WPsg=; b=i7eCQVM2gxVrTlHCyk6a8sLDa/r7tG/IhvmCOBhmwiJDszf/+uTZR/RRV5Du2Xr2Gu wCSUlIX/slEoZ92Yx1Fpq94ae0kH5BZLnKuaQaRcN67xyevoFtD9NqUQ5l25bFgQUO8A T4WGm0TdPLy7EIuqoePG1xZQzeoj/iAXRXGUa1RIa1NNMhGFC9sRReM2hwjQjjiVCeRm zxWPm6IPgDKDX6PcbOCTnoYJd7xxuHTgc/mIXexo/mc2JGY8tD8fnAORWMhFjSCZ/lff iBKwG8rcD8hXhmUEEIpaw9tF/09CNE0tISODDeQAQ2c1AWkRPUG3a6G1Cj17/JSghxmp QY0Q== X-Gm-Message-State: AO0yUKU+liaXvQLs4jRgicnP/oY3/u+703HT5/AjfJqOg+4yRaTLbHqF QuGfEhOJY2+KLb32WdwrGog0xCo8zr2Qg6t14A== X-Google-Smtp-Source: AK7set8pxVyKhYzeYJbLh/hwRd4Uu3vEs7a87hlm2FvbWgBf9tOHOVoa9Y6GzuIXe4LVFtgGHHuaVLgOE52DzxfEww== X-Received: from ackerleytng-cloudtop.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:1f5f]) (user=ackerleytng job=sendgmr) by 2002:a05:6a00:23d6:b0:625:cf6d:b272 with SMTP id g22-20020a056a0023d600b00625cf6db272mr580538pfc.6.1678926678685; Wed, 15 Mar 2023 17:31:18 -0700 (PDT) Date: Thu, 16 Mar 2023 00:30:55 +0000 In-Reply-To: <cover.1678926164.git.ackerleytng@google.com> Mime-Version: 1.0 References: <cover.1678926164.git.ackerleytng@google.com> X-Mailer: git-send-email 2.40.0.rc2.332.ga46443480c-goog Message-ID: <75eba82a2666b0caa96ed0484a713037045ed114.1678926164.git.ackerleytng@google.com> Subject: [RFC PATCH 02/10] KVM: selftests: Test that ftruncate to non-page-aligned size on a restrictedmem fd should fail From: Ackerley Tng <ackerleytng@google.com> To: kvm@vger.kernel.org, linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, qemu-devel@nongnu.org Cc: aarcange@redhat.com, ak@linux.intel.com, akpm@linux-foundation.org, arnd@arndb.de, bfields@fieldses.org, bp@alien8.de, chao.p.peng@linux.intel.com, corbet@lwn.net, dave.hansen@intel.com, david@redhat.com, ddutile@redhat.com, dhildenb@redhat.com, hpa@zytor.com, hughd@google.com, jlayton@kernel.org, jmattson@google.com, joro@8bytes.org, jun.nakajima@intel.com, kirill.shutemov@linux.intel.com, linmiaohe@huawei.com, luto@kernel.org, mail@maciej.szmigiero.name, mhocko@suse.com, michael.roth@amd.com, mingo@redhat.com, naoya.horiguchi@nec.com, pbonzini@redhat.com, qperret@google.com, rppt@kernel.org, seanjc@google.com, shuah@kernel.org, steven.price@arm.com, tabba@google.com, tglx@linutronix.de, vannapurve@google.com, vbabka@suse.cz, vkuznets@redhat.com, wanpengli@tencent.com, wei.w.wang@intel.com, x86@kernel.org, yu.c.zhang@linux.intel.com, Ackerley Tng <ackerleytng@google.com> Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: C2ECA18000E X-Rspam-User: X-Stat-Signature: 9bmjwdtg16cri1jzbgbgn84xd8x51u1k X-HE-Tag: 1678926679-898716 X-HE-Meta: U2FsdGVkX1+MDwVW5BKEuZRWbyR6CA1OXe4qackxlknvZigDpSltq/h4EeI8KIy04m97UIPZTVJrNYRv2pVz0MAXH/Du2MZXgUwJTfvvHBMc5QIRuduh6Djb4Q0wX4PZprmjceTYIqQbxkRsuFgKHypqKyLTEKW+M3bbiiDuNQuV9wXwjRFsC7blNT97s6zghchBsFAJAqagb/lXu3TXhSGA4V/9PVHgSDi9YAHYf6dEgLrQyqa8oMb5LSppMoD2eOSvogC4Y6Qj3eNOaurPL12asjEON6AkyJIyR+4HHYY6Pd7gJ6VVGGBfBahxQiz37wEypl7vUqfnOoiaCjHE/XZUS+9/CUKHovFzqLRlXWnHVO3RpxfNKQPFPvrGGnqhbkj5yrHAZjuT79ppmpCFJ9OsAP9F2yie6CheOCgUP3UrU/9qVSrll8tX5sVarqvtYAvfrhssqA4wAgb0ijGJJyLmr9MlGWaPt07HzxbwxeYfq85BsS10FQFf1TFi/4XD5ne8ggLL5cLkhS9XK8ifcg4Dkh0/ZWICedD5QSPBV1gbpnpvRc9wJu0oOk1sSeuI2hBAqVmEjDlqe/F1FmluXK1Mc8HY38kw42+TjuDlPXNuZGmw+GuqG9GDei+xvPRm8EaCo1mvkun/Tj5re1RojYIyW4nYb3GP8g/JOfOfN9cRC1GXy3pT8wU6nK/gYjKQhhRaj0M1oBrAB4KZYVJlaIqz3C4DZ7jkrOH8wp3q61HIAYEcRF178pqjv2uYgwkRCNYnDNlaupftql9HWB7MA/kLPaCaE93nmPpJdApQSveUjwhpRlnIa+9Wd6oTgY7Zo76odklkDPzwjJVmTw8S0thu44MLw3iDXgVNre0SWNtrBCUqBwbPkGq1kBgW4oqdZ87CUiMv6lYSUBR2w/H1/dU5kI8MoPLTkRAjKXFXqwrJNJ/OhzWDcNzgHNS27PR8TC8QX9xZCfhW7YrrgTZ UVJS1aeL M/1hmF7giC1JVnYOBL4GorTy7pMH/9Pk0ajqzJlNfc0ol+Esnp8vosZlRIw3RoG6ykiYHsIZzpC2fGpxeyt9bKiLvIeWETJObS27F9qTfgFcYKAFIsuA/efTDxQzhg4rsaHNiiWwQJIcXM1H5usj06mwMovTCJUu4Ma4xCTwIoulm86JriTVVPJgRKEQnwqu/iWYuJky5lNe+wiamojdDLuljZ6YBsE6P5n0+2JHZxjwyqbOVpqETsJOoFiPKX9AJvyUGgVPUFxOb3mC4YjKQqmsrvV2bJOtrOYOX3dE9w8MzyIdJ+FHxCK5els+GFYbP7iBbxT0/mPEcyaczleUn2dOscOdx4kCvoWP1Oprm8aWOZQFkZ1o5aULd+PiVHB+ZThP0t4SV4dIrBTdTUbyVMIydSfMBQd6q1jxczqjgw1XYSjOz/k/EMGs7fNAzsxycJ3Z2L/L1Ct6jvcvFAKj9u+A7EvcHYn6OEIt0LOyg5f2hfKw449N1b9zgGjqaYUjsr2bJkdPPRPQAg5fP+DPqOadXoNU4hqpAfTBTpEEWgIp3ywMLdnH35Vnjr7bAupMF01ES9G4+f3RQ0LgzCT0iD1of2rK+AcsLhodQWusxErE82bRUM/aQqSUh0UKjVA7RuFbunxjxus6a4VWWKQXmW1XU/9SFf/OY3tX1SHNuG9z+/1a01d5KeIhcoQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
Additional selftests for restrictedmem
|
expand
|
diff --git a/tools/testing/selftests/vm/memfd_restricted.c b/tools/testing/selftests/vm/memfd_restricted.c index 43a512f273f7..9c4e6a0becbc 100644 --- a/tools/testing/selftests/vm/memfd_restricted.c +++ b/tools/testing/selftests/vm/memfd_restricted.c @@ -38,6 +38,11 @@ static void test_file_size(int fd) { struct stat sb; + if (!ftruncate(fd, page_size + 1)) { + fail("ftruncate to non page-aligned sizes should fail\n"); + return; + } + if (ftruncate(fd, page_size)) { fail("ftruncate failed\n"); return;
Signed-off-by: Ackerley Tng <ackerleytng@google.com> --- tools/testing/selftests/vm/memfd_restricted.c | 5 +++++ 1 file changed, 5 insertions(+)