Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package mcstrans for openSUSE:Factory checked in at 2026-12-05 19:09:56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/mcstrans (Old) and /work/SRC/openSUSE:Factory/.mcstrans.new.1340718 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "mcstrans" Sat Dec 5 19:09:56 2026 rev:43 rq:1402968 version:3.12 Changes: -------- --- /work/SRC/openSUSE:Factory/mcstrans/mcstrans.changes 2026-07-13 14:25:39.190465344 +0200 +++ /work/SRC/openSUSE:Factory/.mcstrans.new.1340718/mcstrans.changes 2026-12-05 19:11:26.145781240 +0100 @@ -1,0 +2,25 @@ +Thu Dec 3 09:00:36 UTC 2026 - Cathy Hu <[email protected]> + +- Update to version 3.12 + https://github.com/SELinuxProject/selinux/releases/tag/v3.12 + - Security/hardening changes: + - Hardened sandbox, newrole, restorecond and mcstrans handling of + commands, temporary files, signals and configuration data, including + constant-time comparison of shadow password hashes in newrole, bounded + Include nesting depth in mcstrans, a hardened mcstrans systemd service + file, and use of openat2() where available in sandbox/seunshare, + restorecond and selinux_restorecon(3). + - Notable bug fixes: + - mcstrans: defer SIGTERM cleanup to the main loop + - mcstrans: fix inverted alias skip check in compute_trans_from_raw() + - mcstrans: escape config text spliced into build_regexps() patterns +- Drop harden_mcstrans.service.patch, the hardening options are upstream now + (ExecStart=/sbin/mcstransd works through the /sbin -> usr/sbin symlink) +- Source URLs: upstream tags are prefixed with "v" now + +------------------------------------------------------------------- +Wed Dec 2 13:07:50 UTC 2026 - Cathy Hu <[email protected]> + +- keyring: update bachradsusi.gpg for next release + +-------------------------------------------------------------------- Old: ---- harden_mcstrans.service.patch mcstrans-3.11.tar.gz mcstrans-3.11.tar.gz.asc New: ---- mcstrans-3.12.tar.gz mcstrans-3.12.tar.gz.asc ----------(Old B)---------- Old: - mcstrans: escape config text spliced into build_regexps() patterns - Drop harden_mcstrans.service.patch, the hardening options are upstream now (ExecStart=/sbin/mcstransd works through the /sbin -> usr/sbin symlink) ----------(Old E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mcstrans.spec ++++++ --- /var/tmp/diff_new_pack.6JlArD/_old 2026-12-05 19:11:27.003817400 +0100 +++ /var/tmp/diff_new_pack.6JlArD/_new 2026-12-05 19:11:27.004817442 +0100 @@ -17,16 +17,15 @@ Name: mcstrans -Version: 3.11 +Version: 3.12 Release: 0 Summary: SELinux Translation Daemon License: GPL-2.0-or-later Group: System/Management URL: https://github.com/SELinuxProject/selinux/wiki -Source0: https://github.com/SELinuxProject/selinux/releases/download/%{version}/%{name}-%{version}.tar.gz -Source1: https://github.com/SELinuxProject/selinux/releases/download/%{version}/%{name}-%{version}.tar.gz.asc +Source0: https://github.com/SELinuxProject/selinux/releases/download/v%{version}/%{name}-%{version}.tar.gz +Source1: https://github.com/SELinuxProject/selinux/releases/download/v%{version}/%{name}-%{version}.tar.gz.asc Source2: mcstrans.keyring -Patch2: harden_mcstrans.service.patch BuildRequires: aaa_base BuildRequires: libcap-devel BuildRequires: libselinux-devel >= 1.30.3 @@ -53,7 +52,6 @@ %prep %setup -q -%patch -P2 -p1 %build export CFLAGS="%{optflags}" ++++++ mcstrans-3.11.tar.gz -> mcstrans-3.12.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcstrans-3.11/VERSION new/mcstrans-3.12/VERSION --- old/mcstrans-3.11/VERSION 2026-07-01 18:51:05.000000000 +0200 +++ new/mcstrans-3.12/VERSION 2026-12-02 18:39:01.000000000 +0100 @@ -1 +1 @@ -3.11 +3.12 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcstrans-3.11/man/man5/setrans.conf.5 new/mcstrans-3.12/man/man5/setrans.conf.5 --- old/mcstrans-3.11/man/man5/setrans.conf.5 2026-07-01 18:51:05.000000000 +0200 +++ new/mcstrans-3.12/man/man5/setrans.conf.5 2026-12-02 18:39:01.000000000 +0100 @@ -4,7 +4,7 @@ .SH "DESCRIPTION" The -.I /etc/selinux/{SELINUXTYPE}/setrans.conf +.I {/etc,/usr/lib}/selinux/{SELINUXTYPE}/setrans.conf configuration file specifies the way that SELinux MCS/MLS labels are translated into human readable form by the mcstransd daemon. The default policies support 16 sensitivity levels (s0 through s15) and 1024 categories (c0 through c1023). Multiple categories can be separated with commas (c0,c1,c3,c5) and a range of categories can be shortened using dot notation (c0.c3,c5). @@ -101,6 +101,14 @@ selinux(8), mcs(8), mls(8), chcon(1) .SH "FILES" -/etc/selinux/{SELINUXTYPE}/setrans.conf -.br -/usr/share/mcstrans/examples +.TP +.I /etc/selinux/{SELINUXTYPE}/setrans.conf +.TP +.I /usr/lib/selinux/{SELINUXTYPE}/setrans.conf +The SELinux context translation configuration file. The file in +.B /etc +overrides the default configuration provided by the vendor in +.BR /usr/lib . +.TP +.I /usr/share/mcstrans/examples +Other examples of SELinux context translation configurations. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcstrans-3.11/man/man8/mcs.8 new/mcstrans-3.12/man/man8/mcs.8 --- old/mcstrans-3.11/man/man8/mcs.8 2026-07-01 18:51:05.000000000 +0200 +++ new/mcstrans-3.12/man/man8/mcs.8 2026-12-02 18:39:01.000000000 +0100 @@ -15,7 +15,8 @@ The -.I /etc/selinux/{SELINUXTYPE}/setrans.conf configuration file translates the labels on disk to human +.I {/etc,/usr/lib}/selinux/{SELINUXTYPE}/setrans.conf +configuration file translates the labels on disk to human readable form. Administrators can define any labels they want in this file. Certain applications like printing and auditing will use these labels to identify the files. By setting a category on a file you will prevent @@ -27,4 +28,11 @@ selinux(8), chcon(1) .SH FILES -/etc/selinux/{SELINUXTYPE}/setrans.conf +.TP +.I /etc/selinux/{SELINUXTYPE}/setrans.conf +.TP +.I /usr/lib/selinux/{SELINUXTYPE}/setrans.conf +The SELinux context translation configuration file. The file in +.B /etc +overrides the default configuration provided by the vendor in +.BR /usr/lib . diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcstrans-3.11/man/man8/mcstransd.8 new/mcstrans-3.12/man/man8/mcstransd.8 --- old/mcstrans-3.11/man/man8/mcstransd.8 2026-07-01 18:51:05.000000000 +0200 +++ new/mcstrans-3.12/man/man8/mcstransd.8 2026-12-02 18:39:01.000000000 +0100 @@ -11,7 +11,10 @@ .BR mcstransd program. .P -This daemon reads /etc/selinux/{SELINUXTYPE}/setrans.conf configuration file, and communicates with libselinux via a socket in /var/run/setrans. +This daemon reads the +.I {/etc,/usr/lib}/selinux/{SELINUXTYPE}/setrans.conf +configuration file, and communicates with libselinux via a socket in +.IR /var/run/setrans . .SH "OPTIONS" .TP \-f @@ -26,7 +29,13 @@ The program was enhanced/rewritten by Joe Nall <[email protected]>. .SH "FILES" -/etc/selinux/{SELINUXTYPE}/setrans.conf - +.TP +.I /etc/selinux/{SELINUXTYPE}/setrans.conf +.TP +.I /usr/lib/selinux/{SELINUXTYPE}/setrans.conf +The SELinux context translation configuration file. The file in +.B /etc +overrides the default configuration provided by the vendor in +.BR /usr/lib . .SH "SEE ALSO" .BR setrans.conf (5), mcs (8) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcstrans-3.11/src/mcscolor.c new/mcstrans-3.12/src/mcscolor.c --- old/mcstrans-3.11/src/mcscolor.c 2026-07-01 18:51:05.000000000 +0200 +++ new/mcstrans-3.12/src/mcscolor.c 2026-12-02 18:39:01.000000000 +0100 @@ -225,7 +225,7 @@ May modify the data pointed to by the buffer parameter */ static int process_color(char *buffer, int line) { - char rule[10], pat[256], f[256], b[256]; + char rule[10], pat[4096], f[256], b[256]; uint32_t i, fg, bg; int ret; @@ -234,7 +234,7 @@ if (buffer[0] == '#' || buffer[0] == '\0') return 0; - ret = sscanf(buffer, "%8s %255s = %255s %255s", rule, pat, f, b); + ret = sscanf(buffer, "%8s %4095s = %255s %255s", rule, pat, f, b); if (ret == 4) { if (find_mnemonic(f, &fg) == 0 && find_mnemonic(b, &bg) == 0) for (i = 0; i < N_COLOR; i++) @@ -263,9 +263,14 @@ if (getcon(&my_context) < 0) return 1; - cfg = fopen(selinux_colors_path(), "r"); - if (!cfg) + int fd = selinux_policy_open(selinux_colors_path(), O_RDONLY); + if (fd < 0) return 1; + cfg = fdopen(fd, "r"); + if (!cfg) { + close(fd); + return 1; + } __fsetlocking(cfg, FSETLOCKING_BYCALLER); while (getline(&buffer, &size, cfg) > 0) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcstrans-3.11/src/mcstrans.c new/mcstrans-3.12/src/mcstrans.c --- old/mcstrans-3.11/src/mcstrans.c 2026-07-01 18:51:05.000000000 +0200 +++ new/mcstrans-3.12/src/mcstrans.c 2026-12-02 18:39:01.000000000 +0100 @@ -911,16 +911,30 @@ int read_translations(const char *filename) { + static unsigned int depth; size_t size = 0; char *buffer = NULL; int rval = 0; - FILE *cfg = fopen(filename, "r"); + if (depth >= 32) { + syslog(LOG_ERR, "%s: Include nesting too deep", filename); + return -1; + } + + int fd = selinux_policy_open(filename, O_RDONLY); + if (fd < 0) { + syslog(LOG_ERR, "%s file open failed", filename); + return -1; + } + + FILE *cfg = fdopen(fd, "r"); if (!cfg) { syslog(LOG_ERR, "%s file open failed", filename); + close(fd); return -1; } + depth++; __fsetlocking(cfg, FSETLOCKING_BYCALLER); while (getline(&buffer, &size, cfg) > 0) { if (process_trans(buffer) < 0) { @@ -931,6 +945,7 @@ } free(buffer); fclose(cfg); + depth--; return rval; } @@ -1066,6 +1081,32 @@ return 0; } +/* + * Append s with PCRE metacharacters backslash-escaped so it matches + * literally. Used for config-supplied label/word/affix/whitespace + * text spliced into the alternation patterns in build_regexps(). + * Works both inside and outside a character class. + */ +static int buf_append_literal(char **buf, size_t *cap, size_t *len, + const char *s) +{ + char esc[3] = { '\\', 0, 0 }; + char lit[2] = { 0, 0 }; + + for (; *s; s++) { + if (strchr("\\^$.|?*+()[]{}-", *s)) { + esc[1] = *s; + if (buf_append(buf, cap, len, esc)) + return -1; + } else { + lit[0] = *s; + if (buf_append(buf, cap, len, lit)) + return -1; + } + } + return 0; +} + static void build_regexp(pcre2_code **r, char *buffer) { int error; @@ -1098,6 +1139,11 @@ if (buf_append(&buffer, &cap, &len, (s))) \ goto err; \ } while (0) +#define APPEND_LIT(s) \ + do { \ + if (buf_append_literal(&buffer, &cap, &len, (s))) \ + goto err; \ + } while (0) #define RESET() \ do { \ len = 0; \ @@ -1125,7 +1171,7 @@ qsort(sortable, n_el, sizeof(char *), string_size); for (i = 0; i < n_el; i++) { - APPEND(sortable[i]); + APPEND_LIT(sortable[i]); if (i != (n_el - 1)) APPEND("|"); } @@ -1141,7 +1187,7 @@ if (g->prefixes) { APPEND("(?:"); for (a = g->prefixes; a; a = a->next) { - APPEND(a->text); + APPEND_LIT(a->text); if (a->next) APPEND("|"); } @@ -1177,13 +1223,13 @@ if (i) APPEND("|"); APPEND("\\b"); - APPEND(g->sword[i]->text); + APPEND_LIT(g->sword[i]->text); APPEND("\\b"); } if (g->whitespace) { APPEND("|["); - APPEND(g->whitespace); + APPEND_LIT(g->whitespace); APPEND("]+"); } @@ -1200,7 +1246,7 @@ APPEND("[ ]+"); APPEND("(?:"); for (a = g->suffixes; a; a = a->next) { - APPEND(a->text); + APPEND_LIT(a->text); if (a->next) APPEND("|"); } @@ -1219,6 +1265,7 @@ free(buffer); return -1; #undef APPEND +#undef APPEND_LIT #undef RESET } @@ -1277,7 +1324,7 @@ match, strlen(match)); base_classification_t *bc; for (bc = domain->base_classifications; bc; bc = bc->next) { - if (!strcmp(bc->trans, match)) { + if (!strcasecmp(bc->trans, match)) { log_debug( " compute_raw_from_trans base classification %s matched %s\n", level, bc->trans); @@ -1435,7 +1482,7 @@ int wlen = strlen( w->text); if (plen >= wlen && - !strncmp( + !strncasecmp( w->text, p, strlen(w->text))) { @@ -1615,8 +1662,7 @@ if (l->sens == bc->level->sens) { /* skip if alias of last bc */ if (last && last->level->sens == bc->level->sens && - ebitmap_cmp(&last->level->cat, &bc->level->cat) == - 0) + ebitmap_cmp(&last->level->cat, &bc->level->cat)) continue; /* compute bits not consumed by base classification */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcstrans-3.11/src/mcstrans.service new/mcstrans-3.12/src/mcstrans.service --- old/mcstrans-3.11/src/mcstrans.service 2026-07-01 18:51:05.000000000 +0200 +++ new/mcstrans-3.12/src/mcstrans.service 2026-12-02 18:39:01.000000000 +0100 @@ -7,6 +7,13 @@ Conflicts=shutdown.target [Service] +ProtectHostname=true +ProtectClock=true +ProtectKernelTunables=true +ProtectKernelModules=true +ProtectKernelLogs=true +ProtectControlGroups=true +RestrictRealtime=true ExecStart=/sbin/mcstransd -f RuntimeDirectory=setrans RuntimeDirectoryPreserve=true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mcstrans-3.11/src/mcstransd.c new/mcstrans-3.12/src/mcstransd.c --- old/mcstrans-3.11/src/mcstransd.c 2026-07-01 18:51:05.000000000 +0200 +++ new/mcstrans-3.12/src/mcstransd.c 2026-12-02 18:39:01.000000000 +0100 @@ -58,6 +58,7 @@ static int sockfd = -1; /* socket we are listening on */ static volatile sig_atomic_t restart_daemon = false; +static volatile sig_atomic_t terminate = false; static void cleanup_exit(int ret) __attribute__((noreturn)); static void cleanup_exit(int ret) { @@ -407,6 +408,10 @@ ufds[0].revents = 0; while (1) { + if (terminate) { + free(ufds); + cleanup_exit(0); + } if (restart_daemon) { syslog(LOG_NOTICE, "Reload Translations"); finish_context_colors(); @@ -442,11 +447,9 @@ } } -static void sigterm_handler(int sig) __attribute__((noreturn)); - static void sigterm_handler(int UNUSED(sig)) { - cleanup_exit(0); + terminate = true; } static void sighup_handler(int UNUSED(sig)) ++++++ mcstrans.keyring ++++++ ++++ 626 lines (skipped) ++++ between mcstrans.keyring ++++ and /work/SRC/openSUSE:Factory/.mcstrans.new.1340718/mcstrans.keyring
