all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Leo Famulari <leo@famulari.name>
To: Mark H Weaver <mhw@netris.org>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH] gnu: mupdf: Fix some security problems in bundled mujs.
Date: Fri, 13 Jan 2017 12:34:28 -0500	[thread overview]
Message-ID: <20170113173428.GA27117@jasmine> (raw)
In-Reply-To: <87shonai6b.fsf@netris.org>

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

On Thu, Jan 12, 2017 at 07:59:40PM -0500, Mark H Weaver wrote:
> Leo Famulari <leo@famulari.name> writes:
> > If we can't graft it, we should build it on a branch on Hydra.
> 
> Here's what we can do: in addition to mupdf itself, we can also add a
> graft for cups-filters (our only package that includes mupdf as an
> input).  The replacement for cups-filters would change its mupdf input
> to refer directly to the fixed version of mupdf.
> 
> What do you think?

That's a good idea, and I started implementing it, but then I wondered
how cups-filters was actually using mupdf. The cups-filters package is
only 3.7 MB, while libmupdf.a is 44 MB.

It turns out that the built cups-filters doesn't refer to mupdf at all;
mupdf is not protected from the garbage collector if you install
cups-filters.

I found two source files that use mupdf, 'filter/mupdftoraster.c' and
'filter/pdftops.c'.

From the cups-filters ./configure summary [0]:

------
mutool:          yes
mutool-path:     system
ippfind-path:    system
imagefilters:    yes
jpeg:            yes
pdftocairo-path: system
pdftops:         hybrid
------

The pdftops hybrid mode uses Poppler and Ghostscript, so we're not
affected here:

------
  if (renderer == HYBRID)
  {
    if (make_model[0] &&
        (!strncasecmp(make_model, "Brother", 7) ||
         !strncasecmp(make_model, "Dell", 4) ||
         strcasestr(make_model, "Minolta") ||
         (!strncasecmp(make_model, "Apple", 5) &&
          (ptr = strcasestr(make_model, "LaserWriter")) &&
          (ptr = strcasestr(ptr + 11, "12")) &&
          (ptr = strcasestr(ptr + 2, "640")))))
    {    
      fprintf(stderr, "DEBUG: Switching to Poppler's pdftops instead of Ghostscript for Brother, Minolta, Konica Minolta, Dell, and Apple LaserWriter 12/640 to work around bugs in the printer's PS interpreters\n");
      renderer = PDFTOPS;
    }    
    else 
      renderer = GS;
[...]
------
source:
<http://bzr.linuxfoundation.org/loggerhead/openprinting/cups-filters/annotate/head:/filter/pdftops.c#L467>

'filter/mupdfraster.c' involves the use of the mutool program. Does
the configuration option 'mutool-path: system' mean that it looks for
mutool on PATH?

config.log [1] has:
#define CUPS_MUTOOL "mutool"

And I can't find a store reference for mupdf with `hexdump -C
lib/cups/filter/mupdftoraster`; that's only file that `grep -ri mutool`
matches. 

Should we make cups-filters refer to mutool by an absolute path?

[0]
https://mirror.hydra.gnu.org/log/xlb7k5l3l4gq12z4fmg5i59y5hdzn472-cups-filters-1.13.1

[1]
config.log also has this line:

#define CUPS_POPPLER_PDFTOPS "/usr/bin/pdftops"'

This does get into the built 'lib/cups/filter/pdftops'.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-01-13 17:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-12 18:06 [PATCH] gnu: mupdf: Fix some security problems in bundled mujs Marius Bakke
2017-01-12 18:30 ` Leo Famulari
2017-01-12 19:46   ` Marius Bakke
2017-01-12 20:03     ` Leo Famulari
2017-01-13  0:59       ` Mark H Weaver
2017-01-13 17:34         ` Leo Famulari [this message]
2017-01-15  8:20           ` Mark H Weaver
2017-01-15 18:47         ` Leo Famulari
2017-01-15 19:05           ` Marius Bakke
2017-01-15 20:49             ` Leo Famulari
2017-01-15 20:56               ` Marius Bakke
2017-01-15 23:05               ` Mark H Weaver
2017-01-16  1:27                 ` Leo Famulari

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=20170113173428.GA27117@jasmine \
    --to=leo@famulari.name \
    --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.