libhugetlbfs uses fixed size buffer to read from /proc/mounts

Bug #1791320 reported by Charles Hathaway
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libhugetlbfs (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Some applications (Kubernetes/Docker) create rather long lines in /proc/mounts, and libhugetlbfs emits an error when it attempts to read one of lines with a size greater than 2048.

See the method find_mounts starting near line 619 in hugeutils.c (https://github.com/libhugetlbfs/libhugetlbfs/blob/master/hugeutils.c#L619).

Error message: libhugetlbfs: ERROR: Line too long when parsing mounts

From strace of the process emitting that error:

read(3, "overlay /var/lib/docker/overlay2"..., 2048) = 2048
write(2, "libhugetlbfs", 12) = 12
write(2, ": ERROR: Line too long when pars"..., 43) = 43
close(3) = 0

Example line:

overlay /var/lib/docker/overlay2/497a00428de0950f98c30f625690832c409f92b6fc58c4d622bc0502fd7695ab/merged overlay rw,relatime,lowerdir=/var/lib/docker/overlay2/l/ESOO6DE7GB55IF4NZXMRFPKNY6:/var/lib/docker/overlay2/l/6NICHWKR5XI4MHV52ARYZQNVLG:/var/lib/docker/overlay2/l/7ZUCDNLHVUCOXOMUD7OBZJ4IDS:/var/lib/docker/overlay2/l/DNRGSMML2MTR2RJV4F2BAJ6FQU:/var/lib/docker/overlay2/l/CQLJGOF6WY5LQ6VX4O725X5IFO:/var/lib/docker/overlay2/l/6CK6EC5OVJHA5ILZMDXDKP2QJB:/var/lib/docker/overlay2/l/KTTUFSD7UEZRB22676OQLGIVMI:/var/lib/docker/overlay2/l/A25DTWZA7SE34D4BZFHSQMT4EO:/var/lib/docker/overlay2/l/CQRGOFOQSJGGQY2UZM2OMIDAJM:/var/lib/docker/overlay2/l/6K4TML6YASNW6XCWT4QFFLSTWE:/var/lib/docker/overlay2/l/O2KYUOVWX7WBRKL5ABL36FLUYK:/var/lib/docker/overlay2/l/FMJPLIDTQCRVLY7ZLCDKX33WXA:/var/lib/docker/overlay2/l/BXVOFLNKH6ETJ4I2SJC6XSNT5R:/var/lib/docker/overlay2/l/5WSNNJ2MGA4XVDMLC7BL5LY7PM:/var/lib/docker/overlay2/l/NKJYMIONXW25FZESMJEY2FG37M:/var/lib/docker/overlay2/l/H5XSSPSIH2VETF3LEZNUEQHPPO:/var/lib/docker/overlay2/l/4I3JGFDNMKTKINC64SLVQMRC5Y:/var/lib/docker/overlay2/l/LL2NPZVNWTTQEHOEE746HA3JRL:/var/lib/docker/overlay2/l/67X5X4XMVCLHIIF7PHQJF62BB2:/var/lib/docker/overlay2/l/PCDJDQQEVWNUU4REIBSFT7NIWF:/var/lib/docker/overlay2/l/QU3HK4NWJXZFFPOG6DDK47ZR6W:/var/lib/docker/overlay2/l/YUVCEWCIGHMAC76MBXV74WQNNO:/var/lib/docker/overlay2/l/LAHUMO6YLJLS3GGFLNCI76SWW3:/var/lib/docker/overlay2/l/DVDLA3VPNXEMUD4FFSMXET7F4Z:/var/lib/docker/overlay2/l/65IXWDQ2J3ATGX4UFGZJIG5U2J:/var/lib/docker/overlay2/l/YX2EW5G7WP3TDY43GV224URQJ5:/var/lib/docker/overlay2/l/QQUGRJFQM7CGZXKBWCUZX7XRTR:/var/lib/docker/overlay2/l/TDUN2SRUZIVA2BZCMBRJN3W33U:/var/lib/docker/overlay2/l/QUVJNMZUFKO36KUHESL3H6X3G3:/var/lib/docker/overlay2/l/OLYWPTCWJIXLH7QDVLNVXLNOIP:/var/lib/docker/overlay2/l/4KK6T3HWRM4P6RP5TD2VCD3RGD:/var/lib/docker/overlay2/l/3QGJKH5MBSC7JQ3TWPNDTCZEZV,upperdir=/var/lib/docker/overlay2/497a00428de0950f98c30f625690832c409f92b6fc58c4d622bc0502fd7695ab/diff,workdir=/var/lib/docker/overlay2/497a00428de0950f98c30f625690832c409f92b6fc58c4d622bc0502fd7695ab/work 0 0
---
ApportVersion: 2.20.1-0ubuntu2.18
Architecture: amd64
AudioDevicesInUse:
 Cannot stat file /proc/13951/fd/12: Permission denied
 Cannot stat file /proc/20309/fd/12: Permission denied
 Cannot stat file /proc/20309/fd/14: Permission denied
                      USER PID ACCESS COMMAND
 /dev/snd/controlC0: nars 4261 F.... pulseaudio
DistroRelease: Ubuntu 16.04
InstallationDate: Installed on 2017-04-12 (512 days ago)
InstallationMedia: Kubuntu 16.04.2 LTS "Xenial Xerus" - Release amd64 (20170215)
MachineType: To Be Filled By O.E.M. To Be Filled By O.E.M.
Package: linux (not installed)
ProcFB: 0 inteldrmfb
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.15.0-33-generic root=UUID=251cd001-8269-4fb1-adba-0afdfbe64d51 ro quiet splash vt.handoff=7
ProcVersionSignature: Ubuntu 4.15.0-33.36~16.04.1-generic 4.15.18
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.15.0-33-generic N/A
 linux-backports-modules-4.15.0-33-generic N/A
 linux-firmware 1.157.20
RfKill:

Tags: xenial xenial
Uname: Linux 4.15.0-33-generic x86_64
UnreportableReason: The report belongs to a package that is not installed.
UpgradeStatus: No upgrade log present (probably fresh install)
UserGroups:

_MarkForUpload: False
dmi.bios.date: 05/05/2017
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: P2.10
dmi.board.name: B250M Pro4
dmi.board.vendor: ASRock
dmi.chassis.asset.tag: To Be Filled By O.E.M.
dmi.chassis.type: 3
dmi.chassis.vendor: To Be Filled By O.E.M.
dmi.chassis.version: To Be Filled By O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrP2.10:bd05/05/2017:svnToBeFilledByO.E.M.:pnToBeFilledByO.E.M.:pvrToBeFilledByO.E.M.:rvnASRock:rnB250MPro4:rvr:cvnToBeFilledByO.E.M.:ct3:cvrToBeFilledByO.E.M.:
dmi.product.family: To Be Filled By O.E.M.
dmi.product.name: To Be Filled By O.E.M.
dmi.product.version: To Be Filled By O.E.M.
dmi.sys.vendor: To Be Filled By O.E.M.

Revision history for this message
Charles Hathaway (chathaway-codes) wrote :
Revision history for this message
Ubuntu Kernel Bot (ubuntu-kernel-bot) wrote : Missing required logs.

This bug is missing log files that will aid in diagnosing the problem. While running an Ubuntu kernel (not a mainline or third-party kernel) please enter the following command in a terminal window:

apport-collect 1791320

and then change the status of the bug to 'Confirmed'.

If, due to the nature of the issue you have encountered, you are unable to run this command, please add a comment stating that fact and change the bug status to 'Confirmed'.

This change has been made by an automated script, maintained by the Ubuntu Kernel Team.

Changed in linux (Ubuntu):
status: New → Incomplete
Revision history for this message
Charles Hathaway (chathaway-codes) wrote : AlsaInfo.txt

apport information

tags: added: apport-collected xenial
description: updated
Revision history for this message
Charles Hathaway (chathaway-codes) wrote : CRDA.txt

apport information

Revision history for this message
Charles Hathaway (chathaway-codes) wrote : CurrentDmesg.txt

apport information

Revision history for this message
Charles Hathaway (chathaway-codes) wrote : HookError_generic.txt

apport information

Revision history for this message
Charles Hathaway (chathaway-codes) wrote : IwConfig.txt

apport information

Revision history for this message
Charles Hathaway (chathaway-codes) wrote : Lspci.txt

apport information

Revision history for this message
Charles Hathaway (chathaway-codes) wrote : Lsusb.txt

apport information

Revision history for this message
Charles Hathaway (chathaway-codes) wrote : ProcCpuinfoMinimal.txt

apport information

Revision history for this message
Charles Hathaway (chathaway-codes) wrote : ProcEnviron.txt

apport information

Revision history for this message
Charles Hathaway (chathaway-codes) wrote : ProcInterrupts.txt

apport information

Revision history for this message
Charles Hathaway (chathaway-codes) wrote : ProcModules.txt

apport information

Revision history for this message
Charles Hathaway (chathaway-codes) wrote : UdevDb.txt

apport information

Revision history for this message
Charles Hathaway (chathaway-codes) wrote : WifiSyslog.txt

apport information

Changed in linux (Ubuntu):
status: Incomplete → Confirmed
affects: linux (Ubuntu) → libhugetlbfs (Ubuntu)
Changed in libhugetlbfs (Ubuntu):
status: Confirmed → New
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in libhugetlbfs (Ubuntu):
status: New → Confirmed
Revision history for this message
Elliott Friedman (elliott-friedman) wrote :

I solved this by limiting the number of mounts in one of my docker containers.

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.