From patchwork Mon Apr 13 15:32:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lev R. Oshvang ." X-Patchwork-Id: 11485777 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 04C7913B2 for ; Mon, 13 Apr 2020 15:32:51 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id 604A120735 for ; Mon, 13 Apr 2020 15:32:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kA4ad8Nm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 604A120735 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-18496-patchwork-kernel-hardening=patchwork.kernel.org@lists.openwall.com Received: (qmail 18036 invoked by uid 550); 13 Apr 2020 15:32:42 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 17863 invoked from network); 13 Apr 2020 15:32:41 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oEzcpg+wFM4Rb49aIBDj7gJZwlrOkRESDp319LMJSJA=; b=kA4ad8NmHrZL3DfrE8aXACAYgUSOraXDJIi6eSAo/UKYkZvU20oz+mNzVBat2FeUHI +c5OQGMcIjWC3wZH0IXnoVStgOm1N3iBkdiaek6e5tfRwQQlKoQKsJQm4Xa7SR2A1cZe 65xE6TJLTv43NQwa3KczO0Nh0wPyVHu1BizPdNKWtPtDXc3Hg9PGFEAUYC8aISBkP0kX XSgb1lnhx37Jdmc37tzotVTmAr/fGZy/eMPf8rb72c9jFbR67ns1CBd8yxgu4IrWptpM rlhO2sZAuNn2aTtUyA7RfD7KTcXm7lJOL/1tgLSAjHDai65sNGdarcnqtkuPHj7PPZih klWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=oEzcpg+wFM4Rb49aIBDj7gJZwlrOkRESDp319LMJSJA=; b=dXEAV4vgmg4M2vIqs27D/0TYbPT14ALehddF6cyTZM9+MGCf21bVGdsF/Fl+Y+kHFe NftzYs5l34Ot0LApMorwW7k/c7atQCC4fvC0NJbpvRuxmwcMVCR3A+gJTPWbCzl5dGqf ITzLgSOb+QD4G3i37MqDdgj6APwqt1c0D7subVHtp9delPocSI8Khv8qICfCTdE9iurN JOTuwDE3MxbNCP+5zJfBHvPqRKpBAy4hdatiObHnn56QvXpRIBShuUybYOPeww5fY5p5 rwtmSDfldd+E19Yj2A7UoUGIy41QPVvp9tAgKN82HaO2KWoi6hQ8gz/nhxuViaAx2X0X 7LvQ== X-Gm-Message-State: AGi0Pub8WvTmsXB/0OVI8oPRDJ7zB6f1Ys7BvbBTRkTF/lTk1V4Do7jn +MZCjqR80egYBBDpyBIZi7U= X-Google-Smtp-Source: APiQypJ2YnvfFLKOIszSumLAvH3yYJDma329Ax1Gm+zC29OxQIZEsFPflF+pdXyYO/0JVLlvEYyThw== X-Received: by 2002:a5d:4042:: with SMTP id w2mr11142896wrp.195.1586791949874; Mon, 13 Apr 2020 08:32:29 -0700 (PDT) From: Lev Olshvang To: keescook@chromium.orh Cc: kernel-hardening@lists.openwall.com, Lev Olshvang Subject: [PATCH v3 1/5] Hardening x86: Forbid writes to read-only memory pages of a process Date: Mon, 13 Apr 2020 18:32:07 +0300 Message-Id: <20200413153211.29876-2-levonshe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200413153211.29876-1-levonshe@gmail.com> References: <20200413153211.29876-1-levonshe@gmail.com> Signed-off-by: Lev Olshvang --- arch/x86/include/asm/mmu_context.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/x86/include/asm/mmu_context.h b/arch/x86/include/asm/mmu_context.h index 701a7367babf..4e55370e48e8 100644 --- a/arch/x86/include/asm/mmu_context.h +++ b/arch/x86/include/asm/mmu_context.h @@ -5,7 +5,6 @@ #include #include #include -#include #include #include @@ -217,12 +216,7 @@ static inline void arch_unmap(struct mm_struct *mm, unsigned long start, static inline bool arch_vma_access_permitted(struct vm_area_struct *vma, bool write, bool execute, bool foreign) { - if (unlikely(!vma_write_allowed(vma, write, execute, foreign))) { - pr_err_once("Error : PID[%d] %s writes to read only memory\n", - current->tgid, current->comm); - return false; - } - /* Don't check PKRU since pkeys never affect instruction fetches */ + /* pkeys never affect instruction fetches */ if (execute) return true; /* allow access if the VMA is not one from this process */ From patchwork Mon Apr 13 15:32:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lev R. Oshvang ." X-Patchwork-Id: 11485779 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D894C1392 for ; Mon, 13 Apr 2020 15:32:58 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id 40F7B2072C for ; Mon, 13 Apr 2020 15:32:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="B0tF3oLq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 40F7B2072C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-18497-patchwork-kernel-hardening=patchwork.kernel.org@lists.openwall.com Received: (qmail 18265 invoked by uid 550); 13 Apr 2020 15:32:43 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 18119 invoked from network); 13 Apr 2020 15:32:42 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=pHg9EWKPbNBBMGp5VoNYjztBo4ZfL98OtrCqd91ILkc=; b=B0tF3oLqeQJe0iTqpkMyKEG9OEibAekbRFkwrxU2ha+JuyB5jTe6Ekt/phJe45wjjO z+PxYXqzBqIaWxb9m/9q9/PCNZwsdDFgXCnXnxwcEjd/WSb+9vXabd/NcMQJUT/i4x9/ KWfuxAFO3IYOMwLK3RjVaY2/DluJlwxwrkJbc2DHdbgP3PT5geVLeq7xJbzuEnjh1mK5 KVrnFMW4oeiyaRhwz+3/EH0JwfyztGIYiMcpReaMDrGqc85yW5ooFrfWeU8V99j5C4zd gBT9hyykTrahrmr+NUZWorbG1eDm9owD4Sh5P3eaUb+Xs9wV1da00J70gubkVPjpCIzi /WcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pHg9EWKPbNBBMGp5VoNYjztBo4ZfL98OtrCqd91ILkc=; b=MXzsMVceUkwl4lxO8mVWQ+G+UObaozU0XofMwTmiEfUFkje+BSXRM2sDOi0940SWN3 lq/dZAvQezPLkhb0APoVkGEwVxndpedxm4jERwqI9yDd2x5xfCJymlMdwxjtL+tmieKy 8Soa0cfBCyoNHJrLPgAfZKBfTThe39jPeMIxeeG7oW8fIfaC3aCHrARInWbH2UvQYyGl Vmt1e6szrqB9NO9tn29EEAYQIrZg5/2yn6elSNCzJrkxaXFYF9Smp07MNSB9lPMa8Lgb tsB1lGLTmu2Qh6bsfVS2Bu8P69jpjFJ3zJpchoN7U+3doclCkxkkwpiqkb9ZIgzttt3e Sb4Q== X-Gm-Message-State: AGi0PubQY2v5DIdfaeuSLD6XGu6WWU1hCRGxump+kdwU0aqlvdE4xEfR 5HgZ+Ghhplm0hVYPx5iKTJw= X-Google-Smtp-Source: APiQypK/cPyKTuOfa19vvosuEr9CSi7r+YSoN2CjlOdfqqnePkf6NJquq0r6LEkC9T04jFpAxfPM4Q== X-Received: by 2002:adf:edd0:: with SMTP id v16mr18806087wro.113.1586791951108; Mon, 13 Apr 2020 08:32:31 -0700 (PDT) From: Lev Olshvang To: keescook@chromium.orh Cc: kernel-hardening@lists.openwall.com, Lev Olshvang Subject: [PATCH v3 2/5] Hardening PowerPC: Forbid writes to read-only memory pages of a process Date: Mon, 13 Apr 2020 18:32:08 +0300 Message-Id: <20200413153211.29876-3-levonshe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200413153211.29876-1-levonshe@gmail.com> References: <20200413153211.29876-1-levonshe@gmail.com> Signed-off-by: Lev Olshvang --- arch/powerpc/include/asm/mmu_context.h | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/arch/powerpc/include/asm/mmu_context.h b/arch/powerpc/include/asm/mmu_context.h index ddd6d01dd2a1..f4b6b44e304c 100644 --- a/arch/powerpc/include/asm/mmu_context.h +++ b/arch/powerpc/include/asm/mmu_context.h @@ -10,7 +10,6 @@ #include #include #include -#include /* * Most if the context management is out of line @@ -248,15 +247,9 @@ static inline bool arch_vma_access_permitted(struct vm_area_struct *vma, bool write, bool execute, bool foreign) { /* by default, allow everything */ - if (likely(vma_write_allowed(vma, write, execute, foreign))) - return true; - - pr_err_once("Error : PID[%d] %s writes to read only memory\n", - current->tgid, current->comm); - return false; + return true; } -#endif #define pkey_mm_init(mm) #define thread_pkey_regs_save(thread) #define thread_pkey_regs_restore(new_thread, old_thread) From patchwork Mon Apr 13 15:32:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lev R. Oshvang ." X-Patchwork-Id: 11485781 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F08F51392 for ; Mon, 13 Apr 2020 15:33:07 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id 59BC52072C for ; Mon, 13 Apr 2020 15:33:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dGZiP7ff" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 59BC52072C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-18498-patchwork-kernel-hardening=patchwork.kernel.org@lists.openwall.com Received: (qmail 18371 invoked by uid 550); 13 Apr 2020 15:32:44 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 18266 invoked from network); 13 Apr 2020 15:32:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Gf5VcvYy1cAH0Ap0D/jUeM82cMgA0P1gzgm89jB85q8=; b=dGZiP7ff6CjhSOUNmubSekzlbirdtPmp6jfkcy4nrV72SAa9ILWpPwLMLtFGd83ODp v4WQcZVDpZ8kyw2p251cOlfYRHQZFxWuYt5ZcrTTMmJJEl5igPM/sb5ztvHuK+6SHwMs lFYQrMZNvqTS4vAF4mbk3Di9fK2NlSydEm4zWcJIotr1GEA9IYYoyN7g3mUjXl+PJknb L201fdhpz8gutXwxBP6Ax+GgAuK4HD4YiAQgvqZ/i/8C5CvR/IdDp6TXn3kLQtPj3qLN GDSYjFP0TkQ8eE9r9hlcQc0e3m/7fXDyT0/Mj+lO7NX0RLz8NGUr8w8Wh14lTzUK4wyv I+5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Gf5VcvYy1cAH0Ap0D/jUeM82cMgA0P1gzgm89jB85q8=; b=FVdqDoc223PqD4Xfi7okFEHzhfpo/J3PHhs1O1Mv6yWVeQkMSCfO9bXaY48ElohYT+ F3jCh7J2XA8fpst3SXOBbrv57EDR3U74ajm7IZh6zLRb8PYI6QPhV3vTw9PSKGcefWDC mf00ZmXktVomVbY/zOUi1pKYRIXFQ4s+q2UkChLrKYdGaWu9uyFlvZFZvsxbb8K1FQrb Q6yB6UAXiGlcERt4tq4C9Vv/g6ES9x5/T64EiiypuTgICqig7Rme1Py6h+NN2NfZLyw+ 42Me2jaBcEnk34BNNefO13hb09KXn7f2F3NehjhdUk87Q0UehV9I77Qkub8rFDPWzx+J n0Jw== X-Gm-Message-State: AGi0PuaWjsiep47GJDgVmG5OyO84Wu8mk2et+alftgAW86caSEEliLUr GA9f5tBZQnnjqSgWPZHlWBs= X-Google-Smtp-Source: APiQypLspRYJ334Zp+TMObREH5yu2fgWHgS+Q4xdiPFeqFAJyg8Y1soASPosBZnYff60EXOG2LWuBQ== X-Received: by 2002:a7b:cf25:: with SMTP id m5mr20355266wmg.65.1586791952157; Mon, 13 Apr 2020 08:32:32 -0700 (PDT) From: Lev Olshvang To: keescook@chromium.orh Cc: kernel-hardening@lists.openwall.com, Lev Olshvang Subject: [PATCH v3 3/5] Hardening um: Forbid writes to read-only memory pages of a process Date: Mon, 13 Apr 2020 18:32:09 +0300 Message-Id: <20200413153211.29876-4-levonshe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200413153211.29876-1-levonshe@gmail.com> References: <20200413153211.29876-1-levonshe@gmail.com> Signed-off-by: Lev Olshvang --- arch/um/include/asm/mmu_context.h | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/um/include/asm/mmu_context.h b/arch/um/include/asm/mmu_context.h index 3dcee05f950f..b4deb1bfbb68 100644 --- a/arch/um/include/asm/mmu_context.h +++ b/arch/um/include/asm/mmu_context.h @@ -8,7 +8,6 @@ #include #include -#include #include @@ -30,12 +29,7 @@ static inline bool arch_vma_access_permitted(struct vm_area_struct *vma, bool write, bool execute, bool foreign) { /* by default, allow everything */ - if (likely(vma_write_allowed(vma, write, execute, foreign))) - return true; - - pr_err_once("Error : PID[%d] %s writes to read only memory\n", - current->tgid, current->comm); - return false; + return true; } /* From patchwork Mon Apr 13 15:32:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lev R. Oshvang ." X-Patchwork-Id: 11485783 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 159FB13B2 for ; Mon, 13 Apr 2020 15:33:18 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id 719A32072C for ; Mon, 13 Apr 2020 15:33:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UOoBsfxh" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 719A32072C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-18499-patchwork-kernel-hardening=patchwork.kernel.org@lists.openwall.com Received: (qmail 19499 invoked by uid 550); 13 Apr 2020 15:32:45 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 18374 invoked from network); 13 Apr 2020 15:32:44 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jlI6RZwAeSB0wbNAx6U5Hs1HxRUTSCnbRiRykcZqGNQ=; b=UOoBsfxh54Ek4c+Z2qosmk5m+xl6VlhPSBJtKjPu+D0KUVsoytgyNXI+MMzF45JT8h RzihwkRKXxWtcCmBdLoQEbAXW1k8zjA+2bYab0HjlQX8oFTBBuw6G33y/Y2lyFkMWYf0 7QUSNM/IyU0T1HLiUrqkSXlB1XbLoZd3EOA5lFCY5A5JBfIIU7NuhJAcu6HKQSvkSxa0 9GDMCmpoE4PeMmG93JqWANW3N5whYBpAsSloFq2apcBgwlhClbTAmHSwSijj7cPKxH8w 2ZdMrjLhgRzqqHiodwwSQsgwefvBGVdhSCQdmcMpBx5sBwSjxvu5dNoeLTlzWZHMamc8 Cuxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jlI6RZwAeSB0wbNAx6U5Hs1HxRUTSCnbRiRykcZqGNQ=; b=gCBR8MV7tdW9cVsSwORD54hh/VLnyuotyIUVAKP3SJrXFYkRgTSS7WXHAAAf/Hj7nl 7U7GjwEOZbGQbs1DnoEKpe7djslKgVyzV+LZ14kKn0EsbQI+qshCAEbKjsRtXNQXIg5i EV+affhisckV33IphmGCKZt2BrlKRKODCO9RZVCdR3LPqlEhUUgO+C2JXX1Un4+d/DXi 8bqLSEeUYBqvT1CTni1F5oc0LlUvSMMBEMicB2cdyAVcobbzt5cUCRJKK45NQrbQS95F a3ecT62XiFp3i1hkXueiuv3vY5u4qx8NiGkNeFAvGA1oP+rGDc8zcgGd6QqcQTuh60ge s98Q== X-Gm-Message-State: AGi0PubY+DnaSKULGWtE8i8HG8yihJbfQc3AFvdSjThECvamSN/9Adyx 057ynY3n7sJUkCeR+YH+Khw= X-Google-Smtp-Source: APiQypITjBdTPiK6o3JqI5ScFOmMSH/hy1hFJ/Xh629QguwJgGQlbx7bgMf1cSsRBPl6u5rfmxgMeQ== X-Received: by 2002:a1c:4603:: with SMTP id t3mr18964693wma.103.1586791953168; Mon, 13 Apr 2020 08:32:33 -0700 (PDT) From: Lev Olshvang To: keescook@chromium.orh Cc: kernel-hardening@lists.openwall.com, Lev Olshvang Subject: [PATCH v3 4/5] Hardening unicore32: Forbid writes to read-only memory pages of a process Date: Mon, 13 Apr 2020 18:32:10 +0300 Message-Id: <20200413153211.29876-5-levonshe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200413153211.29876-1-levonshe@gmail.com> References: <20200413153211.29876-1-levonshe@gmail.com> Signed-off-by: Lev Olshvang --- arch/unicore32/include/asm/mmu_context.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/unicore32/include/asm/mmu_context.h b/arch/unicore32/include/asm/mmu_context.h index 50961d4b4951..388c0c811c68 100644 --- a/arch/unicore32/include/asm/mmu_context.h +++ b/arch/unicore32/include/asm/mmu_context.h @@ -93,11 +93,6 @@ static inline bool arch_vma_access_permitted(struct vm_area_struct *vma, bool write, bool execute, bool foreign) { /* by default, allow everything */ - if (likely(vma_write_allowed(vma, write, execute, foreign))) - return true; - - pr_err_once("Error : PID[%d] %s writes to read only memory\n", - current->tgid, current->comm); - return false; + return true; } #endif From patchwork Mon Apr 13 15:32:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lev R. Oshvang ." X-Patchwork-Id: 11485785 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B712F13B2 for ; Mon, 13 Apr 2020 15:33:29 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id 1DF182072C for ; Mon, 13 Apr 2020 15:33:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="K3qw7GFb" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1DF182072C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-18500-patchwork-kernel-hardening=patchwork.kernel.org@lists.openwall.com Received: (qmail 19636 invoked by uid 550); 13 Apr 2020 15:32:46 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 19507 invoked from network); 13 Apr 2020 15:32:45 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xn7OprT8wPCkg7aj43eoXaV9EgIHAs0o3lL8DycAkbE=; b=K3qw7GFby1PNOvs2S59LnmpZ7DnQelyRvUSUMvUWosklORSxFsEvlZocFPQvSRJbXk ucXfGi1d4M42FkTKa64xWRe2ETwgQNowkfX8c6yXT2eyaImcb1Ufcqy4Re5S4LthntZ9 rGnKCiOM6k6Vlnw/kOUA3h2RE3rpKK5Wlpo94saOWsz7hyN9JRPVko0d6FZbUFHjZRUd lsz792xADhUD/euDASowFpD9nT/ldRLs0UXIOTNsa1dfS0zgBdvEfdilxwNJovDCykCh x2J8dp2cmDUv1VK3h/nSbuPgMKvrjt7NR4EkILppd5HMbfeYHaArPFQrCCJYApNTxLU5 oEbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xn7OprT8wPCkg7aj43eoXaV9EgIHAs0o3lL8DycAkbE=; b=eRzE1nkIzmu+ogF7kl/M4D8vBVkfsU9gMNxPHnAo0weqlaqZxwWVgtINC/gYj2Ry49 ZGiukpxM83x58GNtLx4wmP1Paq9Tz9I6FmjFP38BsX4JoOfJ4MlyAWD1whGwRVnzJ+Ue xxunOsm9qxLIsYgLQngxi/hGNL6zZgudLDl3iuAFY/8CFGhQvzH10Jr8mwugy4Jh6W7I NfwKelo4DwaDIOjsjx31IgGUQAysXrb6DnUbAbaKPE1p1dJhQ0qihm2tZ7hwQfvp/vM4 4hSVv3tuZ18NbRko8IXNMdq4KKWWUem9QsvwGcfWJcyvlHSpk/GZCx45AJZZReny2rE/ KSFg== X-Gm-Message-State: AGi0PuZKYb9Ai6eAqYqQoZdGeSTCpGUxwmVt/8joxVwqdr6RFfBRo5+n 2inD84zYd4l7fC3hpXO3+JI= X-Google-Smtp-Source: APiQypIbrOKof9nl/IbdDj+hsJVxERTDX7BiwWanAYrXFk0KSFojMZwUIWGNH2t6sthYtlo+cK3MQA== X-Received: by 2002:a1c:dc8b:: with SMTP id t133mr19440396wmg.117.1586791954591; Mon, 13 Apr 2020 08:32:34 -0700 (PDT) From: Lev Olshvang To: keescook@chromium.orh Cc: kernel-hardening@lists.openwall.com, Lev Olshvang Subject: [PATCH v3 5/5] Hardening : PPC book3s64: Forbid writes to read-only memory pages of a process Date: Mon, 13 Apr 2020 18:32:11 +0300 Message-Id: <20200413153211.29876-6-levonshe@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200413153211.29876-1-levonshe@gmail.com> References: <20200413153211.29876-1-levonshe@gmail.com> Signed-off-by: Lev Olshvang --- arch/powerpc/mm/book3s64/pkeys.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/arch/powerpc/mm/book3s64/pkeys.c b/arch/powerpc/mm/book3s64/pkeys.c index 4c537af6ab01..1199fc2bfaec 100644 --- a/arch/powerpc/mm/book3s64/pkeys.c +++ b/arch/powerpc/mm/book3s64/pkeys.c @@ -384,11 +384,6 @@ bool arch_pte_access_permitted(u64 pte, bool write, bool execute) bool arch_vma_access_permitted(struct vm_area_struct *vma, bool write, bool execute, bool foreign) { - if (unlikely(!vma_write_allowed(vma, write, execute, foreign))) { - pr_err_once("Error : PID[%d] %s writes to read only memory\n", - current->tgid, current->comm); - return false; - } if (static_branch_likely(&pkey_disabled)) return true; /*