RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1070249 - Permission denied on audio devices when there is a tty device with a long name
Summary: Permission denied on audio devices when there is a tty device with a long name
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: ConsoleKit
Version: 6.5
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Michal Sekletar
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-02-26 13:37 UTC by James Pearson
Modified: 2016-05-11 00:58 UTC (History)
2 users (show)

Fixed In Version: ConsoleKit-0.4.1-4.el6
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-11 00:58:57 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Simple patch to increase tty device name buffer length (325 bytes, patch)
2014-02-26 13:37 UTC, James Pearson
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:0942 0 normal SHIPPED_LIVE ConsoleKit bug fix update 2016-11-24 23:09:27 UTC

Description James Pearson 2014-02-26 13:37:48 UTC
Created attachment 868025 [details]
Simple patch to increase tty device name buffer length

Description of problem:

ConsoleKit fails to add the username to /dev/snd/* ACLs on login when there is a tty device with a name longer than 16 characters - hence any audio tool used by the user when logged in on the console give errors like:

ALSA lib pulse.c:229:(pulse_connect) PulseAudio: Unable to connect: Connection refused

The long tty device name (in this case) is created when a third party kernel module is loaded

Version-Release number of selected component (if applicable):

ConsoleKit-0.4.1-3.el6

How reproducible:

Always

Steps to Reproduce:
1. load third party kernel module that creates a tty device with a name longer than 16 characters
2. login on the console
3. try to use anything that uses audio

Actual results:

Username of console user not added to the ACLs for sound device files /dev/snd/*

Unable to use use audio

Expected results:

Username of console user added to the ACLs for sound device files /dev/snd/*

Able to use use audio

Additional info:

The utility 'ck-collect-session-info' crashes with a 'buffer overflow detected' error - so console-kit is unable to set the ACLs on the sound devices

The 'name' char array in struct tty_map_node defined in ck-sysdeps-linux.c is only 16 characters - so tty device names longer than this overflow this buffer

A simple fix is to increase the size of this buffer - a better fix would be to dynamically allocate a buffer of the correct length at runtime

Comment 5 Michal Sekletar 2016-01-19 08:35:57 UTC
I overlooked your attachment and merged a bit different patch which bumps the length to 32. Then I checked Debian and found out that they ship the same patch as well, so I guess 32 should be fine.

Comment 6 James Pearson 2016-01-19 10:33:15 UTC
32 will be fine in our case - although I guess it should really match whatever limit the kernel allows for tty device names

Comment 7 Frantisek Sumsal 2016-03-04 17:54:59 UTC
1) Reproducer
## Find some process running on tty* (it doesn't matter which one)
# ps aux | grep tty
## Save its pid
## Run ck-collect-session-info in gdb and replace device buffer with specially crafted tty name
# gdb --args /usr/libexec/ck-collect-session-info --uid 0 --pid 1473
(gdb) break ck-sysdeps-linux.c:122
(gdb) run
(gdb) set var buf=" /dev/ttywithaverylongname0 "
(gdb) cont

2) Output
a) Old package
<...>
(gdb) set var buf=" /dev/ttywithaverylongname0 "
(gdb) p buf
$1 = " /dev/ttywithaverylongname0 ", '\000' <repeats 9971 times>
(gdb) cont
Continuing.
*** buffer overflow detected ***: /usr/libexec/ck-collect-session-info terminated
======= Backtrace: =========
/lib64/libc.so.6(__fortify_fail+0x37)[0x7ffff74f66d7]
<...>
Program received signal SIGABRT, Aborted.
0x00007ffff74265e5 in raise () from /lib64/libc.so.6

b) New package
<...>
(gdb) set var buf=" /dev/ttywithaverylongname0 "
(gdb) p buf
$1 = " /dev/ttywithaverylongname0 ", '\000' <repeats 9971 times>
(gdb) cont
Continuing.
unix-user = 0
display-device = /dev/tty1
login-session-id = 4294967295

Program exited normally.

Comment 9 errata-xmlrpc 2016-05-11 00:58:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-0942.html


Note You need to log in before you can comment on or make changes to this bug.