Bug 13776 - sysvinit reproducibility issue (shutdown user leakage)
Summary: sysvinit reproducibility issue (shutdown user leakage)
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 3.0
Hardware: x86 Multiple
: High normal
Target Milestone: 3.1 M3
Assignee: Richard Purdie
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2020-02-03 12:27 UTC by Richard Purdie
Modified: 2020-02-08 13:48 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Purdie 2020-02-03 12:27:03 UTC
Appears the presence of the shutdown user on the host is changing the target package?

--- oe-reproducible-20200203-65bgspxp/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/build-st-14939/reproducibleA/tmp/deploy/deb/core2-64/sysvinit_2.96-r0_amd64.deb
+++ oe-reproducible-20200203-65bgspxp/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/build-st-14939/reproducibleB/tmp/deploy/deb/core2-64/sysvinit_2.96-r0_amd64.deb
├── file list
│ @@ -1,3 +1,3 @@
│  -rw-r--r--   0        0        0        4 2019-09-11 17:43:12.000000 debian-binary
│  -rw-r--r--   0        0        0      872 2019-09-11 17:43:12.000000 control.tar.xz
│ --rw-r--r--   0        0        0   174364 2019-09-11 17:43:12.000000 data.tar.xz
│ +-rw-r--r--   0        0        0   174448 2019-09-11 17:43:12.000000 data.tar.xz
├── data.tar.xz
│ ├── data.tar
│ │ ├── file list
│ │ │ @@ -17,18 +17,18 @@
│ │ │  drwxr-xr-x   0 root         (0) root         (0)        0 2019-09-11 17:43:12.000000 ./etc/rc4.d/
│ │ │  drwxr-xr-x   0 root         (0) root         (0)        0 2019-09-11 17:43:12.000000 ./etc/rc5.d/
│ │ │  drwxr-xr-x   0 root         (0) root         (0)        0 2019-09-11 17:43:12.000000 ./etc/rc6.d/
│ │ │  drwxr-xr-x   0 root         (0) root         (0)        0 2019-09-11 17:43:12.000000 ./etc/rcS.d/
│ │ │  drwxr-xr-x   0 root         (0) root         (0)        0 2019-09-11 17:43:12.000000 ./sbin/
│ │ │  -rwxr-xr-x   0 root         (0) root         (0)    60952 2019-09-11 17:43:12.000000 ./sbin/bootlogd
│ │ │  -rwxr-xr-x   0 root         (0) root         (0)    25768 2019-09-11 17:43:12.000000 ./sbin/fstab-decode
│ │ │ --rwsr-xr--   0 root         (0)        0    76976 2019-09-11 17:43:12.000000 ./sbin/halt.sysvinit
│ │ │ +-rwsr-xr--   0 root         (0) shutdown     (0)    76976 2019-09-11 17:43:12.000000 ./sbin/halt.sysvinit
│ │ │  -rwxr-xr-x   0 root         (0) root         (0)   168840 2019-09-11 17:43:12.000000 ./sbin/init.sysvinit
│ │ │  -rwxr-xr-x   0 root         (0) root         (0)    28752 2019-09-11 17:43:12.000000 ./sbin/runlevel.sysvinit
│ │ │ --rwsr-xr--   0 root         (0)        0   105032 2019-09-11 17:43:12.000000 ./sbin/shutdown.sysvinit
│ │ │ +-rwsr-xr--   0 root         (0) shutdown     (0)   105032 2019-09-11 17:43:12.000000 ./sbin/shutdown.sysvinit
│ │ │  drwxr-xr-x   0 root         (0) root         (0)        0 2019-09-11 17:43:12.000000 ./usr/
│ │ │  drwxr-xr-x   0 root         (0) root         (0)        0 2019-09-11 17:43:12.000000 ./usr/bin/
│ │ │  -rwxr-xr-x   0 root         (0) root         (0)    72896 2019-09-11 17:43:12.000000 ./usr/bin/last.sysvinit
│ │ │  -rwxr-xr-x   0 root         (0) root         (0)    28760 2019-09-11 17:43:12.000000 ./usr/bin/mesg.sysvinit
│ │ │  -rwxr-xr-x   0 root         (0) root         (0)    30080 2019-09-11 17:43:12.000000 ./usr/bin/readbootlog
│ │ │  -rwxr-xr-x   0 root         (0) root         (0)    43192 2019-09-11 17:43:12.000000 ./usr/bin/utmpdump.sysvinit
│ │ │  -rwxr-xr-x   0 root         (0) root         (0)    51512 2019-09-11 17:43:12.000000 ./usr/bin/wall.sysvinit
Comment 1 Richard Purdie 2020-02-05 16:29:32 UTC
Extra data so far:
* This group ownership is performed in the recipe's do_install. 
* The shutdown group is defined in etc/group in base-passwd's group file. 
* There is a DEPENDS on base-passwd.
Comment 2 Randy MacLeod 2020-02-06 15:56:19 UTC
If we could create a QA test to make the build fail then we can run that in master-next.
Comment 3 Richard Purdie 2020-02-07 14:11:19 UTC
I found how to reproduce:

bitbake sysvinit
bitbake sysvinit -c clean
bitbake sysvinit -c package_write_ipk -f

which changes the sysvinit package from having two files with owner/group "root/shutdown" to "root/70".

The reason is the base-passwd files are not restored to the sysroot when do_package is setscened so there is no information to resolve "70" to a name whe building the ipk.
Comment 4 Richard Purdie 2020-02-07 14:34:14 UTC
I think adding do_package_setscene[depends] = "base-passwd:do_populate_sysroot" to the recipe fixes this. This does have wider implications unfortunately.