From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: bug#24703: Store references in 8-byte chunks in compiled code Date: Mon, 17 Oct 2016 23:36:57 -0400 Message-ID: <87k2d6qqee.fsf@netris.org> References: <87mvi5lzqu.fsf@netris.org> <87inssncln.fsf@netris.org> <8737jwnb1c.fsf@netris.org> <87r37gstf6.fsf_-_@netris.org> <87d1j0sl1l.fsf@netris.org> <87a8e4glot.fsf@gnu.org> <8f2024ad-13c1-d4b1-1541-c2a5bddcb403@etorok.net> <87h98bdvng.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwLE5-0003AD-Gi for bug-guix@gnu.org; Mon, 17 Oct 2016 23:38:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwLE2-0000dm-C7 for bug-guix@gnu.org; Mon, 17 Oct 2016 23:38:05 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:59461) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bwLE2-0000de-82 for bug-guix@gnu.org; Mon, 17 Oct 2016 23:38:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87h98bdvng.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 17 Oct 2016 14:09:39 +0200") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 24703@debbugs.gnu.org ludo@gnu.org (Ludovic Court=C3=A8s) writes: > T=C3=B6r=C3=B6k Edwin skribis: > >> On 2016-10-16 22:04, Ludovic Court=C3=A8s wrote: >>> Mark H Weaver skribis: >>>=20 >>>> When grafting, how will we achieve confidence that we've found the >>>> correct occurrence of the last character? I think we will have to give >>>> up our recently added feature of being able to change the version numb= er >>>> of grafts. >>>=20 >>> Wait, don=E2=80=99t jump to the conclusions. :-) >> >> I've just encountered the same problem with fontconfig (after installing= GuixSD, running guix pull and guix system reconfigure, --no-grafts was req= uired). >> Would it be possible for the grafts to keep a symlink (somehow >> registered to be part of the grafted fontconfig so that guix gc >> doesn't remove it) instead of patching the binaries? >> /gnu/store/-fontconfig-2.11.94 -> /gnu/store/-fo= ntconfig-2.11.94 > > We could use a self symlink, or we could use something like > . > > Mark, WDYT? > > What remains to be seen is how many packages are affected by this issue, > and whether a generic solution needs to be found. Unfortunately, it is too widespread. As I just pointed out in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D24712#13 Among the many packages that include these obfuscated store references, one is 'glibc-final'. My attempt to graft 'bash' in 'master' to fix CVE-2016-0634 and CVE-2016-7543 has resulted in a system where I cannot build *any* derivation, because 'guile-final' crashes during boot while its 'glibc-final' tries to find its 'gconv' modules in the ungrafted 'glibc-final', which is not available in the build environment. So, if our approach is to use -fno-builtin-strcpy, then we will have to apply it system-wide, and rebuild all of 'core-updates' from scratch. I've been investigating another approach: to enhance our scanner and grafter to handle these 8-byte-chunked references. I believe it is feasible, but only if we abandon the ability to change the file names of grafts outside of the hash. The reason is that the hash portion of store references are surrounded by enough other known characters on both sides that the hash portion is almost always contained entirely within 8-byte chunks. To be continued... Mark