In brief
Module loading security. Another SELinux-related change - not yet merged into the mainline - adds a new hook to request_module(). The idea here is to try to limit the ability of user-space programs to load arbitrary modules into a running kernel. In future versions of the SELinux policy, the ability to trigger module loads is likely to be reduced to a much smaller set of roles.
HugeTLB mappings. The "hugetlb" feature allows processes to create pseudo-anonymous memory mappings backed by pages which are larger (perhaps much larger) than the normal system page size. For certain kinds of applications, these mappings can improve performance by reducing pressure on the CPU's translation lookaside buffer (TLB). The kernel code resides within such a mapping for the same reason. Using hugetlb pages in user space is a bit awkward, though; it requires mounting the special hugetlbfs filesystem and mapping files from there.
Eric Munson has put together a patch implementing an easier way. With this patch, the mmap() system call understands a new MAP_HUGETLB flag; when that flag is present, the kernel will attempt to create a mapping backed by huge pages. Underneath it all, the mapping is still implemented as a hugetlbfs file, but user space need no longer be aware of that fact.
spin_is_locked(). Kernel code can test the current state of a spinlock with spin_is_locked(). But what should this function return on a single-processor system, where spinlocks do not exist at all? Kumar Gala ran into trouble because one uniprocessor spin_is_locked() implementation returned zero. The problem was code in this form:
/* Ensure we have the requisite lock */ BUG_ON(!spin_is_locked(&some_lock));
So Kumar thinks that the return value should always be true. But there are other situations where that is just the wrong thing to do; Linus gave an example where code is waiting for a lock to become free.
The real problem is that a predicate like spin_is_locked() simply lacks a well-defined meaning when the spinlock does not exist. So there is no way to always give the "right" answer in such situations. What may happen instead is that, in a future kernel, spin_is_locked() will be deprecated. Instead, there will be new expect_spin_locked() and expect_spin_unlocked() primitives for testing the state of a spinlock. When the code is this explicit about what it is looking for, the default answer can make sense; both would return true on uniprocessor systems.
localmodconfig. Many kernel testers want to build a kernel which looks like the kernel shipped with their distribution. But distributor kernels come with a configuration which builds almost everything. So our poor tester ends up waiting for a very long time as the system builds a bunch of modules which will never be used. One could avoid this problem by creating a new configuration from scratch, but that process can be a little daunting as well. There are a lot of configuration options in a contemporary kernel.
Steven Rostedt has posted a build system change intended to help with this problem. A user who types:
make localmodconfig
will get a configuration which builds all modules currently loaded into the
running system, but no others. That should be a configuration which
supports the system's hardware, but which lacks hundreds of useless
modules. There is also a localyesconfig option which builds the
required drivers directly into the kernel.
Posted Aug 20, 2009 1:44 UTC (Thu)
by jamesmrh (guest, #31622)
[Link]
Addressing this at the design level produces the most flexible result:
- the sysctl (mmap_min_addr) cannot be overridden at all by MAC security policy (e.g. SELinux)
- it can only be overridden with CAP_SYS_RAWIO
- if the sysctl is disabled to allow e.g. wine to run, MAC security policy can be used to add further restrictions to ensure that only wine can perform the mapping, and nothing else. i.e. running wine does not mean degrading security for the entire system.
Posted Aug 20, 2009 9:25 UTC (Thu)
by alex (subscriber, #1355)
[Link]
Posted Aug 20, 2009 16:59 UTC (Thu)
by sjayaraman (guest, #48013)
[Link]
I think Steven Rostedt posted earlier a perl script to do this called streamline-config.pl which was useful. This is even better - making it part of the build system!
Posted Aug 21, 2009 2:05 UTC (Fri)
by eparis123 (guest, #59739)
[Link]
Posted Aug 22, 2009 4:09 UTC (Sat)
by dirtyepic (guest, #30178)
[Link] (7 responses)
Posted Aug 23, 2009 17:07 UTC (Sun)
by nevets (subscriber, #11875)
[Link] (6 responses)
Posted Aug 23, 2009 21:57 UTC (Sun)
by dirtyepic (guest, #30178)
[Link] (5 responses)
Posted Aug 23, 2009 22:17 UTC (Sun)
by mjg59 (subscriber, #23239)
[Link] (4 responses)
Posted Aug 24, 2009 2:19 UTC (Mon)
by ABCD (subscriber, #53650)
[Link] (3 responses)
That usually isn't true in the special case of the microcode module, as the various distribution's init scripts generally load the module, update the microcode, then immediately explicitly unload the module.
Posted Aug 24, 2009 14:21 UTC (Mon)
by nevets (subscriber, #11875)
[Link] (2 responses)
Posted Aug 25, 2009 1:35 UTC (Tue)
by dirtyepic (guest, #30178)
[Link]
Posted Sep 22, 2009 19:49 UTC (Tue)
by BobRobertson (guest, #2048)
[Link]
I'll add my own Thank You to the list.
Posted Aug 22, 2009 10:28 UTC (Sat)
by dlang (guest, #313)
[Link] (7 responses)
there needs to be some way to gather the info from one (probably low-powered) system and taking it to another system to actually do the build on.
Posted Aug 22, 2009 17:26 UTC (Sat)
by rvfh (guest, #31018)
[Link] (6 responses)
Posted Aug 23, 2009 3:21 UTC (Sun)
by jzbiciak (guest, #5246)
[Link] (5 responses)
Posted Aug 23, 2009 17:11 UTC (Sun)
by nevets (subscriber, #11875)
[Link] (4 responses)
Posted Aug 25, 2009 21:01 UTC (Tue)
by mb (subscriber, #50428)
[Link] (3 responses)
Posted Aug 25, 2009 23:01 UTC (Tue)
by nevets (subscriber, #11875)
[Link] (2 responses)
Thanks.
Posted Aug 25, 2009 23:09 UTC (Tue)
by dlang (guest, #313)
[Link] (1 responses)
or you could allow the user to specify a command to get the data (defaulting to lsmod if nothing is specified)
Posted Sep 3, 2009 20:35 UTC (Thu)
by kabloom (guest, #59417)
[Link]
Posted Aug 25, 2009 0:39 UTC (Tue)
by nevets (subscriber, #11875)
[Link]
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
Play with it and report anything that breaks.
Note, if you are using git, then you can do the following as well:
git remote add next git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
Now you have a streamlined config, even if you do not have the option in your current development branch.
Low-memory mapping - core fixes
Yay for localyesconfig
Helpful localmodconfig
In brief
localmodconfig
localmodconfig
localmodconfig
localmodconfig
localmodconfig
localmodconfig
localmodconfig
localmodconfig
included building a kernel .config that had only the actually used modules
compiled in, and everything else as loadable modules.
In brief
In brief
In brief
In brief
In brief
So I could simply scp the modules list from the embedded machine to the build host and do the rest on the big machine.
In brief
In brief
In brief
local*config in Linux Next
git remote update
git checkout next/master
make localmodconfig
git checkout <previous branch>