<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>223757</bug_id>
          
          <creation_ts>2008-05-26 21:20 0000</creation_ts>
          <short_desc>=app-mobilephone/kmobiletools-0.5.0_beta3 adds $USER to root group with &lt;udev-122-r1</short_desc>
          <delta_ts>2008-08-14 12:15:09 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Security</product>
          <component>Auditing</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>233790</dependson>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>hwoarang@gentoo.org</reporter>
          <assigned_to>security@gentoo.org</assigned_to>
          <cc>kde@gentoo.org</cc>
    
    <cc>mobile-phone@gentoo.org</cc>
    
    <cc>udev-bugs@gentoo.org</cc>

      

      
          <long_desc isprivate="0">
            <who>hwoarang@gentoo.org</who>
            <bug_when>2008-05-26 21:20:06 0000</bug_when>
            <thetext>app-mobilephone/kmobiletools-0.5.0_beta3 is requesting root priviledges and after that it adds normal user to root group

 --- output (when running from terminal)--
kbuildsycoca running...
Adding user XXXXXX to group root
Adding user XXXXXX to group uucp
Weaver::finish: done.


Reproducible: Always

Steps to Reproduce:
1.emerge app-mobilephone/kmobiletools-0.5.0_beta3
2.Run the wizard
3.Fill in the root password
4.Add new device

Actual Results:  
app-mobilephone/kmobiletools-0.5.0_beta3 is requesting root priviledges and after that it adds normal user to root group


I think is very very insecure what it happens. I might do something wrong and end up with my user to root group but I double checked it on two machines</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2008-06-01 14:03:02 0000</bug_when>
            <thetext>KDE/Mobile, can you guys look into this?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>deathwing00@gentoo.org</who>
            <bug_when>2008-06-01 14:30:43 0000</bug_when>
            <thetext>I guess we&apos;ll have to talk with upstream...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>deathwing00@gentoo.org</who>
            <bug_when>2008-06-01 14:51:19 0000</bug_when>
            <thetext>I can confirm it does happen. &apos;RockMan&apos; might know why this is happening.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>deathwing00@gentoo.org</who>
            <bug_when>2008-06-01 15:42:59 0000</bug_when>
            <thetext>Sorry, I looked again at it. It does NOT happen to me.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>deathwing00@gentoo.org</who>
            <bug_when>2008-06-01 15:47:36 0000</bug_when>
            <thetext>17:44 &lt;deathwing01&gt; do you want me to add you to the bug?
17:45 &lt;RockMan&gt; ok, but please post a comment: i need a precise log to see if it&apos;s a bug or not
17:46 &lt;RockMan&gt; because, if we have, for instance, /var/lock belonging to root:root then the normal (and wanted) application behaviour is to add the current 
                user to that group (that&apos;s root)
17:46 &lt;RockMan&gt; so if you&apos;ve root:root in one of that items it&apos;s a distro-configuration bug.. that&apos;s all
17:47 &lt;deathwing01&gt; I have to say that my user already belonged to uucp group
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>deathwing00@gentoo.org</who>
            <bug_when>2008-06-01 16:26:04 0000</bug_when>
            <thetext>So, from instructions on comment #5:

$ ls -ald /var/lock

In my case, where the bug is not reproducible:
drwxrwxr-x 3 root uucp 96 2008-05-31 02:13 /var/lock

What about you?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hwoarang@gentoo.org</who>
            <bug_when>2008-06-01 16:28:01 0000</bug_when>
            <thetext>So this is the /etc/group for Group *root* before I execute kmobile tools

root:x:0:root


Then I execute the kmobiletools

Then it asks me for root password

I give it to it. It says that my user will be added to groups uucp and root.
Then

Adding user hwoarang to group root
Adding user hwoarang to group uucp
                             
And after that

cat /etc/group|grep root

root:x:0:root,*myuser*


Is this behavior normal?


ps:

ls -ald /var/lock/
drwxrwxr-x 3 root uucp 4096 2008-04-11 08:58 /var/lock/


</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>deathwing00@gentoo.org</who>
            <bug_when>2008-06-01 17:28:24 0000</bug_when>
            <thetext>Could you show us the permissions of rfcomm* ttyS* ttyACM* ttyUSB* ircomm* files in /dev?

Additionally, could you attach a full log?

Thanks.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hwoarang@gentoo.org</who>
            <bug_when>2008-06-02 12:36:46 0000</bug_when>
            <thetext>ls -la /dev/|grep rfcomm*
crw-rw----  1 root root      216,   0 2008-06-02 15:24 rfcomm0

ls -la /dev/ttyS*
crw-rw---- 1 root uucp 4, 64 2008-06-02 18:24 /dev/ttyS0
crw-rw---- 1 root uucp 4, 65 2008-06-02 15:36 /dev/ttyS1
crw-rw---- 1 root uucp 4, 66 2008-06-02 18:24 /dev/ttyS2
crw-rw---- 1 root uucp 4, 67 2008-06-02 18:24 /dev/ttyS3
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>deathwing00@gentoo.org</who>
            <bug_when>2008-06-02 21:19:35 0000</bug_when>
            <thetext>(In reply to comment #9)
&gt; ls -la /dev/|grep rfcomm*
&gt; crw-rw----  1 root root      216,   0 2008-06-02 15:24 rfcomm0

You just found the problem. This device does not belong to the appropriate group.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hwoarang@gentoo.org</who>
            <bug_when>2008-06-03 07:50:42 0000</bug_when>
            <thetext>Indeed. That did the trick

Fixed and closed now i guess ;)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>deathwing00@gentoo.org</who>
            <bug_when>2008-06-03 07:55:15 0000</bug_when>
            <thetext>I&apos;d like to have base system verify that these devices are created with the appropriate permissions. Base system herd, could you please confirm?

Additionally, I think I will add a permissions check to the ebuild or a permissions autofix to the ebuild so that the application does not add users to the root group.

Finally, a bug report upstream asking to implement that functionality internally.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2008-06-03 13:51:09 0000</bug_when>
            <thetext>anyone who adds random users to the root group should get smacked with a basic permissions howto anyways ;)

device permissions is handled by udev ... if there is a central package for it, you should have it include a custom rules.d file.  if there isnt, you&apos;ll need udev to include an appropriate rule so that it gets uucp group ownership.

looking at existing udev rules.d, you&apos;ll probably want to just update the rule which sets uucp ownership for ircomm/etc...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hwoarang@gentoo.org</who>
            <bug_when>2008-06-03 14:09:07 0000</bug_when>
            <thetext>Thats true

But how could we add an *EXTRA* udev rule for rfcomm port ? Cause I changed rfcomm port group to uucp and after I rebooted the group changed to root again</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hwoarang@gentoo.org</who>
            <bug_when>2008-06-03 14:15:08 0000</bug_when>
            <thetext>Maybe something like



KERNEL==&quot;rfcomm[0-9]&quot;, NAME=&quot;rfcomm%n&quot; ,GROUP=&quot;uucp&quot;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zzam@gentoo.org</who>
            <bug_when>2008-06-03 18:27:28 0000</bug_when>
            <thetext>(In reply to comment #15)
&gt; Maybe something like
&gt; 
&gt; 
&gt; 
&gt; KERNEL==&quot;rfcomm[0-9]&quot;, NAME=&quot;rfcomm%n&quot; ,GROUP=&quot;uucp&quot;
&gt; 

This may sure help, but still can be simplified to:
KERNEL==&quot;rfcomm[0-9]*&quot;, GROUP=&quot;uucp&quot;

If we are needed to add this to udev-ebuild, I suggest to enhance this rule from /etc/udev/rules.d/65-permissions.rules:
KERNEL==&quot;ippp*|isdn*|dcbri*|capi*&quot;, GROUP=&quot;uucp&quot;

But: My system contains /etc/udev/rules.d/70-bluetooth.rules which has this:
SUBSYSTEM==&quot;tty&quot;, SUBSYSTEMS==&quot;bluetooth&quot;, GROUP=&quot;uucp&quot;

Doesn&apos;t this match rfcomm devices?
Please add info about versions of kernel, udev and bluez-utils you have on your system.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hwoarang@gentoo.org</who>
            <bug_when>2008-06-03 18:37:32 0000</bug_when>
            <thetext>The rule I posted works fine for me even after i rebooted

Here are my info

2.6.24-gentoo-r8

udev-119
bluez-utils-3.30

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zzam@gentoo.org</who>
            <bug_when>2008-06-07 08:52:57 0000</bug_when>
            <thetext>Please also attach the output of
udevinfo -a -n /dev/rfcomm0</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hwoarang@gentoo.org</who>
            <bug_when>2008-06-07 12:31:53 0000</bug_when>
            <thetext>Created an attachment (id=155811)
udevinfo for rfcomm port

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zzam@gentoo.org</who>
            <bug_when>2008-06-09 19:42:37 0000</bug_when>
            <thetext>udev-122-r1 does now set GROUP=&quot;uucp&quot; for rfcomm* devices.
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>deathwing00@gentoo.org</who>
            <bug_when>2008-06-10 07:49:38 0000</bug_when>
            <thetext>I think I&apos;ll add an extra check to the ebuild. Is it possible to have udev-122-r1 stabilized?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2008-07-06 22:34:45 0000</bug_when>
            <thetext>udev team, ping.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zzam@gentoo.org</who>
            <bug_when>2008-07-07 12:05:47 0000</bug_when>
            <thetext>If no big issues show up I vote for stablizing udev-124.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2008-07-07 15:07:31 0000</bug_when>
            <thetext>No big issues within which timeframe?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zzam@gentoo.org</who>
            <bug_when>2008-07-29 22:07:01 0000</bug_when>
            <thetext>The only issue I know of with udev-124 is this:
http://thread.gmane.org/gmane.linux.hotplug.devel/12858
But it seems this is not yet fixed.

Nevertheless I think the time is over, else we forget about this again.
:)
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>zzam@gentoo.org</who>
            <bug_when>2008-08-14 11:31:12 0000</bug_when>
            <thetext>Is this bug now fixed?

The relevant ebuild (kmobiletools-0.5.0_beta3) is marked ~amd64 ~ppc ~x86
and fixed udev-124-r1 is marked amd64 ~ppc x86
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2008-08-14 12:05:41 0000</bug_when>
            <thetext>This issue only affects the unstable
 =app-mobilephone/kmobiletools-0.5.0_beta3
and not our stable version
 =app-mobilephone/kmobiletools-0.4.3.3

The code to add the current user to the groups that are gid of
  /dev/{rfcomm,ttyS,ttyACM,ttyUSB,ircomm}*
  /var/lock
seems to have been added in the 0.5 series.
With udev setting proper group rules for all of these devices, this issue is fixed when all arches have stabled =sys-fs/udev-124-r1 per bug 233790. We do not need the kmobiletools-0.5.0_beta3 stable, and this issue will not result in a GLSA since it did not affect stable ebuilds.

Matthias, thanks for getting udev fixed and stable, and sorry for Security&apos;s lack of communication the last days.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>rbu@gentoo.org</who>
            <bug_when>2008-08-14 12:15:09 0000</bug_when>
            <thetext>For what it&apos;s worth, this is not a security issue, because no trust boundaries are crossed. The user has to provide the root password to acquire being added to the root group, and there is no way to force this without the password. It is an unexpected and undesired behavior, and therefore a bug in udev/kmobiletools.

Since we are stabling udev in the other bug, and there is nothing else to do for this bug, I&apos;ll close it FIXED. Thanks to everyone for the feedback.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>155811</attachid>
            <date>2008-06-07 12:31 0000</date>
            <desc>udevinfo for rfcomm port</desc>
            <filename>udevinfo.txt</filename>
            <type>text/plain</type>
            <data encoding="base64">ClVkZXZpbmZvIHN0YXJ0cyB3aXRoIHRoZSBkZXZpY2Ugc3BlY2lmaWVkIGJ5IHRoZSBkZXZwYXRo
IGFuZCB0aGVuCndhbGtzIHVwIHRoZSBjaGFpbiBvZiBwYXJlbnQgZGV2aWNlcy4gSXQgcHJpbnRz
IGZvciBldmVyeSBkZXZpY2UKZm91bmQsIGFsbCBwb3NzaWJsZSBhdHRyaWJ1dGVzIGluIHRoZSB1
ZGV2IHJ1bGVzIGtleSBmb3JtYXQuCkEgcnVsZSB0byBtYXRjaCwgY2FuIGJlIGNvbXBvc2VkIGJ5
IHRoZSBhdHRyaWJ1dGVzIG9mIHRoZSBkZXZpY2UKYW5kIHRoZSBhdHRyaWJ1dGVzIGZyb20gb25l
IHNpbmdsZSBwYXJlbnQgZGV2aWNlLgoKICBsb29raW5nIGF0IGRldmljZSAnL2NsYXNzL3R0eS9y
ZmNvbW0wJzoKICAgIEtFUk5FTD09InJmY29tbTAiCiAgICBTVUJTWVNURU09PSJ0dHkiCiAgICBE
UklWRVI9PSIiCiAgICBBVFRSe2Rldn09PSIyMTY6MCIKICAgIEFUVFJ7YWRkcmVzc309PSIwMDox
NjpCODpDNjpFMzo0MCIKICAgIEFUVFJ7Y2hhbm5lbH09PSIxIgoK
</data>        

          </attachment>
    </bug>

</bugzilla>