diff options
| author | Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> | 2026-04-09 14:32:51 +0200 |
|---|---|---|
| committer | Khem Raj <khem.raj@oss.qualcomm.com> | 2026-04-10 07:59:58 -0700 |
| commit | f2c5f3fadc68922d6b5dcb8967fd5de9f785c3ec (patch) | |
| tree | 6f93a26257c0f5a57bd9db641557a7d40377ea89 /meta-oe/recipes-support/libgpiod/libgpiod_2.2.4.bb | |
| parent | ffb7d752ff9dc303169b331ec2d7f7b9885c6612 (diff) | |
| download | meta-openembedded-f2c5f3fadc68922d6b5dcb8967fd5de9f785c3ec.tar.gz | |
libgpiod: update to v2.2.4
Bug-fix release addressing several issues discovered during an
AI-augmented security audit. The most severe bug was found in the C
extension code of the python bindings - which also get an update - but
there were some memory leaks and integer overflow bugs in the core C
library as well as in tools and DBus daemon.
Full changelog:
Bug fixes:
- fix buffer over-read bugs when translating uAPI structs to library types
- fix variable and argument types where necessary
- sanitize values returned by the kernel to avoid potential buffer overflows
- fix memory leaks in gpio-tools
- add missing return value checks in gpio-tools
- fix period parsing in gpio-tools
- use correct loop counter in error path in gpio-manager
Improvements:
- make tests work with newer coreutils by removing cases checking tools'
behavior on SIGINT which stopped working due to changes in behavior of the
timeout tool
Also: drop the patch that's now upstream from the recipe.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
Diffstat (limited to 'meta-oe/recipes-support/libgpiod/libgpiod_2.2.4.bb')
| -rw-r--r-- | meta-oe/recipes-support/libgpiod/libgpiod_2.2.4.bb | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/libgpiod/libgpiod_2.2.4.bb b/meta-oe/recipes-support/libgpiod/libgpiod_2.2.4.bb new file mode 100644 index 0000000000..2c8d9f1873 --- /dev/null +++ b/meta-oe/recipes-support/libgpiod/libgpiod_2.2.4.bb | |||
| @@ -0,0 +1,106 @@ | |||
| 1 | require libgpiod.inc | ||
| 2 | |||
| 3 | inherit systemd update-rc.d useradd gobject-introspection | ||
| 4 | |||
| 5 | LICENSE = "GPL-2.0-or-later & LGPL-2.1-or-later & CC-BY-SA-4.0" | ||
| 6 | LIC_FILES_CHKSUM = " \ | ||
| 7 | file://LICENSES/GPL-2.0-or-later.txt;md5=b234ee4d69f5fce4486a80fdaf4a4263 \ | ||
| 8 | file://LICENSES/LGPL-2.1-or-later.txt;md5=4b54a1fd55a448865a0b32d41598759d \ | ||
| 9 | file://LICENSES/CC-BY-SA-4.0.txt;md5=fba3b94d88bfb9b81369b869a1e9a20f \ | ||
| 10 | " | ||
| 11 | |||
| 12 | FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}-2.x:" | ||
| 13 | |||
| 14 | SRC_URI += " \ | ||
| 15 | file://gpio-manager.init \ | ||
| 16 | " | ||
| 17 | |||
| 18 | SRC_URI[sha256sum] = "13207176b0eb9b3e0f02552d5f49f5a6a449343ce47416158bb484d9d3019592" | ||
| 19 | |||
| 20 | # Enable all project features for ptest | ||
| 21 | PACKAGECONFIG[tests] = " \ | ||
| 22 | --enable-tests --enable-tools --enable-bindings-cxx --enable-bindings-glib --enable-gpioset-interactive --enable-dbus, \ | ||
| 23 | --disable-tests, \ | ||
| 24 | kmod util-linux glib-2.0 catch2 libedit glib-2.0-native libgudev, \ | ||
| 25 | bash ${VIRTUAL-RUNTIME_dbus} glib-2.0-utils libgpiod-manager-cfg shunit2 \ | ||
| 26 | " | ||
| 27 | PACKAGECONFIG[gpioset-interactive] = "--enable-gpioset-interactive,--disable-gpioset-interactive,libedit" | ||
| 28 | PACKAGECONFIG[glib] = "--enable-bindings-glib,--disable-bindings-glib,glib-2.0 glib-2.0-native" | ||
| 29 | PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,glib-2.0 glib-2.0-native libgudev,${VIRTUAL-RUNTIME_dbus}" | ||
| 30 | |||
| 31 | PACKAGES =+ "${PN}-gpiosim ${PN}-glib ${PN}-manager ${PN}-manager-cfg ${PN}-cli" | ||
| 32 | FILES:${PN}-tools += "${bindir}/gpionotify" | ||
| 33 | FILES:${PN}-gpiosim += "${libdir}/libgpiosim.so.*" | ||
| 34 | FILES:${PN}-gpiosim-dev += "${includedir}/gpiosim.h" | ||
| 35 | FILES:${PN}-glib += "${libdir}/libgpiod-glib.so.*" | ||
| 36 | FILES:${PN}-manager += " \ | ||
| 37 | ${bindir}/gpio-manager \ | ||
| 38 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '${systemd_system_unitdir}/gpio-manager.service', '', d)} \ | ||
| 39 | ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', '${sysconfdir}/init.d/gpio-manager', '', d)} \ | ||
| 40 | " | ||
| 41 | FILES:${PN}-manager-cfg += " \ | ||
| 42 | ${sysconfdir}/dbus-1/system.d/io.gpiod1.conf \ | ||
| 43 | ${datadir}/dbus-1/interfaces/io.gpiod1.xml \ | ||
| 44 | ${nonarch_base_libdir}/udev/rules.d/90-gpio.rules \ | ||
| 45 | " | ||
| 46 | FILES:${PN}-cli += "${bindir}/gpiocli" | ||
| 47 | |||
| 48 | RDEPENDS:${PN}-manager += "${VIRTUAL-RUNTIME_dbus} ${PN}-manager-cfg" | ||
| 49 | RDEPENDS:${PN}-cli += "${PN}-manager" | ||
| 50 | |||
| 51 | SYSTEMD_PACKAGES = "${PN}-manager" | ||
| 52 | |||
| 53 | python __anonymous() { | ||
| 54 | distro_features = d.getVar("DISTRO_FEATURES").split() | ||
| 55 | packageconfig = d.getVar("PACKAGECONFIG").split() | ||
| 56 | pn = d.getVar("PN") | ||
| 57 | |||
| 58 | if "systemd" in distro_features and "dbus" in packageconfig: | ||
| 59 | d.appendVar("EXTRA_OECONF", " --enable-systemd") | ||
| 60 | # We need to set it conditionally or else the systemd class will look | ||
| 61 | # for the file that we don't install with systemd support disabled. | ||
| 62 | d.setVar("SYSTEMD_SERVICE:{}-manager".format(pn), "gpio-manager.service") | ||
| 63 | else: | ||
| 64 | d.appendVar("EXTRA_OECONF", " --disable-systemd") | ||
| 65 | |||
| 66 | # Disable gobject introspection set by the bbclass if we don't want it. | ||
| 67 | if not any(cfg in ["glib", "dbus", "ptest"] for cfg in packageconfig): | ||
| 68 | d.setVar("GI_DATA_ENABLED", "False") | ||
| 69 | } | ||
| 70 | |||
| 71 | UPDATERCPN = "${PN}-manager" | ||
| 72 | INITSCRIPT_NAME = "gpio-manager" | ||
| 73 | INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 20 0 1 6 ." | ||
| 74 | |||
| 75 | USERADD_PACKAGES = "${PN}-manager" | ||
| 76 | GROUPADD_PARAM:${PN}-manager = "--system gpio" | ||
| 77 | USERADD_PARAM:${PN}-manager = "--system -M -s /bin/nologin -g gpio gpio-manager" | ||
| 78 | |||
| 79 | RDEPENDS:${PN}-ptest += " \ | ||
| 80 | ${@bb.utils.contains('PTEST_ENABLED', '1', 'shunit2 bash', '', d)} \ | ||
| 81 | " | ||
| 82 | RRECOMMENDS:${PN}-gpiosim += "kernel-module-gpio-sim kernel-module-configfs" | ||
| 83 | INSANE_SKIP:${PN}-ptest += "buildpaths" | ||
| 84 | |||
| 85 | do_compile:prepend() { | ||
| 86 | export GIR_EXTRA_LIBS_PATH="${B}/lib/.libs" | ||
| 87 | } | ||
| 88 | |||
| 89 | do_install:append() { | ||
| 90 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
| 91 | install -d ${D}${sysconfdir}/init.d | ||
| 92 | install -m 0755 ${UNPACKDIR}/gpio-manager.init ${D}${sysconfdir}/init.d/gpio-manager | ||
| 93 | fi | ||
| 94 | } | ||
| 95 | |||
| 96 | do_install_ptest:append() { | ||
| 97 | install -m 0755 ${B}/bindings/cxx/tests/.libs/gpiod-cxx-test ${D}${PTEST_PATH}/tests/ | ||
| 98 | install -m 0755 ${S}/tools/gpio-tools-test.bash ${D}${PTEST_PATH}/tests/ | ||
| 99 | install -m 0644 ${S}/tests/scripts/gpiod-bash-test-helper.inc ${D}${PTEST_PATH}/tests/ | ||
| 100 | install -m 0644 ${S}/tests/gpiosim/gpiosim.h ${D}${includedir}/gpiosim.h | ||
| 101 | install -m 0755 ${B}/bindings/glib/tests/.libs/gpiod-glib-test ${D}${PTEST_PATH}/tests/ | ||
| 102 | install -m 0755 ${B}/dbus/tests/.libs/gpiodbus-test ${D}${PTEST_PATH}/tests/ | ||
| 103 | install -m 0755 ${S}/dbus/client/gpiocli-test.bash ${D}${PTEST_PATH}/tests/ | ||
| 104 | install -m 0755 ${B}/dbus/manager/.libs/gpio-manager ${D}${PTEST_PATH}/tests/ | ||
| 105 | install -m 0755 ${B}/dbus/client/.libs/gpiocli ${D}${PTEST_PATH}/tests/ | ||
| 106 | } | ||
