Files
rpi-buildroot/package/mupdf/mupdf.mk
Raphaël Mélotte 0f4fef076f package/libfreeglut: add upstream security fix for CVE-2024-2425{8, 9}
Fixes the following security issues:

- CVE-2024-24258: freeglut 3.4.0 was discovered to contain a memory leak
via the menuEntry variable in the glutAddSubMenu function.
- CVE-2024-24259: freeglut through 3.4.0 was discovered to contain a
memory leak via the menuEntry variable in the glutAddMenuEntry
function.

https://nvd.nist.gov/vuln/detail/CVE-2024-24258
https://nvd.nist.gov/vuln/detail/CVE-2024-24259

The CVEs are not technically reported for the libfreeglut package
itself (which doesn't have a CPE identifier) but for mupdf.

Note that mudpf provides its own (old) version of freeglut, but our
mupdf package uses the Buildroot-provided freeglut (which now contains
the fix).

It also has to be noted that a more recent release of libfreeglut
exists upstream, and it fixes the same CVEs.  Bumping our package
version however requires more work that can be done separately.
Including this patch first also has the advantage that it can easily
be backported wherever it's needed.

Signed-off-by: Raphaël Mélotte <raphael.melotte@mind.be>
Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
2025-04-02 21:14:34 +02:00

75 lines
1.9 KiB
Makefile

################################################################################
#
# mudpf
#
################################################################################
# python-pymupdf's version be compatible with mupdf's version
MUPDF_VERSION = 1.23.9
MUPDF_SOURCE = mupdf-$(MUPDF_VERSION)-source.tar.lz
MUPDF_SITE = https://mupdf.com/downloads/archive
MUPDF_LICENSE = AGPL-3.0+
MUPDF_LICENSE_FILES = COPYING
MUPDF_CPE_ID_VENDOR = artifex
MUPDF_INSTALL_STAGING = YES
MUPDF_DEPENDENCIES = \
freetype \
gumbo-parser \
harfbuzz \
host-pkgconf \
jbig2dec jpeg \
lcms2 openjpeg \
zlib
# libfreeglut/0001-Plug-memory-leak-that-happens-upon-error.patch
# Fix is in libfreeglut, but CVE applied to mupdf.
MUPDF_IGNORE_CVES = \
CVE-2024-24258 \
CVE-2024-24259
# mupdf doesn't use CFLAGS and LIBS but XCFLAGS and XLIBS instead.
# with USE_SYSTEM_LIBS it will try to use system libraries instead of the bundled ones.
MUPDF_MAKE_ENV = $(TARGET_MAKE_ENV) $(TARGET_CONFIGURE_OPTS) \
XCFLAGS="$(TARGET_CFLAGS)" \
XLIBS="$(TARGET_LDFLAGS)" \
USE_SYSTEM_LIBS=yes
MUPDF_MAKE_OPTS = \
HAVE_OBJCOPY=no \
prefix="/usr"
ifeq ($(BR2_STATIC_LIBS),y)
MUPDF_MAKE_OPTS += shared=no
else
MUPDF_MAKE_OPTS += shared=yes
endif
ifeq ($(BR2_PACKAGE_XLIB_LIBX11)$(BR2_PACKAGE_XLIB_LIBXEXT),yy)
MUPDF_MAKE_OPTS += HAVE_X11=yes
MUPDF_DEPENDENCIES += xlib_libX11 xlib_libXext
else
MUPDF_MAKE_OPTS += HAVE_X11=no
endif
ifeq ($(BR2_PACKAGE_LIBFREEGLUT),y)
MUPDF_DEPENDENCIES += libfreeglut
else
MUPDF_MAKE_OPTS += HAVE_GLUT=no
endif
define MUPDF_BUILD_CMDS
$(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) $(MUPDF_MAKE_OPTS) all
endef
define MUPDF_INSTALL_STAGING_CMDS
$(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) $(MUPDF_MAKE_OPTS) \
DESTDIR="$(STAGING_DIR)" install-libs
endef
define MUPDF_INSTALL_TARGET_CMDS
$(MUPDF_MAKE_ENV) $(MAKE) -C $(@D) $(MUPDF_MAKE_OPTS) \
DESTDIR="$(TARGET_DIR)" install
endef
$(eval $(generic-package))