From patchwork Tue Nov 6 21:44:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 10671469 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3289915A6 for ; Tue, 6 Nov 2018 21:44:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24F2B2A40A for ; Tue, 6 Nov 2018 21:44:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 18F072A938; Tue, 6 Nov 2018 21:44:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 4F1012A40A for ; Tue, 6 Nov 2018 21:44:23 +0000 (UTC) Received: (qmail 1047 invoked by uid 550); 6 Nov 2018 21:44:21 -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 1026 invoked from network); 6 Nov 2018 21:44:21 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=NX2mNgjKT0L31rAhvXnB85NrwMS95KZAyExje02In30=; b=c8XDRUyK5uZEleIU0Rxa6MhgTtEzseY936/yXBwj0/xJmRwY2PG5eT+TzHLsdMRU4e EklMre/nOQiaIBR3GqtIjPpzULGX9jsdAJ2B5EP3zOlh6l27SDFfJUyfHAj3dk0AGx9W jxrDtz7KiszjsExzK2I/4I8oEGKjJ0lamTBO0= 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:mime-version :content-transfer-encoding; bh=NX2mNgjKT0L31rAhvXnB85NrwMS95KZAyExje02In30=; b=nigheyURMNecxo0cpZfl67+aGWq4q1Gy8jChrto+mJuuhYcIwrlBxQqND48C90mWdU OmSOkVFbVZq5R3nqq+NCnsleCwnpC4YGCurpFpkzaAu6VzsPD1c+fiyn/d/D6oWzm1sW aXnJTd5MtB5ZfLdBGig8mcy9uufYbQ6mARXJI72sceK6l2tfRe96Dcwne490Nc6ru30K IbZZYb9vrrolm+BA6XELnwzNIbAM6t6XKRJOTI2PuoaS4ajXybV5rRGn6bmuA3SScXsV 4zIbwAHzZQ/jmu7ZyZrO/WJO/6bL9kxSxNjaQqurwjFK9XRLRN5VZSbiA7XXR3+QsZXw 8/iQ== X-Gm-Message-State: AGRZ1gJOs9eW5Oz4OrgXmeDAuS9qjXa7wxk9sxWCct0O0n6CIp1rT4ON Epsm0OJb+Rn7yGnb7VwnNDCHBA== X-Google-Smtp-Source: AJdET5ekIbYj+XYvbFQt0OVBuW2ot/ITpURjBLefWstskZ8OkOo+xxeAlJd/F8qa13jr2wJsVv6JdQ== X-Received: by 2002:a1c:90cc:: with SMTP id s195-v6mr3259045wmd.53.1541540649815; Tue, 06 Nov 2018 13:44:09 -0800 (PST) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org Cc: keescook@chromium.org, kernel-hardening@lists.openwall.com, labbott@redhat.com, will.deacon@arm.com, jannh@google.com, mark.rutland@arm.com, james.morse@arm.com, catalin.marinas@arm.com, Ard Biesheuvel Subject: [PATCH v3 0/2]get rid of writable linear aliases of read-only vmalloc mappings Date: Tue, 6 Nov 2018 22:44:02 +0100 Message-Id: <20181106214404.2497-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP This is a followup to my patch 'arm64/mm: unmap the linear alias of module allocations'. This version changes the approach to match what x86 does, i.e., to deal with the linear alias at a more fundamental level, in the set_memory_ro/rw routines. Ard Biesheuvel (2): arm64: mm: purge lazily unmapped vm regions before changing permissions arm64: mm: apply r/o permissions of VM areas to its linear alias as well arch/arm64/Kconfig | 14 ++++++++ arch/arm64/include/asm/mmu_context.h | 2 ++ arch/arm64/mm/mmu.c | 2 +- arch/arm64/mm/pageattr.c | 36 +++++++++++++++++--- 4 files changed, 48 insertions(+), 6 deletions(-)