On Thursday 19 September 2013 12:54, Bit Twister conveyed the following
to alt.os.linux.ubuntu...
Post by Bit TwisterPost by mikeJust a couple of questions.
How many lines of kernel source code?
I can not find the article I read about 2 days ago to see if it was
15 million lines of code or was it 17 million.
It was already 16 million last year, so it'll probably be around 17
million this year. But that amount covers the entire kernel as a
project, not the kernel as it will be installed on your system.
There is the kernel itself. There is the virtual filesystem layer.
There are the filesystem drivers. There is the architecture-specific
code - and Linux supports just about every processor architecture on the
planet. There is the hardware device driver code. Not everyone has all
hardware devices in existence in their computer, and some hardware
architectures do not even support certain hardware peripherals. Then
there are also the optional "hardening" patches like AppArmor and
SELinux.
Yes, SELinux is developed by the NSA - so that GNU/Linux would become
suitable for use on government/military computers - but that code is
audited, and all it does is add checkpoints for mandatory access
control.
Like I said, if a backdoor were to be planted in the Linux kernel, then
it would have to be in the platform-independent core kernel code. And
that part is strictly under control of a number of people, not in the
very least Linus himself.
Post by Bit TwisterWhat caught my eye was the headline about Micro$oft contribution, or
more importantly the lack of it this past year or so.
Microsoft's only contributions to Linux were with regard to having
support for running Linux inside a virtual machine on top of Microsoft's
Hyper-V hypervisor, and possibly with regard to Samba, although I don't
think they've been submitting code for that.
They are probably still contributing code, but far less so, and so their
code contributions were far smaller this year, and so they are no longer
in the top-10 list of code contributors for the past year.
In the past, Microsoft submitted code which was buggy and which they
weren't maintaining, and Linus threatened to kick their code out of the
kernel if they weren't going to submit patches to fix their bugs. After
all, there is no point in having buggy and unmaintained code in the
kernel. Linus won't stand for that.
Post by Bit TwisterPost by mikeHow much effort might an organization with as deep pockets as the NSA
put into obscuring their additions?
Obscuring is going to be the real challenge.
Especially since the code submissions for SELinux aren't all that big,
and are being audited, like every code submission from a third party.
Post by Bit TwisterPost by mikeHow many people have the actual skills to determine if a particular
chunk of code may or may not be part of an entry?
Probably a lot more than you are alluding to.
There are literally thousands of people working on Linux, and by that I
do mean the kernel, because that's what Linux is. The rest of the code
comes from GNU, and a few userland submissions which are important in
early userspace - i.e. udev, systemd - from RedHat. And the number of
GNU developers runs up into the hundreds of thousands. But that's
userspace, and userspace can't exploit anything if the kernel doesn't
have the hooks for that in the form of a serious backdoor or a serious
security leak.
Post by Bit TwisterPost by mikeHow many people with the time/energy to examine it all? Today?
Tomorrow? The day after that?
Now we can get down to a bit more realistic arguments.
There is no need to "examine it all". All that has to be examined is
new code and any changed code. Any decent source configuration
management software will spit out those changes.
The GIT development system - which was itself also written by Linus
Torvalds as a FLOSS replacement for BitKeeper, which they used earlier -
does not allow tampering. All code submissions are logged, and all code
is checksummed before and after each code submission. If anyone were to
mess with the source code, it would show in the logs.
Post by Bit TwisterYou can bet China, Russia, and other nations are looking through the
code, not to mention criminals wanting the same thing. Micro$oft would
not hesitate a minute to show their customers and the world that open
source code is not as secure as theirs.
That is correct, and so far they haven't budged. And guess what:
Microsoft has its own Linux Lab [sic]. Daniel Robbins, the founder of
the Gentoo distribution, left his position as leader of the Gentoo
project behind to go and work there. I don't think he's still working
there now, but he has started a new distribution, Funtoo, based upon the
Gentoo unstable code, so it's more "bleeding edge" than Gentoo itself,
but it uses the same repositories and package management system.
Post by Bit TwisterI really wish I could find that article. A tremendous amount of
changes was accomplished with very few defects.
Probably on kernelnewbies.org.
Post by Bit TwisterYou do not get that quality of code by just one person coding and
releasing it. More than a few people are looking at it.
Of course. And Linus is very pedantic too. If it doesn't meet his
standards, or even if he doesn't like the way the code was written, then
it won't go into the kernel.
Post by Bit TwisterI have been in a few code reviews, of my code and others. Does not
take long for any experienced coder to spot funny code.
That is correct. I've done coding too in my time - nothing fancy, not
in the C language, and certainly not any kernel stuff - but when I see
funny stuff, I'll notice it.
Post by Bit TwisterIt is like reading any document. Anything you see which does not make
sense just jumps out at you. Code checking tools have improved which
helps spot the usual exploitable holes.
Correct.
Post by Bit TwisterWeak spots like stack manipulation tend to get closer checks than
normal code.
Linux even has a stack protector in the upstream kernel, and as far as I
know, gcc - which isn't part of Linux as a project because it comes from
GNU - now mainly uses position-independent code for most userland stuff.
Most 64-bit distributions are built that way now, and it /may/ also be
the default on 32-bit now. There was a time when there were objections
against that because position-independent code would slow down 32-bit
systems (but not 64-bit). Don't ask me why.
Post by Bit TwisterThen there is the actual design. Think of the code of the kernel like
the rings of a tree. The inside rings have higher risk of causing
damage because it has unfettered access.
You look at that code a whole lot harder than you would look at code
which runs in the next levels of the rings. Next level/ring code has
to jump through hoops to get unfettered access in previous ring(s).
That code will stand out pretty quick to anyone with experience with
that ring interface.
Like I said higher up already.
Post by Bit TwisterOn the flip side, when I saw something about a secure linux being
released by some 3 letter government organization, my first thought
was SURE, RIGHT, Not on my system.
I've read about that too, and I think it was the NSA itself. The news
was published just around the same time that the shit hit the fan about
Microsoft and other organizations/companies - like VUPEN - selling zero
day exploits to the NSA.
--
= Aragorn =
GNU/Linux user #223157 - http://www.linuxcounter.net