Thanks for the quick reply.
Yes it looks login runs in the wrong context, system_u:system_r:kernel_t and most of the processes are.
I am loading selinux policies from init, so I would expect all daemons should show their respective contexts.
Attached is the "ps -aeZ" output.
BTW, when I do "run_init /etc/init.d/sshd restart" the context changes from
"system_u:system_r:kernel_t" to "system_u:system_r:initrc_t" but not to sshd_t.
Regards,
Madhu
On Fri, Jun 24, 2011 at 12:57 PM, Stephen Smalley <sds@xxxxxxxxxxxxx> wrote:
Please provide your entire ps -Z output, or at least show the entireOn Fri, 2011-06-24 at 08:04 -0400, c.r.madhusudhanan@xxxxxxxxx wrote:
> Hi All,
>
>
>
>
> I have meego configured with SELinux refpolicy. I have enabled SELinux
> user to linux user mapping, and though it shows correct selinux user
> and selinux role,
> the domain/type appears to be wrong.
>
>
> For example, when I login linux user "meego", and say ps -Z, it shows
> me,
>
>
> user_u:user_r:insmod_t 773 tty1 00:00:00 bash
> user_u:user_r:insmod_t 795 tty1 00:00:00 ps
>
>
> where I expect this has to be user_u:user_r:user_t, any pointers?
ancestry of these processes (in particular the context of the login or
ssh process that spawned them).
--
Stephen Smalley
National Security Agency
LABEL PID TTY TIME CMD system_u:system_r:kernel_t 1 ? 00:00:08 init system_u:system_r:kernel_t 2 ? 00:00:00 kthreadd system_u:system_r:kernel_t 3 ? 00:00:00 ksoftirqd/0 system_u:system_r:kernel_t 4 ? 00:00:00 migration/0 system_u:system_r:kernel_t 5 ? 00:00:00 watchdog/0 system_u:system_r:kernel_t 6 ? 00:00:00 migration/1 system_u:system_r:kernel_t 7 ? 00:00:00 ksoftirqd/1 system_u:system_r:kernel_t 8 ? 00:00:00 watchdog/1 system_u:system_r:kernel_t 9 ? 00:00:00 migration/2 system_u:system_r:kernel_t 10 ? 00:00:00 ksoftirqd/2 system_u:system_r:kernel_t 11 ? 00:00:00 watchdog/2 system_u:system_r:kernel_t 12 ? 00:00:00 migration/3 system_u:system_r:kernel_t 13 ? 00:00:00 ksoftirqd/3 system_u:system_r:kernel_t 14 ? 00:00:00 watchdog/3 system_u:system_r:kernel_t 15 ? 00:00:00 events/0 system_u:system_r:kernel_t 16 ? 00:00:00 events/1 system_u:system_r:kernel_t 17 ? 00:00:00 events/2 system_u:system_r:kernel_t 18 ? 00:00:01 events/3 system_u:system_r:kernel_t 19 ? 00:00:00 cpuset system_u:system_r:kernel_t 20 ? 00:00:00 khelper system_u:system_r:kernel_t 21 ? 00:00:00 async/mgr system_u:system_r:kernel_t 22 ? 00:00:00 pm system_u:system_r:kernel_t 23 ? 00:00:00 sync_supers system_u:system_r:kernel_t 24 ? 00:00:00 bdi-default system_u:system_r:kernel_t 25 ? 00:00:00 kblockd/0 system_u:system_r:kernel_t 26 ? 00:00:00 kblockd/1 system_u:system_r:kernel_t 27 ? 00:00:00 kblockd/2 system_u:system_r:kernel_t 28 ? 00:00:00 kblockd/3 system_u:system_r:kernel_t 29 ? 00:00:00 kacpid system_u:system_r:kernel_t 30 ? 00:00:00 kacpi_notify system_u:system_r:kernel_t 31 ? 00:00:00 kacpi_hotplug system_u:system_r:kernel_t 32 ? 00:00:00 ata_aux system_u:system_r:kernel_t 33 ? 00:00:00 ata_sff/0 system_u:system_r:kernel_t 34 ? 00:00:00 ata_sff/1 system_u:system_r:kernel_t 35 ? 00:00:00 ata_sff/2 system_u:system_r:kernel_t 36 ? 00:00:00 ata_sff/3 system_u:system_r:kernel_t 37 ? 00:00:00 khubd system_u:system_r:kernel_t 38 ? 00:00:00 kseriod system_u:system_r:kernel_t 39 ? 00:00:00 kmmcd system_u:system_r:kernel_t 40 ? 00:00:00 cfg80211 system_u:system_r:kernel_t 41 ? 00:00:00 kondemand/0 system_u:system_r:kernel_t 42 ? 00:00:00 kondemand/1 system_u:system_r:kernel_t 43 ? 00:00:00 kondemand/2 system_u:system_r:kernel_t 44 ? 00:00:00 kondemand/3 system_u:system_r:kernel_t 45 ? 00:00:00 kswapd0 system_u:system_r:kernel_t 46 ? 00:00:00 aio/0 system_u:system_r:kernel_t 47 ? 00:00:00 aio/1 system_u:system_r:kernel_t 48 ? 00:00:00 aio/2 system_u:system_r:kernel_t 49 ? 00:00:00 aio/3 system_u:system_r:kernel_t 50 ? 00:00:00 crypto/0 system_u:system_r:kernel_t 51 ? 00:00:00 crypto/1 system_u:system_r:kernel_t 52 ? 00:00:00 crypto/2 system_u:system_r:kernel_t 53 ? 00:00:00 crypto/3 system_u:system_r:kernel_t 61 ? 00:00:00 i915 system_u:system_r:kernel_t 62 ? 00:00:00 kslowd000 system_u:system_r:kernel_t 63 ? 00:00:00 kslowd001 system_u:system_r:kernel_t 64 ? 00:00:00 scsi_eh_0 system_u:system_r:kernel_t 65 ? 00:00:00 scsi_eh_1 system_u:system_r:kernel_t 68 ? 00:00:00 scsi_eh_2 system_u:system_r:kernel_t 69 ? 00:00:00 scsi_eh_3 system_u:system_r:kernel_t 70 ? 00:00:00 smflush system_u:system_r:kernel_t 71 ? 00:00:00 kpsmoused system_u:system_r:kernel_t 72 ? 00:00:00 usbhid_resumer system_u:system_r:kernel_t 73 ? 00:00:00 l2cap system_u:system_r:kernel_t 74 ? 00:00:00 krfcommd system_u:system_r:kernel_t 76 ? 00:00:00 btrfs-worker-0 system_u:system_r:kernel_t 77 ? 00:00:00 btrfs-genwork-0 system_u:system_r:kernel_t 78 ? 00:00:00 btrfs-submit-0 system_u:system_r:kernel_t 79 ? 00:00:00 btrfs-delalloc- system_u:system_r:kernel_t 80 ? 00:00:00 btrfs-fixup-0 system_u:system_r:kernel_t 81 ? 00:00:00 btrfs-endio-0 system_u:system_r:kernel_t 83 ? 00:00:00 btrfs-endio-met system_u:system_r:kernel_t 84 ? 00:00:00 btrfs-endio-wri system_u:system_r:kernel_t 85 ? 00:00:00 btrfs-cleaner system_u:system_r:kernel_t 86 ? 00:00:00 btrfs-transacti system_u:system_r:kernel_t 117 ? 00:00:00 udevd system_u:system_r:kernel_t 322 ? 00:00:00 hd-audio0 system_u:system_r:kernel_t 340 ? 00:00:00 kjournald system_u:system_r:kernel_t 359 ? 00:00:00 flush-btrfs-1 system_u:system_r:kernel_t 361 ? 00:00:00 dbus-daemon system_u:system_r:kernel_t 377 ? 00:00:00 connmand system_u:system_r:kernel_t 381 ? 00:00:00 wpa_supplicant system_u:system_r:kernel_t 382 ? 00:00:00 syslogd system_u:system_r:kernel_t 386 ? 00:00:00 auditd system_u:system_r:kernel_t 389 ? 00:00:00 kauditd system_u:system_r:kernel_t 393 ? 00:00:00 klogd system_u:system_r:kernel_t 409 ? 00:00:00 dsme system_u:system_r:kernel_t 412 ? 00:00:00 dsme-server system_u:system_r:kernel_t 420 ? 00:00:00 S50sensord system_u:system_r:kernel_t 422 ? 00:00:00 bash system_u:system_r:kernel_t 423 ? 00:00:00 sensord system_u:system_r:kernel_t 425 ? 00:00:00 timed system_u:system_r:kernel_t 433 ? 00:00:01 avahi-daemon system_u:system_r:kernel_t 434 ? 00:00:00 avahi-daemon system_u:system_r:kernel_t 436 ? 00:00:00 sshd system_u:system_r:kernel_t 442 ? 00:00:00 ofonod system_u:system_r:kernel_t 446 ? 00:00:00 bluetoothd system_u:system_r:kernel_t 456 ? 00:00:00 uxlaunch system_u:system_r:kernel_t 460 ? 00:00:00 uxlaunch user_u:user_r:insmod_t 480 tty2 00:00:15 Xorg user_u:user_r:insmod_t 483 ? 00:00:00 ssh-agent system_u:system_r:kernel_t 485 ? 00:00:00 console-kit-dae user_u:user_r:insmod_t 553 ? 00:00:00 dbus-daemon user_u:user_r:insmod_t 556 ? 00:00:00 gconfd-2 user_u:user_r:insmod_t 559 ? 00:00:00 startivi user_u:user_r:insmod_t 566 ? 00:00:00 msyncd user_u:user_r:insmod_t 568 ? 00:00:00 udiskie user_u:user_r:insmod_t 570 ? 00:00:00 obex-client user_u:user_r:insmod_t 571 ? 00:00:00 corewatcher-app user_u:user_r:insmod_t 572 ? 00:00:00 tracker-miner-f user_u:user_r:insmod_t 573 ? 00:00:00 gpk-update-icon user_u:user_r:insmod_t 575 ? 00:00:00 matchbox-window user_u:user_r:insmod_t 576 ? 00:00:00 ividesktop user_u:user_r:insmod_t 578 ? 00:00:12 ivihome user_u:user_r:insmod_t 586 ? 00:00:00 pulseaudio user_u:user_r:insmod_t 594 ? 00:00:00 festival system_u:system_r:kernel_t 597 ? 00:00:00 udisks-daemon system_u:system_r:kernel_t 598 ? 00:00:00 udisks-daemon system_u:system_r:kernel_t 633 ? 00:00:00 login root:staff_r:insmod_t 637 tty1 00:00:00 bash system_u:system_r:kernel_t 657 ? 00:00:00 udevd system_u:system_r:kernel_t 658 ? 00:00:00 udevd user_u:user_r:insmod_t 668 ? 00:00:00 tracker-store user_u:user_r:insmod_t 671 ? 00:00:00 tumblerd system_u:system_r:kernel_t 684 ? 00:00:00 upowerd system_u:system_r:kernel_t 700 ? 00:00:00 polkitd system_u:system_r:kernel_t 765 ? 00:00:00 btrfs-endio-met user_u:user_r:insmod_t 906 ? 00:00:00 xterm user_u:user_r:insmod_t 909 pts/0 00:00:00 bash system_u:system_r:kernel_t 937 ? 00:00:00 btrfs-endio-wri user_u:user_r:insmod_t 958 pts/0 00:00:53 firefox-bin system_u:system_r:kernel_t 974 ? 00:00:00 btrfs-endio-met user_u:user_r:insmod_t 994 ? 00:00:00 xterm user_u:user_r:insmod_t 996 pts/1 00:00:00 bash user_u:user_r:insmod_t 1012 pts/1 00:00:00 ps