Files
buildroot/package/cramfs/cramfs.mk
Thomas Petazzoni 2c96a67d9b package/cramfs: bump to version 2.2
Changes:

Security and robustness release.  Notable cramfsck changes:

  * Reject dirent names containing "/", "." or ".." to close a path
    traversal during `cramfsck -x` (reported in issue #12).
  * Open regular files with O_CREAT|O_EXCL during extraction to
    prevent duplicate-dirent attacks from truncating files reached
    via a previously-extracted symlink.
  * Fix outbuffer NUL termination and a 1-byte overflow in
    do_symlink when running with both -v and -x.
  * Harden romfs_read against truncated/malformed images by
    zero-filling the window buffer and checking lseek/read returns.
  * Reject directory entries that extend past their parent's size.

Documentation: README now documents cramfsck and lists all current
mkcramfs options; stale hard-link and endianness claims corrected;
NOTES trimmed of the 25-year-old Future Development section.

(See https://github.com/npitre/cramfs-tools/releases/tag/v2.2)

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Julien Olivain <ju.o@free.fr>
2026-08-15 12:44:00 +02:00

35 lines
1.1 KiB
Makefile

################################################################################
#
# cramfs
#
################################################################################
CRAMFS_VERSION = 2.2
CRAMFS_SITE = $(call github,npitre,cramfs-tools,v$(CRAMFS_VERSION))
CRAMFS_LICENSE = GPL-2.0+
CRAMFS_LICENSE_FILES = COPYING
CRAMFS_DEPENDENCIES = zlib
HOST_CRAMFS_DEPENDENCIES = host-zlib
define CRAMFS_BUILD_CMDS
$(TARGET_MAKE_ENV) $(MAKE) CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)" -C $(@D)
endef
define CRAMFS_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 755 $(@D)/mkcramfs $(TARGET_DIR)/usr/bin/mkcramfs
$(INSTALL) -D -m 755 $(@D)/cramfsck $(TARGET_DIR)/usr/bin/cramfsck
endef
define HOST_CRAMFS_BUILD_CMDS
$(HOST_MAKE_ENV) $(MAKE) CFLAGS="$(HOST_CFLAGS) -Wall -O2 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64" LDFLAGS="$(HOST_LDFLAGS)" -C $(@D)
endef
define HOST_CRAMFS_INSTALL_CMDS
$(INSTALL) -D -m 755 $(@D)/mkcramfs $(HOST_DIR)/bin/mkcramfs
$(INSTALL) -D -m 755 $(@D)/cramfsck $(HOST_DIR)/bin/cramfsck
endef
$(eval $(generic-package))
$(eval $(host-generic-package))