Autofs parameter substitution broken in kernel 4.4.0-38 and 4.4.0-40

Bug #1629204 reported by Chris van Run
96
This bug affects 15 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Fix Released
High
Seth Forshee
Xenial
Fix Released
High
Seth Forshee
Yakkety
Fix Released
High
Seth Forshee

Bug Description

SRU Justification

Impact: ca6fe3344554 "fs: Call d_automount with the filesystems creds" causes a regression in the requester uid and gid passed to userspace during automount, as the current credentials during automount are those of root and not the user who requested the mount.

Fix: Use current->real_cred instead of current->cred for getting the requester's uid and gid.

Regression Potential: Minimal. current->cred and current->real_cred are the same except when credentials are overridden, thus current->real_cred contains the same credentials that autofs had been using prior to the change which overrides the credentials during automount.

---

Hello,

I have run into a bug relating autofs's parameter substitution (e.g. UID, GID, etc) with kernel versions 4.4.0-38 and proposed 4.4.0-40. Kernel version 4.4.0-28 does things correctly but testing intermediate kernel versions is hard due to earlier bugs related with fs's. Incorrect parameter substitution makes CIFS mounting with variable credentials impossible.

Wat was expected:
$UID in autofs map are substituted by the uid of the user that starts the auto-mounting process.

What actually happens:
Root's uid (0) is substituted instead.

This ill parameter substitution likely caused by recent fixes resolving permissions problems for nfs/cifs mounts and dfs referrals (#1626112 and #1612135). And possibly the fix 'fs: Call d_automount with the filesystems creds' but that is a wild guess.

Furthermore; playing with the force_standard_program_map_env settings in autofs.conf and prefixing variables with 'AUTOFS_' does not solve anything.

Yours kindly,

Chris

---- Additional info ----

  lsb_release -rd
Description: Ubuntu 16.04.1 LTS
Release: 16.04
---
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC0: run00001 3015 F.... pulseaudio
DistroRelease: Ubuntu 16.04
HibernationDevice: RESUME=UUID=f2a2c5c4-2f41-482a-80b4-968a87131214
InstallationDate: Installed on 2016-09-19 (10 days ago)
InstallationMedia: Kubuntu 16.04.1 LTS "Xenial Xerus" - Release amd64 (20160719)
IwConfig:
 enp0s8 no wireless extensions.

 enp0s3 no wireless extensions.

 lo no wireless extensions.
Lsusb:
 Bus 001 Device 002: ID 80ee:0021 VirtualBox USB Tablet
 Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
MachineType: innotek GmbH VirtualBox
Package: linux (not installed)
ProcEnviron:
 LANGUAGE=
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcFB: 0 vboxdrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.4.0-40-generic root=/dev/sda1 ro quiet splash
ProcVersionSignature: Ubuntu 4.4.0-40.60-generic 4.4.21
PulseList:
 Error: command ['pacmd', 'list'] failed with exit code 1: Home directory not accessible: Permission denied
 No PulseAudio daemon running, or not running as session daemon.
RelatedPackageVersions:
 linux-restricted-modules-4.4.0-40-generic N/A
 linux-backports-modules-4.4.0-40-generic N/A
 linux-firmware 1.157.3
RfKill:

Tags: xenial
Uname: Linux 4.4.0-40-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:

_MarkForUpload: True
dmi.bios.date: 12/01/2006
dmi.bios.vendor: innotek GmbH
dmi.bios.version: VirtualBox
dmi.board.name: VirtualBox
dmi.board.vendor: Oracle Corporation
dmi.board.version: 1.2
dmi.chassis.type: 1
dmi.chassis.vendor: Oracle Corporation
dmi.modalias: dmi:bvninnotekGmbH:bvrVirtualBox:bd12/01/2006:svninnotekGmbH:pnVirtualBox:pvr1.2:rvnOracleCorporation:rnVirtualBox:rvr1.2:cvnOracleCorporation:ct1:cvr:
dmi.product.name: VirtualBox
dmi.product.version: 1.2
dmi.sys.vendor: innotek GmbH

Revision history for this message
Chris van Run (christehrun) wrote :
Revision history for this message
Chris van Run (christehrun) wrote :
Revision history for this message
Chris van Run (christehrun) wrote :

You can easily check this bug by:

1 setting logging in autofs.conf to 'debug'
2 create a simple autofs map:

   /etc/auto.master:
/mnt/test auto.test

   /etc/auto.test:
root -fstype=autofs,uid=$UID,gid=$GID :/dev/sda1

3 look at journalctl -xfe --unit autofs output while with a non-root user trying to navigate to /mnt/test/root. Especially the log lines with parse_mount: parse(sun).

Revision history for this message
Chris van Run (christehrun) wrote : AlsaInfo.txt

apport information

tags: added: apport-collected xenial
description: updated
Revision history for this message
Chris van Run (christehrun) wrote : CRDA.txt

apport information

Revision history for this message
Chris van Run (christehrun) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Chris van Run (christehrun) wrote : JournalErrors.txt

apport information

Revision history for this message
Chris van Run (christehrun) wrote : Lspci.txt

apport information

Revision history for this message
Chris van Run (christehrun) wrote : ProcCpuinfo.txt

apport information

Revision history for this message
Chris van Run (christehrun) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Chris van Run (christehrun) wrote : ProcModules.txt

apport information

Revision history for this message
Chris van Run (christehrun) wrote : UdevDb.txt

apport information

Revision history for this message
Chris van Run (christehrun) wrote : WifiSyslog.txt

apport information

Revision history for this message
Brad Figg (brad-figg) wrote : Status changed to Confirmed

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Revision history for this message
Seth Forshee (sforshee) wrote :

Thanks Chris. I see what the problem is, so I'll look into a fix.

Changed in linux (Ubuntu):
assignee: nobody → Seth Forshee (sforshee)
importance: Undecided → High
Revision history for this message
Seth Forshee (sforshee) wrote :

@Chris - please give the kernel below a try, I think it will fix your issue. Let me know your results. Thanks!

http://people.canonical.com/~sforshee/lp1629204/

Changed in linux (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Chris van Run (christehrun) wrote :

@Seth - thanks for the quick build. Keep up the good work. Seems like a simple enough patch though =D.

After testing it I can confirm the patch works! Autofs parameters are once again correctly substituted in kernel version 4.4.0-40 (60).

Cheers,

Chris

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
Seth Forshee (sforshee)
Changed in linux (Ubuntu):
status: Confirmed → In Progress
Seth Forshee (sforshee)
description: updated
Seth Forshee (sforshee)
Changed in linux (Ubuntu Xenial):
assignee: nobody → Seth Forshee (sforshee)
importance: Undecided → High
status: New → In Progress
Seth Forshee (sforshee)
Changed in linux (Ubuntu Xenial):
status: In Progress → Fix Committed
Changed in linux (Ubuntu Yakkety):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 4.8.0-21.23

---------------
linux (4.8.0-21.23) yakkety; urgency=low

  [ Tim Gardner ]

  * Release Tracking Bug
    - LP: #1630279

  * powerpc 4.8.0-17 fails to boot on PowerMac G5 (LP: #1628968)
    - Revert "Revert "powerpc: Simplify module TOC handling""

  * Regression tests can not detect binfmt_elf mmpa semantic change
    (LP: #1630069)
    - SAUCE: apparmor: add flag to detect semantic change, to binfmt_elf mmap

  * Autofs parameter substitution broken in kernel 4.4.0-38 and 4.4.0-40
    (LP: #1629204)
    - SAUCE: (namespace) autofs4: Use real_cred for requestor's ids

 -- Tim Gardner <email address hidden> Tue, 04 Oct 2016 08:01:21 -0600

Changed in linux (Ubuntu Yakkety):
status: Fix Committed → Fix Released
Revision history for this message
Robert Euhus (euhus-liste1) wrote :

I can confirm that the 0001-autofs4-Use-real_cred-for-uid-gid-in-packets.patch fixes the problem.

I have tried the kernel located here:
http://people.canonical.com/~sforshee/lp1629204/

And I have also applied the patch an top of the 4.4.0-38 kernel (commit be687e48ba9778ab2f28513bd50e1b274ba31f68) this fixes the problem there as well.

Please release a fixed kernel for xenial asap!

Thanks to everyone involved.

Regards
Robert.

Revision history for this message
Robert Euhus (euhus-liste1) wrote :

Just a note: 4.4.0-41.61 from xenial-proposed is still broken.

Revision history for this message
Robert Euhus (euhus-liste1) wrote :

I am very disappointed that another broken "stable" kernel (4.4.0-42.62) was just released for xenial, even though this problem and the fix have been known for about a week!

Why?

What can I do to speed up the progress?

I really need a working kernel on xenial! Or do I have to build it myself and roll it out to our systems?

Thanks,
Robert.

Revision history for this message
Seth Forshee (sforshee) wrote : Re: [Bug 1629204] Re: Autofs parameter substitution broken in kernel 4.4.0-38 and 4.4.0-40

On Tue, Oct 11, 2016 at 01:14:53PM -0000, Robert Euhus wrote:
> I am very disappointed that another broken "stable" kernel (4.4.0-42.62)
> was just released for xenial, even though this problem and the fix have
> been known for about a week!
>
> Why?
>
> What can I do to speed up the progress?
>
> I really need a working kernel on xenial! Or do I have to build it
> myself and roll it out to our systems?

There will be a new kernel in -proposed in the next day or two which
will include the fix.

Revision history for this message
Robert Euhus (euhus-liste1) wrote :

I really don't understand what's going on here. It's been another 6 days now. There has been another (broken) kernel update for xenial (4.4.0-43) which did not include this fix, and which also did not go through -proposed. Instead xenial-proposed is still at at 4.4.0-41, which is broken as well.

Two "stable" kernel updates with a known regression and a simple fix.

How is this possible?

And how does this fit with xenial being an LTS-Release?

This really ain't funny any more!

For now I have build the packages with the fix applied for amd64 and I'll try to keep up with new broken kernels. In case anybody else needs them:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 89C9B5AE
sudo apt-add-repository -u 'http://ubuntu.repo.uni-hannover.de/ubuntu xenial pub'
Or get the key from here: http://ubuntu.repo.uni-hannover.de/ubuntu/luh-deb-repo.gpg.key

Regards, Robert

Revision history for this message
Seth Forshee (sforshee) wrote :

Unfortunately there was a delay getting new kernels out to -proposed, but 4.4.0-44.64 has been built in the canonical-kernel-team PPA and does have the fix. This kernel should be migrated to -proposed soon, but you can download it directly from the PPA too (I don't recommend subscribing to that PPA however).

https://launchpad.net/~canonical-kernel-team/+archive/ubuntu/ppa/+packages

Revision history for this message
Seth Forshee (sforshee) wrote :

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-xenial' to 'verification-done-xenial'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-xenial
Revision history for this message
Torsten Casselt (casselt) wrote :

The kernel in -proposed is working.

tags: added: verification-done-xenial
removed: verification-needed-xenial
Revision history for this message
Robert Euhus (euhus-liste1) wrote :

The -proposed kernel works for me and fixes the problem.

Thanks!
Robert

Revision history for this message
Torsten Casselt (casselt) wrote :

Are you serious? You release a new kernel 4.4.0-45 without the fixes in 4.4.0-44 sitting in -proposed? What do you think -proposed is meant for? Systems using -proposed to avoid this bug now happily boot the new kernel facing this bug again.

Could you please get your stuff together and stop breaking installations?! Why do you think people are using LTS releases?

Revision history for this message
Robert Euhus (euhus-liste1) wrote :

This is unbelieveable:

- Ubuntu Xenial is shipping new broken kernels with a known REGRESSION !

- For more than two weeks a fix is known and "InProgress" (whatever this means). That does however not prevent new broken kernels from being released (4.4.0-42 and 4.4.0-43).

- Moreover all of these broken kernels have never gone through -proposed. Isn't this what -proposed is supposed to be for?!?

- For about a day a fixed and approved kernel (4.4.0-44) has finally made it to -proposed. But this again does not prevent another broken kernel (4.4.0-45) to be released directly, without going through -proposed.

- And to top it all, the git repo does not seem to be up to date.
git://kernel.ubuntu.com/ubuntu/ubuntu-xenial.git

I am really pissed!

Robert

Revision history for this message
Seth Forshee (sforshee) wrote :

The recent update was outside of the normal SRU release cycle to fix a serious security issue and contained only the security fix. There is a new -proposed kernel (4.4.0-46.67) which contains the fix for this bug, and barring any other unforeseen circumstances it will be released according to the original SRU schedule, on Oct 31.

Revision history for this message
Seth Forshee (sforshee) wrote :

An update on comment #30 - the security update has put testing/verification behind schdule, so the release date for the -proposed kernel has been pushed back a week to Nov 7. Apologies for the inconvenience.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package linux - 4.4.0-47.68

---------------
linux (4.4.0-47.68) xenial; urgency=low

  [ Kamal Mostafa ]

  * Release Tracking Bug
    - LP: #1636941

  * Add a driver for Amazon Elastic Network Adapters (ENA) (LP: #1635721)
    - lib/bitmap.c: conversion routines to/from u32 array
    - net: ethtool: add new ETHTOOL_xLINKSETTINGS API
    - net: ena: Add a driver for Amazon Elastic Network Adapters (ENA)
    - [config] enable CONFIG_ENA_ETHERNET=m (Amazon ENA driver)

  * unexpectedly large memory usage of mounted snaps (LP: #1636847)
    - [Config] switch squashfs to single threaded decode

 -- Kamal Mostafa <email address hidden> Wed, 26 Oct 2016 10:47:55 -0700

Changed in linux (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Chris van Run (christehrun) wrote :

I can confirm that using 4.4.0-47.68 version has resolved the autofs problem.

Cheers, Chris

Revision history for this message
Gerald Lovel (glovel) wrote :
Download full text (5.0 KiB)

Agreed.

Gerald
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Gerald Lovel | 901.276.1004
<email address hidden> | AAltSys.com
AAltSys Technology Center
<http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=aaltsys&aq=&sll=37.0625,-95.677068&sspn=52.947994,100.898438&ie=UTF8&hq=aaltsys&hnear=&z=13&iwloc=A&cid=7533665924136652323>

On Mon, Nov 14, 2016 at 5:09 AM, Chris van Run <email address hidden>
wrote:

> I can confirm that using 4.4.0-47.68 version has resolved the autofs
> problem.
>
> Cheers, Chris
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (1628586).
> https://bugs.launchpad.net/bugs/1629204
>
> Title:
> Autofs parameter substitution broken in kernel 4.4.0-38 and 4.4.0-40
>
> Status in linux package in Ubuntu:
> Fix Released
> Status in linux source package in Xenial:
> Fix Released
> Status in linux source package in Yakkety:
> Fix Released
>
> Bug description:
> SRU Justification
>
> Impact: ca6fe3344554 "fs: Call d_automount with the filesystems creds"
> causes a regression in the requester uid and gid passed to userspace
> during automount, as the current credentials during automount are
> those of root and not the user who requested the mount.
>
> Fix: Use current->real_cred instead of current->cred for getting the
> requester's uid and gid.
>
> Regression Potential: Minimal. current->cred and current->real_cred
> are the same except when credentials are overridden, thus
> current->real_cred contains the same credentials that autofs had been
> using prior to the change which overrides the credentials during
> automount.
>
> ---
>
> Hello,
>
> I have run into a bug relating autofs's parameter substitution (e.g.
> UID, GID, etc) with kernel versions 4.4.0-38 and proposed 4.4.0-40.
> Kernel version 4.4.0-28 does things correctly but testing intermediate
> kernel versions is hard due to earlier bugs related with fs's.
> Incorrect parameter substitution makes CIFS mounting with variable
> credentials impossible.
>
> Wat was expected:
> $UID in autofs map are substituted by the uid of the user that starts
> the auto-mounting process.
>
> What actually happens:
> Root's uid (0) is substituted instead.
>
> This ill parameter substitution likely caused by recent fixes
> resolving permissions problems for nfs/cifs mounts and dfs referrals
> (#1626112 and #1612135). And possibly the fix 'fs: Call d_automount
> with the filesystems creds' but that is a wild guess.
>
> Furthermore; playing with the force_standard_program_map_env settings
> in autofs.conf and prefixing variables with 'AUTOFS_' does not solve
> anything.
>
> Yours kindly,
>
> Chris
>
> ---- Additional info ----
>
> lsb_release -rd
> Description: Ubuntu 16.04.1 LTS
> Release: 16.04
> ---
> ApportVersion: 2.20.1-0ubuntu2.1
> Architecture: amd64
> AudioDevicesInUse:
> USER PID ACCESS COMMAND
> /dev/snd/controlC0: run00001 3015 F.... pulseaudio
> DistroRelease: Ubuntu 16.04
> HibernationDevice: RESUME=UUID=f2a2c5c4-2f41-482a-80b4-968a87131214
> InstallationDate: Installed on 2016-09-19 (10 days ago)
> I...

Read more...

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.