Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1463594imm; Wed, 23 May 2018 17:03:53 -0700 (PDT) X-Google-Smtp-Source: AB8JxZokTs4DQf6KeCVFIsowuA+6GML2282bOv3QWmvQ45XUj2RKL1HNicbq1s4c5U9KuX5npP9b X-Received: by 2002:a65:63cf:: with SMTP id n15-v6mr3841983pgv.371.1527120233544; Wed, 23 May 2018 17:03:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527120233; cv=none; d=google.com; s=arc-20160816; b=Ys03lu9Qh1Vj6pLZnDyucibezlvRlue65aVweA4cewd/dEowSQocd4I4YwEReMIlrG 6nwXWZzXA4A6oXRQ9blRjCZogXJT6Dj5JU9YKijhLeW1gEJlM10ey7tTk5/MNnaFefMU 5++QLNi5fpTkpZY6dfAgBpVBUuOLQcqNBhpNGercQOo3kjX9TQRXYqCohL2PKxPn1hdo oHn2BGUbo6n53NxRgTfsJ+HTaOYx4DiZ3Bl13SSdeB4peLr+b6WTMhn03v+3iFpD6/ba SD+7BxgOifhg0FvsGnqUtEscpbAAuTvjzlCWaOc+nzpD5YQD5EC239RGn0twSqQfkO4x cfiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature:arc-authentication-results; bh=jdbRHoMtv9YXfGmP4hNijpiyO+FvW9nmXfwU1O/scZU=; b=BG1D+6fWR/wJF24zO4NYY2psa88OdJLJtTSkYi+7mgOvUkWrPjaVYZV0GJCjCsweU1 Osr1fsOehYXDzvu8l5byCm+ucXvoq/skKtD4B8ZE6VLMg66zHzqsNiTZjS065IpGX+t0 fgrzkXZPKCIbsF1ASgFdJrCQNpqfFn8DyCwMipv/oDu5LZFwuwaT0bslD38rQCtKiG7z Mh1uTNF2TbBR1qkYrmTUJOEhHplP4Zs3fqupGVQJ60Wdh4/zUf9T2dIX7OQgovGOgaAO AISyXt7cD8TWPgYkRtIcW0IJHKIzpnT4bkQNgApj/88LocCHHZxtrbfHoeLWDcA4/bLQ lapQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=FcOdmlVP; 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 c86-v6si20000153pfl.319.2018.05.23.17.03.38; Wed, 23 May 2018 17:03:53 -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=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=FcOdmlVP; 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 S935219AbeEXABI (ORCPT + 99 others); Wed, 23 May 2018 20:01:08 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:36580 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934770AbeEXABD (ORCPT ); Wed, 23 May 2018 20:01:03 -0400 Received: by mail-pg0-f66.google.com with SMTP id u7-v6so1605978pgp.3 for ; Wed, 23 May 2018 17:01:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=jdbRHoMtv9YXfGmP4hNijpiyO+FvW9nmXfwU1O/scZU=; b=FcOdmlVPlkeLjatgIu7hEYt8oIaEvnyv4CLbxJytDpi3ZNluSBPrPZvJWxNzrV2GHl SFChNK9f6Z7zM26woBoQYAHSNM6hZb9mzvWY1mLqQ4SlFD63uNaB1fC3KTCjrIPtmcJ5 HyL2qQmsVRyvXns+8ia+zRdZExKHVI+Igj1vR+4nNhAuNrnCd+1mxpB/uiSB/h00asi5 0EpSdT5QkVbI0HvtOpeGl6I7Wlmq53a/l0FKdQXywfYazC93WLZNKJ9s38R8snQXbYd4 HZbj2gvyXl3AOr2XvXIQmUxXqioCHbU5IZSGWpte6vFbUQYmEL3qpH4vOYOWuAxp8OP4 H2Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=jdbRHoMtv9YXfGmP4hNijpiyO+FvW9nmXfwU1O/scZU=; b=Mpq8VROq+J+DfBfQFeum4ujDWb76Hk26IR0f5BEbOrrJRPXZTd1Ao73JnCR2YhHkg4 cMhHIPLzAetY7w8UMol577DjQPhd2AYoom1SdVpZuVcDkvxBSqziLmKJ+9VuTasP6uuD IMAc8EJCzMQDHx6EBQhiIwbI8Ww3z+pVP+ya6aYRZs9Lv6W6LlKtgMwHHx/WV706kv0s doFnEArnLKZmHPBs6S+Yhhzsrif8blPt4+WXKLJRcBolVJVZq7vagNxRJmJS6wKpj/B/ sUJopvTLEmtXuWyvbsNo4HklsZ01qMZxHjnwtdx1/jlSGoad8Q2IpA9mvKTx00/5qSUa J+Rw== X-Gm-Message-State: ALKqPwcNIwy+/v7VB6O2zKTDc9Q7g7wRAt7GH9IhaD1TqniQu82Sx6Rs 5Rk2fVa7nG/TaTpJ2T2F4T3TvQ== X-Received: by 2002:a62:ed12:: with SMTP id u18-v6mr4854294pfh.127.1527120063178; Wed, 23 May 2018 17:01:03 -0700 (PDT) Received: from ?IPv6:2600:1010:b069:c2bb:f077:1695:acf7:2c9? ([2600:1010:b069:c2bb:f077:1695:acf7:2c9]) by smtp.gmail.com with ESMTPSA id 63-v6sm38252712pgi.4.2018.05.23.17.01.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 May 2018 17:01:02 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: [PATCHv3 2/2] x86/vdso: Add build salt to the vDSO From: Andy Lutomirski X-Mailer: iPhone Mail (15E302) In-Reply-To: Date: Wed, 23 May 2018 17:01:00 -0700 Cc: Laura Abbott , 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-Transfer-Encoding: quoted-printable Message-Id: <195C83C0-067C-4B55-89BD-9CF3155C6E69@amacapital.net> References: <20180523001939.9431-1-labbott@redhat.com> <20180523001939.9431-3-labbott@redhat.com> <15dcff14-ea1b-18c8-4cd1-06586cf6f05b@redhat.com> To: Linus Torvalds Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On May 23, 2018, at 4:55 PM, Linus Torvalds wrote: >=20 >> On Wed, May 23, 2018 at 3:53 PM Laura Abbott wrote: >>=20 >> 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. >=20 > I think you can use the "fill" thing to basically add any random data to a= > section. >=20 > So you can do something like >=20 > . =3D ALIGN(16); > .salt : AT(ADDR(.salt) - LOAD_OFFSET) { > LONG(0xffaa5500); > . =3D ALIGN(16); > } =3D0x01234567890abcdef >=20 > in the lds file, and you'll get a section that looks like this: >=20 > [torvalds@i7 linux]$ objdump -h vmlinux -j .salt -s >=20 > vmlinux: file format elf64-x86-64 >=20 > Sections: > Idx Name Size VMA LMA File of= f > Algn > 15 .salt 00000010 ffffffff8432b000 000000000432b000 0352b00= 0 > 2**0 > CONTENTS, ALLOC, LOAD, DATA > Contents of section .salt: > ffffffff8432b000 0055aaff 00123456 7890abcd ef001234 .U....4Vx......4= >=20 > Now whether that is sufficient for your needs, I dunno. >=20 I don=E2=80=99t know whether I=E2=80=99m missing something obvious, but can=E2= =80=99t this be in C? asm (=E2=80=9C.pushsection \=E2=80=9D.comment\=E2=80=9D; .ascii \=E2=80=9D=E2= =80=9D WHATEVER =E2=80=9C\=E2=80=9D; .popsection=E2=80=9D); Or the .S equivalent.