From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92B90C2D0A8 for ; Sat, 26 Sep 2020 07:58:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 486C52083B for ; Sat, 26 Sep 2020 07:58:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mNrK25T4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729172AbgIZH6Q (ORCPT ); Sat, 26 Sep 2020 03:58:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726037AbgIZH6P (ORCPT ); Sat, 26 Sep 2020 03:58:15 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6782CC0613CE for ; Sat, 26 Sep 2020 00:58:15 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id o8so1641257ejb.10 for ; Sat, 26 Sep 2020 00:58:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=30pt3/plV21ez9XG1zPQRLkLMAh3JevcIb4p0H7YqLE=; b=mNrK25T4y2Wy1M1VbeJwGkc2bnTzBljG+f+yWcgd0MhxCytvY4UBQ77SmbrFxl3tyw RopZrP/i9A/8qg/8Z2MFXKM0y+rlrsBaA5XMJkc9rHH1uatrvj3G07UIckxMvG+osvzd wYPQoqlV/A3vQmqW+oZ2+RmY6WB3rhQzAQal9/lQ/qf8ah5rtIUTPqpgLwLSeZ8VuyGx sRZeF3+cOr6/jPsClCjNFuqRko2tOgyLEnKwKJ8oRbo+49kfDnCj+zOYjs7KeP30LaaR DLselbtaU0V9Dv1rM6Scz57SuPdWGSZpl9nlViLy/SscjqHZu5yuEWz7c5+pm54JSNBS cTyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=30pt3/plV21ez9XG1zPQRLkLMAh3JevcIb4p0H7YqLE=; b=JzATwZTm67Wd7gWHO55iRSoavJbv0T6g4V54kDI3J1IRnhC5a0U/ftdp+Y4EPP2ccQ LGQCetGRuzm6RlIfq23ByAEtWxr7Tn5mhNi6DQv+VmzHNTaVH+DCrtYq2BgCykWUlz3A 6SDx36U4votaf9fWF9Kg/NMp98Q9afQwje0Yh+uM8OlFvKexV+DVJUItcayR+cKDEbaJ Ygxh6V2XwSsOFI+4fsq+K55aZDUJvczNcgeDybNt1LEsLgdza7klCXHSvp0a35YkBo4F A2U3YiuRuBEbsTpYinRetZr0/TKeVAA66Ct7VUBn7m4LGH8DCTGsMOTItbBeF9WG+0CB LiIQ== X-Gm-Message-State: AOAM5333XeA14ff28HDNOxIeOzQmGjsfxOBG+qwUJeEERHjPr1fva6wL e60XTNiw3cEAc7mAljMf+lxq3s/N3gJAMfD1ub8= X-Google-Smtp-Source: ABdhPJwYywP0LrGBqPEAn0TebQyOISg+LCkpGuH869jgderXmE0ARm626+PtoRACZbP6DqGaoAkdqhLyWWsuy1OetLQ= X-Received: by 2002:a17:906:d11a:: with SMTP id b26mr6282486ejz.191.1601107093982; Sat, 26 Sep 2020 00:58:13 -0700 (PDT) MIME-Version: 1.0 References: <202009251301.A1FD183582@keescook> <202009251338.D17FB071@keescook> <202009251647.FD8CECD4@keescook> In-Reply-To: <202009251647.FD8CECD4@keescook> From: Pintu Agarwal Date: Sat, 26 Sep 2020 13:28:02 +0530 Message-ID: Subject: Re: KASLR support on ARM with Kernel 4.9 and 4.14 To: Kees Cook Cc: Ard Biesheuvel , Mark Rutland , Arnd Bergmann , Ard Biesheuvel , Marc Zyngier , Dave Martin , Kernelnewbies , Russell King - ARM Linux , open list , Tony Lindgren , matt@codeblueprint.co.uk, nico@linaro.org, Thomas Garnier , "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 26 Sep 2020 at 05:17, Kees Cook wrote: > > > > For a 3/1 split ARM kernel of the typical size, all kernel virtual > > addresses start with 0xc0, and given that the kernel is located at the > > start of the linear map, those addresses cannot change even if you > > move the kernel around in physical memory. > > I wonder if this is an Android Common kernel? I think there was %p > hashing in there before v4.15, but with a different implementation... > Hi, Thank you all for all your reply and comments so far! Here are some follow-up replies. >> What device is this? Is it a stock kernel? This is a Qualcomm Snapdragon Automotive board one with Linux Kernel 4.9 and one with 4.14. >> Is the boot loader changing the base address? (What boot loader are you >> using?) Ohh I did not knew that the bootloader can also change the base address. I think it uses UEFI. How to check if bootloader is doing this ? BTW, both 4.9 board and 4.14 board, uses same bootloader. >> I wonder if this is an Android Common kernel? It uses the below kernel for 4.14: https://gitlab.com/quicla/kernel/msm-4.14/-/tree/LE.UM.3.4.2.r1.5 (or similar branch). ==> The case where symbol addresses are changing. kptr_restrict is set to 2 by default: / # cat /proc/sys/kernel/kptr_restrict 2 Basically, the goal is: * To understand how addresses are changing in 4.14 Kernel (without KASLR support)? * Is it possible to support the same in 4.9 Kernel ? -- Thanks, Pintu