<div dir="ltr">Then which LSM was triggered? SELinux? You probably need to disable other LSM before making your LSM work.<div><br></div><div>Thanks,</div><div>Dave</div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-01-18 18:49 GMT-05:00 Thomas F. J.-M. Pasquier <span dir="ltr"><<a href="mailto:tfjmp2@cam.ac.uk" target="_blank">tfjmp2@cam.ac.uk</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi everyone,<div><br></div><div>Kernel version 3.17.8<br><div><br></div><div>I am trying to build a skeleton LSM module, but I am not having much luck so far. The problem seems to be that the LSM init function is never called.</div><div><br></div><div>I am selecting my helloworld LSM when building the kernel and it is set as default (checked and re-checked in menuconfig + in the file).</div><div><br></div><div>The build is going fine (my module is built as I would expect). The rest of the building procedure goes fine. I reboot, the new image works just fine except my LSM is not in (nor any other, it seems, for that matter).</div><div><br></div><div>Here is the init function:</div><div><div>static __init int hw_init(void){</div><div><span style="white-space:pre-wrap">        </span>/* avoid security registration races */</div><div><span style="white-space:pre-wrap">        </span>if (!security_module_enable(&hw_ops)){</div><div><span style="white-space:pre-wrap">                </span>printk(KERN_INFO "hw: Disabled at boot.\n");</div><div><span style="white-space:pre-wrap">                </span>return 0;</div><div><span style="white-space:pre-wrap">        </span>}</div><div><br></div><div><span style="white-space:pre-wrap">        </span>printk(KERN_INFO "hw: Initializing.\n");</div><div><br></div><div><span style="white-space:pre-wrap">        </span>if (register_security(&hw_ops))</div><div><span style="white-space:pre-wrap">                </span>panic("hw: Unable to register with kernel.\n");</div><div><span style="white-space:pre-wrap">        </span>else</div><div><span style="white-space:pre-wrap">                </span>printk(KERN_INFO "hw: registered with the kernel.\n");</div><div><br></div><div><span style="white-space:pre-wrap">        </span>return 0;</div><div>}</div><div><br></div><div>security_initcall(hw_init);</div></div><div><br></div><div>I looked at how it was done in SELinux and the other security module and I don't seem to be doing things differently or incorrectly. I checked the log level just in case and that's not the issue either.</div><div><br></div><div>I am tempted to say the problem come from my building procedure/configuration, rather than the module/code in itself (the dist on top of the kernel is fedora21). I have been at it for a while now and any help would be most welcomed.</div><div><br></div><div>Thank you in advance.</div><div><br></div><div>Regards,</div><div>Thomas</div><div><br></div><div><br></div></div>
<br>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div><br></div>