View Single Post
Posts: 1,225 | Thanked: 1,905 times | Joined on Feb 2011 @ Quezon City, Philippines
#320
I know this'll be a double post, but I just cant resist - I got a little too bored last night while hopped up on coffee.

It's a little teaser of what's to come.

Code:
[    0.000000] Booting Linux on physical CPU 0
[    0.000000] Initializing cgroup subsys cpu
[    0.000000] Linux version 3.5.3-plus (hurrian@buildserver) (gcc version 4.6.4 20130412 (Mer 4.6.4-1) (Linaro GCC 4.6-2013.05) ) #1 PREEMPT Thu Apr 3 02:06:04 UTC 2014
[    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c53c7d
[    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[    0.000000] Machine: Nokia RM-680 board
[    0.000000] Reserving 14680064 bytes SDRAM for VRAM
[    0.000000] Memory policy: ECC disabled, Data cache writeback
[    0.000000] On node 0 totalpages: 256768
[    0.000000] free_area_init_node: node 0, pgdat b06e6ea0, node_mem_map b0710000
[    0.000000]   Normal zone: 2032 pages used for memmap
[    0.000000]   Normal zone: 0 pages reserved
[    0.000000]   Normal zone: 252688 pages, LIFO batch:31
[    0.000000]   HighMem zone: 16 pages used for memmap
[    0.000000]   HighMem zone: 2032 pages, LIFO batch:0
[    0.000000] OMAP3630 ES1.2 (l2cache iva sgx neon isp 192mhz_clk )
[    0.000000] Clocking rate (Crystal/Core/MPU): 38.4/390/600 MHz
[    0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
[    0.000000] pcpu-alloc: [0] 0 
[    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 254720
[    0.000000] Kernel command line: init=/sbin/preinit_harmattan root=/dev/mmcblk0p2 rootwait rootflags=errors=remount-ro rootfstype=ext4 rw mtdoops.mtddev=log mtdoops.record_size=65536 console=tty0 mtdparts=omap2-onenand:1024k(bootloader),2816k@1024k(config),16384k@3840k(kernel),2048k@20224k(log),469248k@22272k(var),32768k@491520k(moslo) bootreason=pwr_key bootmode=normal nolo=2.3.6 product_name=RM-696 dbi-type=V5JW dbi-vendor=1 dbi-size=73 dbi-uid=000000000000000 imei=000000000000000 g_nokia.iSerialNumber=000000000000000 serialnumber=XXX000000 omap_sec.kci=958 gpio=cmt_apeslpx:93:sysfs:output,cmt_en:23:sysfs:init_active:output,cmt_rst_rq:88:sysfs:init_active:output,sleep_ind:92:sysfs:output omapdss.def_disp_enabled=1 vhash=000x00xxxxxxxx000x0xxxx0x00x0x00x0x0xx0x product_model=N9 hwid=1507
Right now, I've got it booting to the Nokia logo (/sbin/preinit_harmattan), which means I'm able to run Harmattan binaries.

I've spent the night patching Aegis to build and link properly against 3.5.3, but it doesn't register as a LSM
This turns the boot process into potato once /sbin/init runs, as IIRC it has Aegis hooks.
Maybe I need to disable the stock Unix DAC?

I'll make a diff and post binaries for any devs to test and work with me in a few.

Based on filippz's kernel source tree.


EDIT:
I've gotten aegis to load as a LSM!

One minor problem - it looks like due to some methods I've removed (due to deprecated kernel API or somesuch) cause aegis to go completely tits up.
You will get a MALF if you boot this kernel, in its current state.
You will render Harmattan unbootable (broken refhashlist?)

On the plus side, validator-init runs (you get the MALF screen), which means userspace is communicating with the kernel (not in the way we'd want to, but hey, it's a start!)

Points of interest:
security/aegis/validator/validator.c
@525: ipp_hashlist_load [...]
Function entirely removed and stubbed, first oops.
The original code (this commit, same file, line 530) can probably be rewritten.
The code in question that breaks:
Code:
bufptr = dentry_path(file->f_vfsmnt->mnt_mountpoint, buffer, buflen);
[...]
if (file->f_vfsmnt->mnt_parent != NULL) {
Changes that broke the original function: 1, 2

@1338: #if CONFIG_SECURITY_AEGIS_CREDP
.task_setgroups and .task_setgid are removed, reflecting a kernel API change (1, 2)
Investigate how important these LSM hooks are to Aegis?

security/aegis/validator/enforce.c
@188: valinfo.hashreq [...]
Should probably be changed back to
Code:
valinfo.hashreq     = (val & HASH_REQ_BIT)     ? 1 : 0;
once validator.c:525 is fixed.

WARNING! READ THE ABOVE FIRST!
The kernel is here
compiled with debug info and more printks, in case some of you have a serial port adapter and/or a propensity for kdb
Source patch is here
apply on top of filippz's kernel source tree
use n9_harmattan_defconfig to build a kernel with aegis enabled
WARNING! WARNING! WARNING! WARNING!
__________________
N9 PR 1.3 Open Mode + kernel-plus for Harmattan
@kenweknot, working on Glacier for Nemo.

Last edited by Hurrian; 2014-04-03 at 23:26.