Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1457960imm; Wed, 23 May 2018 16:57:19 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpWuo2HbkKs4tJR9SxM+HJGcapdS2IxtBvr3MD3uOfURfNb3O+rskQ1ug+8MbZOWNdpyr0j X-Received: by 2002:a62:78c:: with SMTP id 12-v6mr4829964pfh.178.1527119839446; Wed, 23 May 2018 16:57:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527119839; cv=none; d=google.com; s=arc-20160816; b=mPbAaRKmpnsdGsszE1BKeHQ//1LdvGapwBCrnit7ial1p8CIiqrFDaCZIMh83DzuZ5 Qz2quWe7t0GCT7CcR+/rbZvoajRFujhKIg2sjrPCf6l9QX0kUQZ1UxouKzAP8l3cKjyy HMxvXNvWCD9A1TfJcW1kVyqA1zniWb0Usw723GIAnIHd54d1Q7flH4QLmlIVzQDqXYfm n4DzWxlJYGiduHstecesupaeoOUk4noC4IbmKR2pn28u/JSrDMO3LIGKJU/oUVLccHrB Cb5vH/9ORKFC9MYdExI2Mu5Eg2c7TsHZAzopsBQ7AQnD5+MCApWeAV4gCEDUKBS5UPwN 5qvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=zAjTWJ1Ou8ynIU1Qr7cO1PHyU5CCW/zrA30Wj8ZGJX0=; b=T093Ou+WFIP6JRe67p1VngLJ9EGrqvPn4MB4UZ4WrbTDqXNWp9nKLa6oIcAlZOyzn0 0XpDvVVIpMA5xUZtQIdLXEk8H4F5JZ6MEAVfCUr4h/3z4LYyTpiQNZz3BWvCfttdboZC 9/zDvrVfNfq0hwGKXvty1NIhyJt5BRcMREIQmkuGEOH5c6UbzecIozTYjeEx45lJ1lle f6XhUdLKy2OhBLDpORr/Y5uH0cYrC3f+bkf6WEMtuQOH5kZ2lQG9UOXME3hRRSMHrT8S dVfoR9bXrX6ieEh0sp2efZZUZ/FgEvNo9g/rGzFsd8v9HohQhWQLt7wDhHoWCX5BlvN0 8nzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=MeEGM4BL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a8-v6si21523091pln.349.2018.05.23.16.57.04; Wed, 23 May 2018 16:57:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=MeEGM4BL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935202AbeEWX4G (ORCPT + 99 others); Wed, 23 May 2018 19:56:06 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:51788 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934770AbeEWX4D (ORCPT ); Wed, 23 May 2018 19:56:03 -0400 Received: by mail-it0-f67.google.com with SMTP id d10-v6so159341itj.1; Wed, 23 May 2018 16:56:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zAjTWJ1Ou8ynIU1Qr7cO1PHyU5CCW/zrA30Wj8ZGJX0=; b=MeEGM4BLhpt9aL+1M0Y9HlX0dzmdqCp/Q6ICXOczFczhoRssfPdBIngQNQZmMzNtxS 4gmOopqmloz9bcfT3RcFyoEIZE7N4lfXgbeOjYyh8JyO7vhNeDJGKsN67bQvtZ0dluTD EFtmaziIV6QHy9XWIcyN8uphOLegB913zPYN4= 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=zAjTWJ1Ou8ynIU1Qr7cO1PHyU5CCW/zrA30Wj8ZGJX0=; b=q8CQRUfU9qPZXWCRvN5gqY6mNL7vBkGpO/UtvlKtlY6gdamdvFKPIrKiH/M5huGtAz Qrft8ua/y5a4E+I2fTmv/1ruv5WJyGAiBgXMPJ2eYjsKQldLQHUuaE78BZc7W0VF4y7B pbvlvpKGye7u38LTGZC5kMpdLhQC9juP1CbfFOTxEHTE+fifklXiZykQkQnnce5vAtFR zZQhcFFyc4mJN2WJ7KF4vWQc5ouXn2IHLVx1CY+rWaS4YWXkMDYYhc5uA9sAHYiDmOKz y9vBRvMOvOjCk+BOvyXz+nONyiqJfWjSZ0/NXLO7g3usRIdYfArTlm4lcu2V4lUiZBxS 1ixA== X-Gm-Message-State: ALKqPwfsjrcfgq+nSdxMDhfx9ZdLis3R3Yx2WPgXROHClgALPH7o6Hxx 7kZfkhC3NBVuaYfqfr2iXGD/aS23u9ijahCO4c4= X-Received: by 2002:a24:4c55:: with SMTP id a82-v6mr7040140itb.1.1527119763162; Wed, 23 May 2018 16:56:03 -0700 (PDT) MIME-Version: 1.0 References: <20180523001939.9431-1-labbott@redhat.com> <20180523001939.9431-3-labbott@redhat.com> <15dcff14-ea1b-18c8-4cd1-06586cf6f05b@redhat.com> In-Reply-To: <15dcff14-ea1b-18c8-4cd1-06586cf6f05b@redhat.com> From: Linus Torvalds Date: Wed, 23 May 2018 16:55:52 -0700 Message-ID: Subject: Re: [PATCHv3 2/2] x86/vdso: Add build salt to the vDSO To: Laura Abbott Cc: Andrew Lutomirski , mjw@fedoraproject.org, "H.J. Lu" , Masahiro Yamada , "the arch/x86 maintainers" , Linux Kernel Mailing List , nickc@redhat.com, ccoutant@gmail.com, Linux Kbuild mailing list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 23, 2018 at 3:53 PM Laura Abbott wrote: > Actually I remember now why this is necessary: there is not a simple way > to encode a string into a linker file as it has to be spit out byte > by byte. I think you can use the "fill" thing to basically add any random data to a section. So you can do something like . = ALIGN(16); .salt : AT(ADDR(.salt) - LOAD_OFFSET) { LONG(0xffaa5500); . = ALIGN(16); } =0x01234567890abcdef in the lds file, and you'll get a section that looks like this: [torvalds@i7 linux]$ objdump -h vmlinux -j .salt -s vmlinux: file format elf64-x86-64 Sections: Idx Name Size VMA LMA File off Algn 15 .salt 00000010 ffffffff8432b000 000000000432b000 0352b000 2**0 CONTENTS, ALLOC, LOAD, DATA Contents of section .salt: ffffffff8432b000 0055aaff 00123456 7890abcd ef001234 .U....4Vx......4 Now whether that is sufficient for your needs, I dunno. Linus