all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Mark H Weaver <mhw@netris.org>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: Handling ‘file’ CVE
Date: Thu, 13 Nov 2014 21:43:04 +0100	[thread overview]
Message-ID: <87zjbu4ysn.fsf@gnu.org> (raw)
In-Reply-To: <87egt7f052.fsf@yeeloong.lan> (Mark H. Weaver's message of "Thu, 13 Nov 2014 13:03:53 -0500")

[-- Attachment #1: Type: text/plain, Size: 533 bytes --]

Mark H Weaver <mhw@netris.org> skribis:

> FWIW, I think it would be better for 'file' to be bound to the fixed
> package, and to add a 'file/fixed' that points to the old buggy one.
> Then 'file/fixed' could be used in some selected places.
>
> 'file' is used as a plain input (as opposed to native-input) in several
> places that make me a bit nervous, e.g. the 'transmission' bittorrent
> client (is 'file' being used at runtime on downloaded files?), and also
> 'aegis', 'quilt', and 'cmake'.

This script helps determine this:


[-- Attachment #2: the script --]
[-- Type: text/plain, Size: 1167 bytes --]

(use-modules (guix) (gnu)
             (gnu packages file)
             (ice-9 match)
             (srfi srfi-1)
             (srfi srfi-26))

(define (file-input? inputs)
  (find (match-lambda
         ((label (? package? p) . _)
          (eq? p file))
         (_ #f))
        inputs))

(define (packages-using-file)
  (fold-packages (lambda (package result)
                   (if (or (file-input? (package-inputs package))
                           (file-input? (package-propagated-inputs package)))
                       (cons package result)
                       result))
                 '()))

(define (has-runtime-dependency-on-file? package)
  (with-store store
    (let* ((file (package-full-name file))
           (drv  (package-derivation store package))
           (outs (map cdr (derivation->output-paths drv)))
           (info (substitutable-path-info store outs)))
      (find (lambda (info)
              (find (cut string-suffix? file <>)
                    (substitutable-references info)))
            info))))

(define (packages-with-runtime-dependency-on-file)
  (filter has-runtime-dependency-on-file?
          (packages-using-file)))

[-- Attachment #3: Type: text/plain, Size: 784 bytes --]


The result is:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (packages-with-runtime-dependency-on-file)
$8 = (#<package quilt-0.61 gnu/packages/patchutils.scm:85 41f5240> #<package aegis-4.24 gnu/packages/version-control.scm:491 383c240>)
--8<---------------cut here---------------end--------------->8---

These two packages are leaves, so it’s fine to change them to use the
fixed ‘file’.  Done in 351d690.

> Finally, 'file' is a propagated-input for 'intltool', which means that
> if anyone installs 'intltool' in their profile, they will have the buggy
> 'file' in their PATH.

This one is more problematic.  We can try to apply Eric’s patch, but
that’s a lot of rebuild.

Thanks for the analysis,
Ludo’.

      parent reply	other threads:[~2014-11-13 20:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13 10:41 Handling ‘file’ CVE Ludovic Courtès
2014-11-13 13:00 ` Andreas Enge
2014-11-13 13:17   ` Ludovic Courtès
2014-11-13 16:54 ` Ludovic Courtès
2014-11-13 18:03   ` Mark H Weaver
2014-11-13 18:47     ` Eric Bavier
2014-11-13 20:13       ` Ludovic Courtès
2014-11-13 20:42         ` Eric Bavier
2014-11-13 20:43     ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zjbu4ysn.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=mhw@netris.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.