x86/mm/pkeys: Fix typo in Documentation/x86/protection-keys.txt

Replace PKEY_DENY_WRITE with PKEY_DISABLE_WRITE,
to match the source code.

Signed-off-by: Wang Kai <morgan.wang@huawei.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: corbet@lwn.net
Cc: dave.hansen@intel.com
Cc: dave.hansen@linux.intel.com
Cc: linux-doc@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>

authored by

Wang Kai and committed by
Ingo Molnar
f90e2d9a 04b67022

+3 -3
+3 -3
Documentation/x86/protection-keys.txt
··· 34 34 called pkey_set(). 35 35 36 36 int real_prot = PROT_READ|PROT_WRITE; 37 - pkey = pkey_alloc(0, PKEY_DENY_WRITE); 37 + pkey = pkey_alloc(0, PKEY_DISABLE_WRITE); 38 38 ptr = mmap(NULL, PAGE_SIZE, PROT_NONE, MAP_ANONYMOUS|MAP_PRIVATE, -1, 0); 39 39 ret = pkey_mprotect(ptr, PAGE_SIZE, real_prot, pkey); 40 40 ... application runs here ··· 42 42 Now, if the application needs to update the data at 'ptr', it can 43 43 gain access, do the update, then remove its write access: 44 44 45 - pkey_set(pkey, 0); // clear PKEY_DENY_WRITE 45 + pkey_set(pkey, 0); // clear PKEY_DISABLE_WRITE 46 46 *ptr = foo; // assign something 47 - pkey_set(pkey, PKEY_DENY_WRITE); // set PKEY_DENY_WRITE again 47 + pkey_set(pkey, PKEY_DISABLE_WRITE); // set PKEY_DISABLE_WRITE again 48 48 49 49 Now when it frees the memory, it will also free the pkey since it 50 50 is no longer in use: