[Sony Cross-Device General] McBane87:
root@D5503:/ # cat /proc/kallsyms | grep selinux
00000000 t selinux_inode_post_create
00000000 t selinux_inode_getsecid
00000000 t selinux_file_set_fowner
00000000 t selinux_file_close
00000000 t selinux_allow_merge_bio
00000000 t selinux_cred_transfer
00000000 t selinux_sk_clone_security
00000000 t selinux_sk_getsecid
00000000 t selinux_sock_graft
00000000 t selinux_inet_csk_clone
00000000 t selinux_secmark_refcount_inc
00000000 t selinux_secmark_refcount_dec
00000000 t selinux_req_classify_flow
00000000 t selinux_tun_dev_post_create
00000000 t selinux_ipv4_output
00000000 t selinux_ipc_getsecid
00000000 t selinux_key_free
00000000 t selinux_sk_free_security
00000000 t selinux_release_secctx
00000000 t selinux_file_free_security
00000000 t selinux_sb_free_security
00000000 t selinux_parse_opts_str
00000000 t selinux_secctx_to_secid
00000000 t selinux_inode_setsecurity
00000000 t selinux_inode_notifysecctx
00000000 t selinux_quotactl
00000000 t selinux_umount
00000000 t selinux_kernel_act_as
00000000 t selinux_kernel_create_files_as
00000000 t selinux_secmark_relabel_packet
00000000 t selinux_tun_dev_create
00000000 t selinux_tun_dev_attach
00000000 t selinux_file_alloc_security
00000000 t selinux_cred_alloc_blank
00000000 t selinux_sk_alloc_security
00000000 t selinux_key_alloc
00000000 t selinux_d_instantiate
00000000 t selinux_sb_clone_mnt_opts
00000000 t selinux_key_getsecurity
00000000 t selinux_secid_to_secctx
00000000 t selinux_socket_getpeersec_stream
00000000 t selinux_quota_on
00000000 t selinux_mount
00000000 t selinux_inode_rename
00000000 t selinux_inode_readlink
00000000 t selinux_inode_follow_link
00000000 t selinux_inode_setattr
00000000 t selinux_inode_getattr
00000000 t selinux_inode_getxattr
00000000 t selinux_inode_listxattr
00000000 t selinux_socket_unix_may_send
00000000 t selinux_socket_unix_stream_connect
00000000 t selinux_sem_semop
00000000 t selinux_shm_shmat
00000000 t selinux_ipc_permission
00000000 t selinux_sem_associate
00000000 t selinux_shm_associate
00000000 t selinux_msg_queue_msgsnd
00000000 t selinux_msg_queue_associate
00000000 t selinux_file_receive
00000000 t selinux_file_fcntl
00000000 t selinux_file_lock
00000000 t selinux_inode_permission
00000000 t selinux_inode_mknod
00000000 t selinux_inode_mkdir
00000000 t selinux_inode_symlink
00000000 t selinux_inode_create
00000000 t selinux_inode_rmdir
00000000 t selinux_inode_unlink
00000000 t selinux_inode_link
00000000 t selinux_sb_statfs
00000000 t selinux_task_wait
00000000 t selinux_task_create
00000000 t selinux_task_setpgid
00000000 t selinux_task_getpgid
00000000 t selinux_task_getsid
00000000 t selinux_task_getioprio
00000000 t selinux_task_getscheduler
00000000 t selinux_task_movememory
00000000 t selinux_file_mprotect
00000000 t selinux_binder_set_context_mgr
00000000 t selinux_binder_transaction
00000000 t selinux_binder_transfer_binder
00000000 t selinux_file_send_sigiotask
00000000 t selinux_task_getsecid
00000000 t selinux_task_kill
00000000 t selinux_task_to_inode
00000000 t selinux_msg_queue_alloc_security
00000000 t selinux_socket_shutdown
00000000 t selinux_socket_setsockopt
00000000 t selinux_socket_getsockopt
00000000 t selinux_socket_getpeername
00000000 t selinux_socket_getsockname
00000000 t selinux_socket_recvmsg
00000000 t selinux_socket_sendmsg
00000000 t selinux_socket_listen
00000000 t selinux_msg_queue_msgrcv
00000000 t selinux_kernel_module_request
00000000 t selinux_binder_transfer_file
00000000 t selinux_socket_connect
00000000 t selinux_socket_bind
00000000 t selinux_inode_setsecctx
00000000 t selinux_inode_setotherxattr
00000000 t selinux_inode_removexattr
00000000 t selinux_inode_post_setxattr
00000000 t selinux_setprocattr
00000000 t selinux_netlink_send
00000000 t selinux_cred_prepare
00000000 t selinux_file_permission
00000000 t selinux_file_ioctl
00000000 t selinux_inode_setxattr
00000000 t selinux_inode_init_security
00000000 t selinux_inode_free_security
00000000 t selinux_sb_alloc_security
00000000 t selinux_inode_alloc_security
00000000 t selinux_sb_show_options
00000000 t selinux_sb_copy_data
00000000 t selinux_sb_remount
00000000 t selinux_bprm_committed_creds
00000000 t selinux_bprm_set_creds
00000000 t selinux_capable
00000000 t selinux_inode_getsecurity
00000000 t selinux_inode_getsecctx
00000000 t selinux_vm_enough_memory
00000000 t selinux_capget
00000000 t selinux_set_mnt_opts
00000000 t selinux_sb_kern_mount
00000000 t selinux_syslog
00000000 t selinux_task_setrlimit
00000000 t selinux_msg_msg_alloc_security
00000000 t selinux_key_permission
00000000 t selinux_msg_msg_free_security
00000000 t selinux_cred_free
00000000 t selinux_socket_post_create
00000000 t selinux_getprocattr
00000000 t selinux_skb_peerlbl_sid.isra.44
00000000 t selinux_inet_conn_established
00000000 t selinux_socket_getpeersec_dgram
00000000 t selinux_inet_conn_request
00000000 t selinux_socket_accept
00000000 t selinux_sem_semctl
00000000 t selinux_shm_shmctl
00000000 t selinux_msg_queue_msgctl
00000000 t selinux_task_setscheduler
00000000 t selinux_task_setioprio
00000000 t selinux_task_setnice
00000000 t selinux_file_mmap
00000000 t selinux_inode_listsecurity
00000000 t selinux_bprm_secureexec
00000000 t selinux_capset
00000000 t selinux_ptrace_traceme
00000000 t selinux_ptrace_access_check
00000000 t selinux_parse_skb.constprop.61
00000000 t selinux_ip_forward
00000000 t selinux_ipv6_forward
00000000 t selinux_ipv4_forward
00000000 t selinux_ip_postroute_compat
00000000 t selinux_ip_postroute
00000000 t selinux_ipv6_postroute
00000000 t selinux_ipv4_postroute
00000000 t selinux_sock_rcv_skb_compat
00000000 t selinux_socket_sock_rcv_skb
00000000 t selinux_bprm_committing_creds
00000000 t selinux_sem_free_security
00000000 t selinux_shm_free_security
00000000 t selinux_msg_queue_free_security
00000000 t selinux_socket_create
00000000 t selinux_sem_alloc_security
00000000 t selinux_shm_alloc_security
00000000 t selinux_dentry_open
00000000 T selinux_complete_init
00000000 t selinux_transaction_write
00000000 T selinux_nlmsg_lookup
00000000 T selinux_is_enabled
00000000 t selinux_set_mapping.constprop.10
00000000 T selinux_audit_rule_free
00000000 T selinux_audit_rule_init
00000000 T selinux_audit_rule_known
00000000 T selinux_audit_rule_match
00000000 T selinux_kernel_status_page
00000000 T selinux_status_update_setenforce
00000000 T selinux_status_update_policyload
00000000 t selinux_trap_init
00000000 t selinux_trap_exit
00000000 T trap_selinux_error
00000000 r __ksymtab_selinux_is_enabled
00000000 r __kcrctab_selinux_is_enabled
00000000 r __kstrtab_selinux_is_enabled
00000000 t selinux_enabled_setup
00000000 t selinux_init
00000000 t selinux_nf_ip_init
00000000 t __setup_str_selinux_enabled_setup
00000000 t __setup_selinux_enabled_setup
00000000 t __initcall_selinux_nf_ip_init6
00000000 t __initcall_selinux_trap_init6
00000000 t __initcall_selinux_init
00000000 D selinux_enabled
00000000 d selinux_ops
00000000 d selinux_ipv4_ops
00000000 d selinux_ipv6_ops
00000000 D selinux_checkreqprot
00000000 d selinux_files.28585
00000000 d selinux_status_lock
00000000 b selinux_secmark_refcount
00000000 B selinux_enforcing
00000000 B selinux_null
00000000 b selinuxfs_kobj
00000000 B selinuxfs_mount
00000000 B selinux_policycap_netpeer
00000000 B selinux_policycap_openperm
00000000 b selinux_status_page
00000000 B selinux_trap_list_sem
00000000 B selinux_trap_list_head
00000000 B selinux_trap_process_list_head
00000000 B selinux_trap_enable

It's without byeselinux.ko loaded.

Do you need the real Adresses or is it OK with all those Zeros?

I used Ubuntu 14.04 (64 Bit) for compiling.

Toolchain:

apt-get install gcc-arm-linux-androideabi

Kernel-Source:

Sony (only kernel folder inside archive necessary)

GIT

ByeSELinux-Source:

https://github.com/dosomder/byeselinux

Howto compile:

I created a Script inside ByeSELinux-Source, so I don't have to insert the hole Command every time:

make.sh

#!/bin/bash

if [[ $1 == "clean" ]]; then
make CFLAGS_MODULE=-fno-pic \
KERNEL_BUILD=[COLOR="Red"]/path/to/kernel/source/[/COLOR] \
KERNEL_CROSS_COMPILE=arm-linux-androideabi- \
ARCH=arm \
clean
else
make CFLAGS_MODULE=-fno-pic \
KERNEL_BUILD=[COLOR="Red"]/path/to/kernel/source/[/COLOR] \
KERNEL_CROSS_COMPILE=arm-linux-androideabi- \
ARCH=arm
fi

There is no need to edit Makefile with this method, because the Variables there will be overwritten with those commands.

Usage:

./make.sh
or
./make.sh clean

Yes, I just removed the loading of byeselinux.ko from chargemon and was able to boot into Lollipop.

I used the Installer, not the flashable.

If you want to reinstall via Installer then you have to change those part with byeselinux too, because otherwise it would find the module already installed and will try to load it during installation:

installrecovery.sh

# Checking android version first, because byeselinux is chausing issues with android versions older then lollipop.
if [ "$ANDROIDVER" = "lollipop" ]; then
# Thanks to zxz0O0 for this method
if [ ! -e "/system/lib/modules/byeselinux.ko" ]; then
echo "The byeselinux module does not yet exist, installing it now."
${BUSYBOX} chmod 755 /data/local/tmp/recovery/byeselinux.sh
${BUSYBOX} chmod 755 /data/local/tmp/recovery/modulecrcpatch
/data/local/tmp/recovery/byeselinux.sh
else
echo "The byeselinux module exists, testing if the kernel accepts it."
${BUSYBOX} insmod /system/lib/modules/byeselinux.ko
if [ "$?" != "0" -a "$?" != "17" ]; then
echo "That module is not accepted by the running kernel, will replace it now."
${BUSYBOX} chmod 755 /data/local/tmp/recovery/modulecrcpatch
${BUSYBOX} chmod 755 /data/local/tmp/recovery/byeselinux.sh
/data/local/tmp/recovery/byeselinux.sh
fi
/system/bin/rmmod byeselinux
fi
if [ -e "/system/lib/modules/mhl_sii8620_8061_drv_orig.ko" ]; then
echo "Removing zxz0O0's byeselinux patch module, restoring the original."
$BUSYBOX rm -f /system/lib/modules/mhl_sii8620_8061_drv.ko
$BUSYBOX mv /system/lib/modules/mhl_sii8620_8061_drv_orig.ko /system/lib/modules/mhl_sii8620_8061_drv.ko
fi
else
echo "This firmware does not require byeselinux, will not install it."
fi

And now a Question from my Side. I'm not very expirienced in C-Programming/Kernel-Programming.

Can you explain what this Code of SELinux you posted above is doing different?