Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00F0DC433FE for ; Mon, 6 Dec 2021 06:04:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237624AbhLFGH3 (ORCPT ); Mon, 6 Dec 2021 01:07:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:58497 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237612AbhLFGH2 (ORCPT ); Mon, 6 Dec 2021 01:07:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638770639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Wo70tjI7q1UAqboatbwLl0h/uu/FTe3Affu+qnLiGkQ=; b=UGcZpCZDojgTEw8MOtaor7QeIdaHHeQlsEVZpk7JrAqyerZ8aTHoxb0ZHU+/3ptGXn8Ijw 9veK8HQ8MDJfbhgZ2F+U9QLKhgL98XboojjWtspNksU1vLrKIvhgp/1pLrbLQntdUkT7Jq ha2WaGvNrcd8LWT2vgaA7H4KW50ibaE= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-145-qkS1-S2_O6Kvn23C6olsAg-1; Mon, 06 Dec 2021 01:03:58 -0500 X-MC-Unique: qkS1-S2_O6Kvn23C6olsAg-1 Received: by mail-qv1-f71.google.com with SMTP id kd7-20020a056214400700b003b54713452cso10693611qvb.13 for ; Sun, 05 Dec 2021 22:03:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Wo70tjI7q1UAqboatbwLl0h/uu/FTe3Affu+qnLiGkQ=; b=zLvQxhnHlfy2tBRimNImh+yz8waJDne2yvUbOVTWLW5IBV+gqgUGb9nrPLSUi9EgAs vDbegtaQozF1XaJWUOuly8R8XjHMnpK0Ll06QcMrIhFZYTMsqMIKFyn7Fg2RxRaYuwxb u+JfyX1JPu+tc1sLIhxzruni8qA5dluxBhXytFXJ/x2YGEoISgzFcNw2ww/DqPecIQA6 6YBssXem74MtjLA+2cdjq5R0GDbSlrivye5iIQ6oSkpKMtScBS7bQE3ls8GLjdzMIddI y0rr/pMv8UZIs1U5YjZDQ1MHdI5tCxo7dq8cl9iWBKZBN8H4JcX7fQkxGvwSUQuADTiF Elxg== X-Gm-Message-State: AOAM531cIAUtjHvl99j2AgYp1/OzBuLGHGp9AB1BUg8j+ovW+Ns+0jUB CGVkXYZeEkaoTza3IOrAerk9zPyNVaOLGC6xtho/VvYXPn560CCBhjQDK4M2UjkdnmmVMX5OxrT BXJZkM3xIL8yajZTegE4BJ7ED X-Received: by 2002:ac8:5bcf:: with SMTP id b15mr37503557qtb.474.1638770637758; Sun, 05 Dec 2021 22:03:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJwBlcOgv7DcKhfVmXiMUiPn6jj3Lbd0IoNd3WtPjyxukoKwU1wdw7FB6qmJfkTYOfo/DTS8HA== X-Received: by 2002:ac8:5bcf:: with SMTP id b15mr37503536qtb.474.1638770637542; Sun, 05 Dec 2021 22:03:57 -0800 (PST) Received: from treble ([2600:1700:6e32:6c00::45]) by smtp.gmail.com with ESMTPSA id y20sm6176312qkj.24.2021.12.05.22.03.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Dec 2021 22:03:56 -0800 (PST) Date: Sun, 5 Dec 2021 22:03:50 -0800 From: Josh Poimboeuf To: Peter Zijlstra Cc: Alexander Lobakin , linux-hardening@vger.kernel.org, x86@kernel.org, Jesse Brandeburg , Kristen Carlson Accardi , Kees Cook , Miklos Szeredi , Ard Biesheuvel , Tony Luck , Bruce Schlobohm , Jessica Yu , kernel test robot , Miroslav Benes , Evgenii Shatokhin , Jonathan Corbet , Masahiro Yamada , Michal Marek , Nick Desaulniers , Herbert Xu , "David S. Miller" , Thomas Gleixner , Will Deacon , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , Andy Lutomirski , Arnd Bergmann , Nathan Chancellor , Masami Hiramatsu , Marios Pomonis , Sami Tolvanen , linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org, linux-arch@vger.kernel.org, live-patching@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH v8 08/14] livepatch: only match unique symbols when using FG-KASLR Message-ID: <20211206060350.f4hqug2jhgjlaw3c@treble> References: <20211202223214.72888-1-alexandr.lobakin@intel.com> <20211202223214.72888-9-alexandr.lobakin@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 03, 2021 at 11:05:54AM +0100, Peter Zijlstra wrote: > On Thu, Dec 02, 2021 at 11:32:08PM +0100, Alexander Lobakin wrote: > > If any type of function granular randomization is enabled, the sympos > > algorithm will fail, as it will be impossible to resolve symbols when > > there are duplicates using the previous symbol position. > > > > We could override sympos to 0, but make it more clear to the user > > and bail out if the symbol is not unique. > > Since we're going lots of horrendous things already, why can't we fix > this duplicate nonsense too? I assume you mean using this new linker flag: "-z unique-symbol" https://sourceware.org/bugzilla/show_bug.cgi?id=26391 -- Josh