<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div apple-content-edited="true" class=""><div class="">Did SELinux get loaded before your changes (Fedora uses SELinux by default)? Would you please post your security config? I still suspect that there was sth messed up in the config.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Dave</div><br class="Apple-interchange-newline">

</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Jan 18, 2015, at 7:09 PM, Thomas F. J.-M. Pasquier &lt;<a href="mailto:tfjmp2@cam.ac.uk" class="">tfjmp2@cam.ac.uk</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class="">No, other LSM. Checked in the config file. The only one selected is mine and it is set "Default Security Module" when using menuconfig.<br class=""><br class=""><div class="gmail_quote">On Mon Jan 19 2015 at 12:07:33 AM Tian Dave &lt;<a href="mailto:dave.jing.tian@gmail.com" target="_blank" class="">dave.jing.tian@gmail.com</a>&gt; wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="">Then which LSM was triggered? SELinux? You probably need to disable other LSM before making your LSM work.<div class=""><br class=""></div><div class="">Thanks,</div><div class="">Dave</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">2015-01-18 18:49 GMT-05:00 Thomas F. J.-M. Pasquier <span dir="ltr" class="">&lt;<a href="mailto:tfjmp2@cam.ac.uk" target="_blank" class="">tfjmp2@cam.ac.uk</a>&gt;</span>:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi everyone,<div class=""><br class=""></div><div class="">Kernel version 3.17.8<br class=""><div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">I am selecting my helloworld LSM when building the kernel and it is set as default (checked and re-checked in menuconfig&nbsp;+ in the file).</div><div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">Here is the init function:</div><div class=""><div class="">static __init int hw_init(void){</div><div class=""><span style="white-space:pre-wrap" class="">        </span>/* avoid security registration races */</div><div class=""><span style="white-space:pre-wrap" class="">        </span>if (!security_module_enable(&amp;hw_<u class=""></u>ops)){</div><div class=""><span style="white-space:pre-wrap" class="">                </span>printk(KERN_INFO "hw: &nbsp;Disabled at boot.\n");</div><div class=""><span style="white-space:pre-wrap" class="">                </span>return 0;</div><div class=""><span style="white-space:pre-wrap" class="">        </span>}</div><div class=""><br class=""></div><div class=""><span style="white-space:pre-wrap" class="">        </span>printk(KERN_INFO "hw: &nbsp;Initializing.\n");</div><div class=""><br class=""></div><div class=""><span style="white-space:pre-wrap" class="">        </span>if (register_security(&amp;hw_ops))</div><div class=""><span style="white-space:pre-wrap" class="">                </span>panic("hw: Unable to register with kernel.\n");</div><div class=""><span style="white-space:pre-wrap" class="">        </span>else</div><div class=""><span style="white-space:pre-wrap" class="">                </span>printk(KERN_INFO "hw: registered with the kernel.\n");</div><div class=""><br class=""></div><div class=""><span style="white-space:pre-wrap" class="">        </span>return 0;</div><div class="">}</div><div class=""><br class=""></div><div class="">security_initcall(hw_init);</div></div><div class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">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 class=""><br class=""></div><div class="">Thank you in advance.</div><div class=""><br class=""></div><div class="">Regards,</div><div class="">Thomas</div><div class=""><br class=""></div><div class=""><br class=""></div></div>
<br class=""></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">______________________________<u class=""></u>_________________<br class="">
Kernelnewbies mailing list<br class="">
<a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank" class="">Kernelnewbies@kernelnewbies.<u class=""></u>org</a><br class="">
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank" class="">http://lists.kernelnewbies.<u class=""></u>org/mailman/listinfo/<u class=""></u>kernelnewbies</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</blockquote></div>
</div></blockquote></div><br class=""></body></html>