lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2a919d9ed8ed874f8b89014c0b42cbadb44d837b.camel@intel.com>
Date:   Tue, 1 Feb 2022 18:13:40 +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 26/44] x86/fault: Print PKS MSR on fault

On Thu, 2022-01-27 at 09:54 -0800, ira.weiny@...el.com wrote:
> +       if (error_code & X86_PF_PK)
> +               pks_dump_fault_info(regs);
> +

If the kernel makes an errant accesses to a userspace address with PKU
enabled and the usersapce page marked AD, it should oops and get here,
but will the X86_PF_PK bit be set even if smap is the real cause? Per
the SDM, it sounds like it would:
"
For accesses to user-mode addresses, the flag is set if
(1) CR4.PKE = 1;
(2) the linear address has protection key i; and
(3) the PKRU register (see Section 4.6.2) is such that either
	(a) ADi = 1; or
	(b) the following all hold: 
		(i) WDi = 1;
		(ii) the access is a write access; and 
		(iii) either CR0.WP = 1 or the access causing the
                      page-fault exception was a user-mode access.
"

...and then this somewhat confusingly dumps the pks register. Is that
the real behavior?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ