[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1ac1daf90285869ddfdf52daa8d39bc462253883.camel@intel.com>
Date: Mon, 31 Jan 2022 19:30:14 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "hpa@...or.com" <hpa@...or.com>,
"Williams, Dan J" <dan.j.williams@...el.com>,
"Weiny, Ira" <ira.weiny@...el.com>,
"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>
CC: "Yu, Fenghua" <fenghua.yu@...el.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH V8 13/44] mm/pkeys: Add initial PKS Test code
On Thu, 2022-01-27 at 09:54 -0800, ira.weiny@...el.com wrote:
> +static void crash_it(void)
> +{
> + struct pks_test_ctx *ctx;
> + void *ptr;
> +
> + pr_warn(" ***** BEGIN: Unhandled fault test *****\n");
> +
> + ctx = alloc_ctx(PKS_KEY_TEST);
> + if (IS_ERR(ctx)) {
> + pr_err("Failed to allocate context???\n");
> + return;
> + }
> +
> + ptr = alloc_test_page(ctx->pkey);
> + if (!ptr) {
> + pr_err("Failed to vmalloc page???\n");
> + return;
> + }
> +
> + /* This purposely faults */
> + memcpy(ptr, ctx->data, 8);
> +
> + /* Should never get here if so the test failed */
> + last_test_pass = false;
> +
> + vfree(ptr);
> + free_ctx(ctx);
So these only gets cleaned up if the test fails? Could you clean them
up in pks_release_file() like the later test patch?
> +}
snip
> +
> +static void __exit pks_test_exit(void)
> +{
> + debugfs_remove(pks_test_dentry);
> + pr_info("test exit\n");
> +}
How does this get called?
Powered by blists - more mailing lists