Commit Graph

1002 Commits

Author SHA1 Message Date
Changqing Li
de19386222 recipes: WORKDIR -> UNPACKDIR transition
* WORKDIR -> UNPACKDIR transition
* Switch away from S = WORKDIR

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Joe MacDonald <joe.macdonald@siemens.com>
2024-06-26 11:09:53 -04:00
Yi Zhao
8784122dde packagegroup-selinux-minimal: add missing runtime dependency selinux-autorelabel
Add selinux-autorelabel to reset the SELinux label on the root
filesystem at boot time.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe.macdonald@siemens.com>
2024-06-26 11:09:53 -04:00
Etienne Cordonnier
90330647da MAINTAINERS: fix description of section entries
Signed-off-by: Etienne Cordonnier <ecordonnier@snap.com>
Signed-off-by: Joe MacDonald <joe.macdonald@siemens.com>
2024-06-26 11:09:53 -04:00
Yi Zhao
769274a8ca refpolicy: update to latest git rev
* 0aff1990e quote: read localization
* ab13c0421 getty: grant checkpoint_restore
* 3643773ae Update SOS report to work on RHEL9
* 523b279bd Setup domain for dbus selinux interface

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe.macdonald@siemens.com>
2024-04-19 20:21:17 -04:00
Yi Zhao
d98d658347 MAINTAINERS: update to new yocto-patches mailing list
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe.macdonald@siemens.com>
2024-04-19 20:21:17 -04:00
Philip Lorenz
5006df6137 busybox: Fix wrapper creation
`PACKAGEBUILDPKGD` was dropped in Yocto 4.2 and
`PACKAGE_PREPROCESS_FUNCS` should be used instead. The only requirement
for wrapper creation is that it is executed before any of the
`update-alternatives` hooks are executed. This continues to hold as the
call to `create_sh_wrapper_reset_alternative_vars` is prepended only
after the `update-alternatives` class has been inherited.

Additionally, this also fixes a race condition leading to
non-deterministic buildhistory entries in busybox's `sysroot` files.
The race condition was caused by the creation of the wrapper files
inside `D` (i.e. the image directory) which is also consumed by other
tasks such as `do_populate_sysroot` which may be executing in parallel
to `do_package`.

Signed-off-by: Philip Lorenz <philip.lorenz@bmw.de>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2024-03-28 10:01:42 -04:00
Joe MacDonald
b1eddc23d6 MAINTAINERS: Update contact email address
Signed-off-by: Joe MacDonald <joe@deserted.net>
2024-03-20 07:33:49 -04:00
Yi Zhao
1d702c31ea layer.conf: update for the scarthgap release series
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2024-03-20 07:32:53 -04:00
Yi Zhao
7fc76cf77b refpolicy: upgrade 20231002+git -> 20240226+git
ChangeLog:
https://github.com/SELinuxProject/refpolicy/blob/main/Changelog

Notable Changes:
  Many systemd updates up to v255
  RPM and dnf fixes
  Tighten private key handling for Apache
  Many container and kubernetes improvements
  Add support for Cilium
  Update object class definitions up to io_uring:cmd
  Add additional rules to cloud-init based on sysadm_t

* Update to latest git rev.
* Refresh patches.
* Add a patch to fix reboot timeout error.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2024-03-12 08:34:35 -04:00
Yi Zhao
4544e817a1 refpolicy: drop ${SRCPV} usage
Drop SRCPV as this variable is no longer needed in PV[1].

[1] https://git.openembedded.org/openembedded-core/commit/?id=a8e7b0f932b9ea69b3a218fca18041676c65aba0

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2024-02-28 07:49:48 -05:00
Yi Zhao
6fcfb3a600 refpolicy: update to latest git rev
Update to latest rev to fix policy for systemd 255.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2024-02-27 12:30:21 -05:00
Yi Zhao
f4f7ef11cd eudev: remove PACKAGECONFIG[selinux]
Drop PACKAGECONFIG[selinux] as it was added to eudev recipe in
oe-core[1].

[1] https://git.openembedded.org/openembedded-core/commit/?id=e6c18c9d9d0e11a6a93cca14dbe622707cf25515

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2024-02-27 12:30:20 -05:00
Yi Zhao
95113a29c7 rpm: remove PACKAGECONFIG[selinux]
Drop PACKAGECONFIG[selinux] as it was added to rpm recipe in oe-core[1].

[1] https://git.openembedded.org/openembedded-core/commit/?id=38549d462b399e3a63335f60a44c8bbced98639a

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2024-02-27 12:30:20 -05:00
Yi Zhao
39a5525a22 libselinux-python: add recipe
We merged libselinux recipe and libselinux-python recipe in commit[1]
because we thought the circular dependency was gone. But unfortunately,
it still exists.

Here are the steps to reproduce:
$ echo "DISTRO_FEATURES:append = \" x11\"" >> conf/local.conf
$ echo "PACKAGECONFIG:append:pn-python3 = \" tk\"" >> conf/local.conf
$ bitbake core-image-selinux -n

So we still need to split the libselinux recipe into two recipes:
libselinux and libselinux-python.

[1] https://git.yoctoproject.org/meta-selinux/commit/?id=62b9c816a5000dc01b28e78213bde26b58cbca9d

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2024-01-24 10:20:31 -05:00
Yi Zhao
7d5dc44b35 setools: upgrade 4.4.3 -> 4.4.4
ChangeLog:
https://github.com/SELinuxProject/setools/releases/tag/4.4.4

* Refresh local patch

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-12-18 11:06:31 -05:00
Yi Zhao
8950bef26c semodule-utils: upgrade 3.5 -> 3.6
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-12-18 11:06:31 -05:00
Yi Zhao
085abdcf42 selinux-sandbox: upgrade 3.5 -> 3.6
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-12-18 11:06:31 -05:00
Yi Zhao
24e994955d selinux-gui: upgrade 3.5 -> 3.6
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-12-18 11:06:31 -05:00
Yi Zhao
a14ae01ba9 selinux-dbus: upgrade 3.5 -> 3.6
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-12-18 11:06:31 -05:00
Yi Zhao
94ee9d0a42 selinux-python: upgrade 3.5 -> 3.6
* Refresh patch

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-12-18 11:06:31 -05:00
Yi Zhao
527b6649e9 restorecond: upgrade 3.5 -> 3.6
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-12-18 11:06:31 -05:00
Yi Zhao
5044ef5352 mcstrans: upgrade 3.5 -> 3.6
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-12-18 11:06:31 -05:00
Yi Zhao
72608839b9 policycoreutils: upgrade 3.5 -> 3.6
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-12-18 11:06:31 -05:00
Yi Zhao
28fac29be9 secilc: upgrade 3.5 -> 3.6
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-12-18 11:06:31 -05:00
Yi Zhao
1cde561650 checkpolicy: upgrade 3.5 -> 3.6
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-12-18 11:06:31 -05:00
Yi Zhao
6bd4f3c633 libsemanage: upgrade 3.5 -> 3.6
* Refresh patches

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-12-18 11:06:30 -05:00
Yi Zhao
62b9c816a5 libselinux: upgrade 3.5 -> 3.6
* Refresh patches.
* Merge libselinux and libselinux-python.
  The previous libselinux recipe was split into libselinux and
  libselinux-python due to loop dependency[1]. Now this error is gone,
  we can merge these two recipes into one again.

[1] https://git.yoctoproject.org/meta-selinux/commit/?id=7bb1507928f2e0f54ff8eac4135e15e821cdb1e2

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-12-18 11:06:30 -05:00
Yi Zhao
1b43d4d921 PATCH 02/15] libsepol: upgrade 3.5 -> 3.6
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-12-18 11:06:30 -05:00
Yi Zhao
55c246a112 selinux: upgrade 3.5 -> 3.6
ChangeLog:
https://github.com/SELinuxProject/selinux/releases/tag/3.6

* Switch branch to main

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-12-18 11:06:30 -05:00
Yi Zhao
3fb3324540 refpolicy: fix login errors after enabling systemd DynamicUser
After oe-ocre commit ba3a78c0[1], domains using PAM need to read
/etc/shadow.

[1] https://git.openembedded.org/openembedded-core/commit/?id=ba3a78c08cb0ce08afde049610d3172b9e3b0695

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-12-14 10:23:31 -05:00
Yi Zhao
fd039518bd refpolicy: update to latest git rev
* 82b4448e1 Additional file context fix for:
* 65eed16b5 policy/modules/services/smartmon.te: make fstools optional
* 2e27be3c5 Let the certmonger module manage SSL Private Keys and CSR
            used for example by the HTTP and/or Mail Transport daemons.
* 912d3a687 Let the webadm role manage Private Keys and CSR for SSL
            Certificates used by the HTTP daemon.
* 5c9038ec9 Create new TLS Private Keys file contexts for the Apache
            HTTP server according to the default locations:
* b38583a79 The LDAP server only needs to read generic certificate
            files, not manage them.
* 100a853c0 rpm: fixes for dnf
* 8839a7137 Modify the gpg module so that gpg and the gpg_agent can
            manage gpg_runtime_t socket files.
* 780adb80a Simple patch for Brother printer drivers as described in:
	    https://etbe.coker.com.au/2023/10/22/brother-mfc-j4440dw-printer/

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-12-14 10:23:31 -05:00
Yi Zhao
ff95c536a5 README: update
Add how to enable labeling on first boot.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-10-12 10:14:19 -04:00
Yi Zhao
e29104086e selinux-autorelabel: enable labeling during build
Previously, system using systemd would label selinux contexts on first
boot. While system using sysvinit would label during build. Add a
variable FIRST_BOOT_RELABEL as a switch to control labeling to make the
behavior of sysvinit and systemd consistent.

Set FIRST_BOOT_RELABEL to 1 in local.conf to enable labeling on first
boot.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-10-12 10:14:19 -04:00
Yi Zhao
46ec0414b4 selinux-image.bbclass: refactor bbclass
The selinux_set_labels function should run as late as possible. To
guarantee that, we append it to IMAGE_PREPROCESS_COMMAND in
RecipePreFinalise event handler, this ensures it is the last function in
IMAGE_PREPROCESS_COMMAND.

After refactoring, system using systemd can also label selinux contexts
during build.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-10-12 10:14:19 -04:00
Yi Zhao
ce049565e1 layer.conf: update LAYERSERIES_COMPAT for nanbield
oe-core has switched to nanbield in:
https://git.openembedded.org/openembedded-core/commit/?id=f212cb12a0db9c9de5afd3cc89b1331d386e55f6

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-10-12 10:14:19 -04:00
Yi Zhao
0d58268e29 refpolicy: upgrade 20221101+git -> 20231002+git
* Switch branch to main.
* Update to latest git rev.
* Drop obsolete and useless patches.
* Refresh patches.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-10-12 10:14:19 -04:00
Yi Zhao
e44d4ff853 libselinux-python: fix build with musl
libselinux-python also requires the patch which provided by [1] to fix
build with musl.

[1] https://git.yoctoproject.org/meta-selinux/commit/?id=23d8e2d86317170c0a3c155640c71b83329ff726

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-09-05 14:36:06 -04:00
Yi Zhao
2ff4de94fd linux-yocto: drop CONFIG_SECURITY_SELINUX_DISABLE
CONFIG_SECURITY_SELINUX_DISABLE has been removed since kernel 6.4[1][2].

[1] https://github.com/SELinuxProject/selinux-kernel/wiki/DEPRECATE-runtime-disable
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f22f9aaf6c3d92ebd5ad9e67acc03afebaaeb289

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-09-05 14:36:06 -04:00
Yi Zhao
dea065096b selinux-python: add python3-distro and binutils to RDEPENDS
Add python3-distro and binutils to RDEPENDS for sepolicy to fix runtime
error:

$ sepolicy -h
Traceback (most recent call last):
  File "/usr/bin/sepolicy", line 690, in <module>
    gen_manpage_args(subparsers)
  File "/usr/bin/sepolicy", line 375, in gen_manpage_args
    man.add_argument("-o", "--os", dest="os", default=get_os_version(),

  File "/usr/lib/python3.11/site-packages/sepolicy/__init__.py", line 1245, in get_os_version
    import distro
ModuleNotFoundError: No module named 'distro'

$ sepolicy generate --init /usr/sbin/sshd
/bin/sh: line 1: nm: command not found

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-09-05 14:36:06 -04:00
Yi Zhao
5933e66507 setools: upgrade 4.4.2 -> 4.4.3
ChangeLog:
https://github.com/SELinuxProject/setools/releases/tag/4.4.3

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-08-08 10:34:54 -04:00
Renato Caldas
23d8e2d863 libselinux: fix compilation with musl
Signed-off-by: Renato Caldas <renato@calgera.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-07-31 15:08:04 -04:00
schitrod=cisco.com@lists.yoctoproject.org
bd3902cb93 selinux: Set CVE_PRODUCT
The CVE product name for selinux-* package is (usually) the selinux
(and not our recipe name), so use selinux as the default.

See also:
http://lists.openembedded.org/pipermail/openembedded-core/2017-July/139897.html

"Results from cve-check are not very good at the moment.
One of the reasons for this is that component names used in CVE
database differ from yocto recipe names. This series fixes several
of those name mapping problems by setting the CVE_PRODUCT correctly
in the recipes. To check this mapping with after a build, I'm exporting
LICENSE and CVE_PRODUCT variables to buildhistory for recipes and
packages."

Value added is based on:
https://nvd.nist.gov/vuln/search/results?results_type=overview&search_type=all&cpe_product=cpe%3A%2F%3Akernel%3Aselinux

Signed-off-by: Sanjay Chitroda <schitrod@cisco.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-05-31 09:43:14 -04:00
Yi Zhao
47858343ed linux-yocto: drop CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE
CONFIG_SECURITY_SELINUX_CHECKREQPROT_VALUE is deprecated and will be
rejected in a future kernel release[1].

[1] https://github.com/SELinuxProject/selinux-kernel/wiki/DEPRECATE-checkreqprot

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-04-30 21:33:46 -04:00
Yi Zhao
0c8af77822 setools: upgrade 4.1 -> 4.2
ChangeLog:
https://github.com/SELinuxProject/setools/releases/tag/4.4.2

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-04-30 21:33:46 -04:00
Yi Zhao
c370b82cde semodule-utils: upgrade 3.4 -> 3.5
License-Update: Rename COPYING to LICENSE. No content changes.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-03-27 09:34:02 -04:00
Yi Zhao
4da226c5c5 selinux-sandbox: upgrade 3.4 -> 3.5
License-Update: Rename COPYING to LICENSE. No content changes.

* Drop backport patch.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-03-27 09:34:02 -04:00
Yi Zhao
06ea8425ae selinux-gui: upgrade 3.4 -> 3.5
License-Update: Rename COPYING to LICENSE. No content changes.

* Drop backport patch.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-03-27 09:34:02 -04:00
Yi Zhao
64be33c89e selinux-dbus: upgrade 3.4 -> 3.5
License-Update: Rename COPYING to LICENSE. No content changes.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-03-27 09:34:02 -04:00
Yi Zhao
ff424dc4cf selinux-python: upgrade 3.4 -> 3.5
License-Update: Rename COPYING to LICENSE. No content changes.

* Refresh patch.
* Drop backport patch.
* Add dependency python3-setuptools-scm-native to fix build error.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-03-27 09:34:02 -04:00
Yi Zhao
1f4cefc882 restorecond: upgrade 3.4 -> 3.5
License-Update: Rename COPYING to LICENSE. No content changes.

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2023-03-27 09:34:02 -04:00