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 class="Apple-tab-span" style="white-space:pre">        </span>/* avoid security registration races */</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>if (!security_module_enable(&amp;hw_ops)){</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>printk(KERN_INFO &quot;hw:  Disabled at boot.\n&quot;);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>return 0;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>printk(KERN_INFO &quot;hw:  Initializing.\n&quot;);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>if (register_security(&amp;hw_ops))</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>panic(&quot;hw: Unable to register with kernel.\n&quot;);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>else</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>printk(KERN_INFO &quot;hw: registered with the kernel.\n&quot;);</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </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&#39;t seem to be doing things differently or incorrectly. I checked the log level just in case and that&#39;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>