Upgrading samba to latest security fixes together with winbind in nsswitch.conf can harm entire OS
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
samba (Debian) |
Fix Released
|
Unknown
|
|||
samba (Ubuntu) |
Fix Released
|
High
|
Jorge Niedbalski | ||
Trusty |
Fix Released
|
High
|
Jorge Niedbalski | ||
Xenial |
Fix Committed
|
High
|
Jorge Niedbalski | ||
Yakkety |
Fix Committed
|
High
|
Jorge Niedbalski | ||
Bionic |
Triaged
|
Undecided
|
Unassigned | ||
Focal |
Triaged
|
Undecided
|
Unassigned |
Bug Description
[Impact]
* Upgrading samba when using winbind as NSS service can break OS.
* Probably not triggered if "compat" is BEFORE "winbind" in nsswitch.conf.
* Huge impact due to big version different between winbind and libraries.
[Test Case 1]
Verify that the regression reported in bug 1644428 has not recurred.
[Test Case 2]
1) Start an ubuntu Trusty container
2) cp /etc/apt/
3) Disable the trusty-updates and trusty-security archives in /etc/apt/
4) sudo apt-get update
5) sudo apt-get install samba winbind libnss-winbind libpam-winbind
6) Set /etc/nsswitch.conf to : passwd: winbind compat
7) Restart the services
7.1) sudo restart smbd
7.2) sudo restart nmbd
7.3) sudo restart winbind
8) cp /etc/apt/
9) sudo apt-get update
7) sudo apt-get install samba winbind libnss-winbind libpam-winbind
While installing, you will see things similar to this :
> Unpacking libnss-
> dpkg-deb: error: subprocess tar was killed by signal (Segmentation fault), core dumped
> dpkg: error processing archive /var/cache/
> -unpack):
> subprocess dpkg-deb --control returned error exit status 2
> dpkg-deb: error: subprocess tar was killed by signal (Segmentation fault), core dumped
[Regression Potential]
* "preinst" and "postrm" maintainer scripts are acting only in "upgrade"
* uninstalling packages and reinstalling would bypass this change
[Other Info]
* Original Bug Description:
It was brought to my attention that, because of latest security fixes for samba:
https:/
samba (2:4.3.
samba (2:4.3.
samba (2:4.1.
when library symbols changed, a samba upgrade MAY jeopardize an entire Ubuntu OS installation IF /etc/nsswitch.conf uses winbind as a service (specially if used before compat mechanism).
----
How to reproduce easily:
$ cat /etc/nsswitch.conf
passwd: winbind compat
shadow: compat
group: winbind compat
(winbind is usually used after compat, in this case it was used before)
to have samba version "4.1.6+
$ sudo apt-get update
and FINALLY:
https:/
Leading into an unusable system in the following state:
https:/
## state
Workaround:
DO REMOVE winbind from /etc/nsswitch.conf (and possibly from pam.d with "pam-auth-update") before ANY attempt of upgrading samba to latest version.
description: | updated |
tags: | added: sts |
description: | updated |
Changed in samba (Ubuntu): | |
status: | Confirmed → In Progress |
tags: | added: patch |
Changed in samba (Ubuntu): | |
assignee: | Rafael David Tinoco (inaddy) → Louis Bouchard (louis-bouchard) |
description: | updated |
Changed in samba (Ubuntu): | |
assignee: | Louis Bouchard (louis-bouchard) → Jorge Niedbalski (niedbalski) |
Changed in samba (Debian): | |
status: | Unknown → New |
description: | updated |
Changed in samba (Debian): | |
status: | New → Fix Released |
$ sudo apt-get --only-upgrade install samba dsdb-modules samba-libs samba-vfs-modules winbind dsdb-modules samba-libs samba-vfs-modules winbind us.archive. ubuntu. com/ubuntu/ trusty-updates/main python-ldb amd64 1:1.1.24- 0ubuntu0. 14.04.1 [29.2 kB] us.archive. ubuntu. com/ubuntu/ trusty-updates/main python-tdb amd64 1.3.8-0ubuntu0. 14.04.1 [10.8 kB] us.archive. ubuntu. com/ubuntu/ trusty-updates/main libtdb1 amd64 1.3.8-0ubuntu0. 14.04.1 [38.3 kB] us.archive. ubuntu. com/ubuntu/ trusty-updates/main libtevent0 amd64 0.9.28- 0ubuntu0. 14.04.1 [26.2 kB] us.archive. ubuntu. com/ubuntu/ trusty-updates/main samba-dsdb-modules amd64 2:4.3.9+ dfsg-0ubuntu0. 14.04.1 [219 kB] us.archive. ubuntu. com/ubuntu/ trusty- updates/ universe libnss-winbind amd64 2:4.3.9+ dfsg-0ubuntu0. 14.04.1 [12.6 kB] us.archive. ubuntu. com/ubuntu/ trusty- updates/ universe libpam-winbind amd64 2:4.3.9+ dfsg-0ubuntu0. 14.04.1 [28.2 kB] us.archive. ubuntu. com/ubuntu/ trusty-updates/main winbind amd64 2:4.3.9+ dfsg-0ubuntu0. 14.04.1 [411 kB] us.archive. ubuntu. com/ubuntu/ trusty-updates/main libwbclient0 amd64 2:4.3.9+ dfsg-0ubuntu0. 14.04.1 [30.8 kB] us.archive. ubuntu. com/ubuntu/ trusty-updates/main samba amd64 2:4.3.9+ dfsg-0ubuntu0. 14.04.1 [903 kB] us.archive. ubuntu. com/ubuntu/ trusty-updates/main samba-common-bin amd64 2:4.3.9+ dfsg-0ubuntu0. 14.04.1 [508 kB] us.archive. ubuntu. com/ubuntu/ trusty-updates/main samba-common all 2:4.3.9+ dfsg-0ubuntu0. 14.04.1 [82.9 kB] us.archive. ubuntu. com/ubuntu/ trusty-updates/main python-samba amd64 2:4.3.9+ dfsg-0ubuntu0. 14.04.1 [1,068 kB] us.archive. ubuntu. com/ubuntu/ trusty-updates/main samba-vfs-modules amd64 2:4.3.9+ dfsg-0ubuntu0. 14.04.1 [259 kB] us.archive. ubuntu. com/ubuntu/ trusty-updates/main samba-libs amd64 2:4.3.9+ dfsg-0ubuntu0. 14.04.1 [5,144 kB] us.archive. ubuntu. com/ubuntu/ trusty-updates/main libldb1 amd64 1:1.1.24- 0ubuntu0. 14.04.1 [107 kB] ldb_1%3a1. 1.24-0ubuntu0. 14.04.. ..
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libhdb9-heimdal libkdc2-heimdal libntdb1 python-ntdb
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libldb1 libnss-winbind libpam-winbind libtdb1 libtevent0 libwbclient0
python-ldb python-samba python-tdb samba-common samba-common-bin
samba-
Suggested packages:
bind9 bind9utils ldb-tools smbldap-tools heimdal-clients
The following packages will be upgraded:
libldb1 libnss-winbind libpam-winbind libtdb1 libtevent0 libwbclient0
python-ldb python-samba python-tdb samba samba-common samba-common-bin
samba-
16 upgraded, 0 newly installed, 0 to remove and 219 not upgraded.
Need to get 8,877 kB of archives.
After this operation, 5,632 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://
Get:2 http://
Get:3 http://
Get:4 http://
Get:5 http://
Get:6 http://
Get:7 http://
Get:8 http://
Get:9 http://
Get:10 http://
Get:11 http://
Get:12 http://
Get:13 http://
Get:14 http://
Get:15 http://
Get:16 http://
Fetched 8,877 kB in 14s (594 kB/s)
Preconfiguring packages ...
(Reading database ... 115393 files and directories currently installed.)
Preparing to unpack .../python-