LWN.net Logo

Remnant: The Proc Connector and Socket Filters

Scott James Remnant has posted a surprisingly detailed description of how to use the process connector to get process events from the kernel, combined with use of socket filters to reduce the information flow. "As I mentioned before, the proc connector is built on top of the generic connector and that itself is on top of netlink so sending that subscription message also involves embedded a message, inside a message inside a message. If you understood Christopher Nolan's Inception, you should do just fine."
(Log in to post comments)

The documentation problem

Posted Feb 10, 2011 15:05 UTC (Thu) by darwish07 (subscriber, #49520) [Link]

If there's one thing which is seriously wrong in the Linux kernel, it's the severe lack of coherent documentation. There are some nice stuff under 'Documentation/' with even some minor Docbook PDFs, but there's no coherent package.

Better examples in other communities are the FreeBSD kernel man pages section (9), and the very well copy-edited Solaris kernel documentation. The standard "patches welcome" reply is expected (and fair), but I'm just thinking out loud.

Maybe it's more of a culture rather than adding a single patch here and there. As proven by recent LWN.net book reviews, the current model of leaving this task to book authors "does not scale" very well.

The documentation problem

Posted Feb 10, 2011 16:01 UTC (Thu) by rilder (subscriber, #59804) [Link]

I agree with documentation not being organized but it is not non-comprehensive. If all the documents under Documentation/ are grouped together, it easily exceeds FreeBSD handbook size.

Also, kernel API is well documented in package kernel-manpages supplied by your distro, again under man page section 9.

I agree about the book part. Writing books for linux kernel is ardous when it is growing fast, though h-online kernel log and kernelnewbies documentation are good additives.

Finally, we have LWN for high quality documentation ;).

The documentation problem

Posted Feb 10, 2011 22:18 UTC (Thu) by nicooo (guest, #69134) [Link]

If the package isn't supplied, use "make installmandocs".

The documentation problem

Posted Feb 11, 2011 6:10 UTC (Fri) by samroberts (subscriber, #46749) [Link]

The protocols operating over netlink are not well documented, except in the source code. I doubt if the information in Scott's article is all available in any linux documentation.

I'd challenge anybody to interact with the netfilter subsystem without using the GPL user-space libraries published by the netfilter project. While the literal system call interfaces to the kernel might be well documented, the fact that the netlink-based protocols are so complicated and under documented you can't interact with them without using GPL libraries means that the kernel APIs effectively become GPL. This is unusual, and unfortunate if you think it should be possible to write non-GPL user space code that uses the linux kernel facilities.

The documentation problem

Posted Feb 11, 2011 6:18 UTC (Fri) by rahulsundaram (subscriber, #21946) [Link]

Just a quick note, it is possible to write code in a non-GPL license while using a GPL library as long as your code is GPL compatible.

The documentation problem

Posted Feb 13, 2011 3:29 UTC (Sun) by rsidd (subscriber, #2582) [Link]

If the binary links to the GPL library, it must be distributed under the GPL. And if the source cannot be used without the GPL library, it is practically GPL'd, even if theoretically it is under a different but compatible licence.

The documentation problem

Posted Feb 17, 2011 17:10 UTC (Thu) by intgr (subscriber, #39733) [Link]

> If the binary links to the GPL library, it must be distributed under the GPL

AFAICT the parent poster was right. It doesn't have to be distributed under GPL, it just has to be distributed under any compatible license.

Using the recent example, PostgreSQL can use the GPL-ed libreadline because the PostgreSQL License is compatible with GPL. However, OpenSSL cannot be linked to libreadline, because the OpenSSL License is not compatible with GPL.

The documentation problem

Posted Feb 17, 2011 17:54 UTC (Thu) by samroberts (subscriber, #46749) [Link]

I'm not sure if there is just some pedantic point being made here, or I wasn't clear enough. Saying your code doesn't actually have to be GPLed, only distributed under the same terms as the GPL is a very fine distinction, indeed.

Using system calls to use the linux kernel's facilities (file systems, networking, etc.) does not make ANY requirements on your code to have ANY license of ANY type. You can write code to the system calls that is licensed as you wish.

Writing code to the kernel interfaces exposed through netlink can force you to either use GPL libraries (at least in the case of the netfilter project) or to implement the relevant protocol yourself.

If you use GPL libraries you have to distribute your code under the terms of the GPL.

Implementing the netlink-based protocols yourself would still be annoying if the protocols were sufficiently documented, and they clearly are not.

Generally, the netlink based facilities are powerful but slightly obscure, and used for pieces of system plumbing (like upstart) that are and should be GPLed, so this problem doesn't get noticed as much as it should.

Its my opinion that a strength of linux is that it allows code of any license to be written on it (I'm a huge proponent of the kernel itself being entirely GPL). I see a problem in some of the more interesting, powerful, and linux-specific facilities being exposed in a way that creates barriers for non-GPL-compatible code to use them.

The documentation problem

Posted Feb 25, 2011 6:44 UTC (Fri) by efexis (guest, #26355) [Link]

May I coin this (if somebody has not already beaten me to it) as copycenter (copycentral? Copycentric?); the recognition that whilst freedom doesn't come from the enforced protections of the copyright, the enforced openness of the copyleft isn't true freedom either, although (IMO) much better for the greater society, the copyleft still relies on enforcement rather than personal responsibility. You can tell the copycentrics, they're the ones that can work with both of the others :-)

The documentation problem

Posted Feb 25, 2011 17:37 UTC (Fri) by jthill (guest, #56558) [Link]

It isn't you that's free, it's the software :-)

While hunting down the source of a quote, I ran across this:

[...] As reformer the liberal is dissatisfied with things as they are because they violate his exceptionally tender conscience. Nor does the liberal confuse liberty with license — that is, with the liberty to destroy liberty. He seeks to change or interpret law to make room for greater freedom, but is so wedded to law that he insists on bringing even the lawmaker, whether civil or ecclesiastical, within its jurisdiction. Liberalism does not advocate change for its own sake, but for the sake of something better in the direction of what he regards as good, namely, the maximum of liberty consistent with a regard for all men and all interests [...]
—PERRY, Ralph Barton, Characteristically American, New York: Alfred A. Knopf, 1949, p.117.
via Google Books, of course.

Copyright © 2011, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds