Re: [PATCH v15 08/26] x86/mm: Introduce _PAGE_COW

2020-12-10 Thread Yu, Yu-cheng
On 12/10/2020 9:41 AM, Borislav Petkov wrote: On Tue, Dec 08, 2020 at 11:24:16AM -0800, Yu, Yu-cheng wrote: Case (a) is a normal writable data page that has gone through fork(). So it Writable > has W=0, D=1. But here, the software chooses not to use the D bit, and But it has W=0. So not w

Re: [PATCH v15 08/26] x86/mm: Introduce _PAGE_COW

2020-12-10 Thread Borislav Petkov
On Tue, Dec 08, 2020 at 11:24:16AM -0800, Yu, Yu-cheng wrote: > Case (a) is a normal writable data page that has gone through fork(). So it Writable? > has W=0, D=1. But here, the software chooses not to use the D bit, and But it has W=0. So not writable? > instead, W=0, COW=1. So the "new" w

Re: [PATCH v15 08/26] x86/mm: Introduce _PAGE_COW

2020-12-08 Thread Yu, Yu-cheng
On 12/8/2020 10:47 AM, Borislav Petkov wrote: On Tue, Dec 08, 2020 at 10:25:15AM -0800, Yu, Yu-cheng wrote: Both are "R/O + _PAGE_COW". Where's the difference? The dirty bit? The PTEs are the same for both (a) and (b), but come from different routes. Do not be afraid to go into detail and ex

Re: [PATCH v15 08/26] x86/mm: Introduce _PAGE_COW

2020-12-08 Thread Borislav Petkov
On Tue, Dec 08, 2020 at 10:25:15AM -0800, Yu, Yu-cheng wrote: > > Both are "R/O + _PAGE_COW". Where's the difference? The dirty bit? > > The PTEs are the same for both (a) and (b), but come from different routes. Do not be afraid to go into detail and explain to me what those routes are please.

Re: [PATCH v15 08/26] x86/mm: Introduce _PAGE_COW

2020-12-08 Thread Yu, Yu-cheng
On 12/8/2020 9:50 AM, Borislav Petkov wrote: On Tue, Nov 10, 2020 at 08:21:53AM -0800, Yu-cheng Yu wrote: There is essentially no room left in the x86 hardware PTEs on some OSes (not Linux). That left the hardware architects looking for a way to represent a new memory type (shadow stack) within

Re: [PATCH v15 08/26] x86/mm: Introduce _PAGE_COW

2020-12-08 Thread Borislav Petkov
On Tue, Nov 10, 2020 at 08:21:53AM -0800, Yu-cheng Yu wrote: > There is essentially no room left in the x86 hardware PTEs on some OSes > (not Linux). That left the hardware architects looking for a way to > represent a new memory type (shadow stack) within the existing bits. > They chose to repurp

[PATCH v15 08/26] x86/mm: Introduce _PAGE_COW

2020-11-10 Thread Yu-cheng Yu
There is essentially no room left in the x86 hardware PTEs on some OSes (not Linux). That left the hardware architects looking for a way to represent a new memory type (shadow stack) within the existing bits. They chose to repurpose a lightly-used state: Write=0,Dirty=1. The reason it's lightly u