News for hackers. Stuff that matters.
Re:Linux 3.13 by dded on Monday January 20, 2014 @08:38AM (#7089396)
One significant user-visible feature of 3.13 is nftables: https://lwn.net/Articles/564095/
Re:Linux 3.13 by esbranson on Monday January 20, 2014 @10:14AM (#7089865)
I've been wanting to implement a dynamic ARP filter (DHCP snooping + ARP filtering) for ages now, but arptables/ebtables just didn't cut it. Hopefully this will be easier/viable now. Because I still don't think ArpON sniffs DHCP leases for its mapping (it intercepts and replays ARP requests or something) and it doesn't filter rogue DHCP servers. I'm just amazed ARP spoofing/ARP cache poisoning is still a viable attack vector on home networks in 2014.
Re:Linux 3.13 by adekok on Monday January 20, 2014 @11:17AM (#7090224)
Please see the "master" branch of FreeRADIUS. https://github.com/FreeRADIUS/freeradius-server/

It can accept both DHCP and ARP protocols, and will decode them into attribute-value pairs. Those can then be referenced in a policy language, and stored to / read from a database.

I'm the author. :) It's no longer just a RADIUS server. I've been looking for a DHCP / ARP checker for a while, and couldn't find anything useful. Rather than writing something from scratch, I decided it was easier to just add ~2K LoC to FreeRADIUS. I could then leverage the policy language and database integration, so I didn't have to re-write all of that, either.

Re:Linux 3.13 by esbranson on Monday January 20, 2014 @01:36PM (#7091041)
Excellent. :) I will look into this.

I am targeting embedded devices on OpenWRT, which means it needs to be as simple and small as possible, so I hope the code is tight.

But on the other hand, I would prefer to not reinvent the wheel.

Re:Linux 3.13 by adekok on Monday January 20, 2014 @01:46PM (#7091101)
The code is tiny. It already runs on OpenWRT, so there's no issue there.
Re:Linux 3.13 by smutticus on Monday January 20, 2014 @12:01PM (#7090476)
You need to implement DHCP Snooping at Layer 2 for it to really work, and these days I think all major switch vendors support it. Unless you're building a Linux L2 switch I don't see why you would want to implement DHCP Snooping.
Re:Linux 3.13 by esbranson on Monday January 20, 2014 @01:41PM (#7091070)
You need DHCP snooping for proper ARP reply filtering. It is the cleanest way of determining MAC address<->IP address mappings.
Re:Linux 3.13 by sp332 on Monday January 20, 2014 @09:29AM (#7089650)
Note libnftables was just renamed to libnftnl http://www.marshut.com/imyzmp/libnftables-renamed-to-libnftn... A later, higher-level library will probably get the name libnftables.
Re:Linux 3.13 by makmanalp on Monday January 20, 2014 @11:09AM (#7090170)
> It adds a simple virtual machine to the kernel that is able to execute bytecode to inspect a network packet and make decisions on how that packet should be handled.

I wonder how long it's going to take until someone figures out a way to craft a specific sequence of packets that remotely do something nasty at the kernel level :P

Re:Linux 3.13 by diegocg on Monday January 20, 2014 @11:30AM (#7090292)
It's not different than the rest of the network stack, most of it consists in "inspecting packets" in one way or another, and security bugs can be (and some times are) introduced.

But nftables is actually a big win from a security perspective, because it simplifies the current code (lots of duplicated code goes away) and moves other parts to userspace.

Old netfilter system: 70.000 LoC in kernel + 50.000 in userspace

nftables: 7.000 LoC in kernel + 50.000 in userspace

(source: http://www.slideshare.net/ennael/2013-kernel-recipesnftables)

Also note that it's not really a "virtual machine" comparable with java, this is how the developers actually describe it

    In a nutshell, nftables provides a pseudo-state machine with 4 general
    purpose registers of 128 bits and 1 specific purpose register to store
    verdicts. This pseudo-machine comes with an extensible instruction set,
    a.k.a. "expressions" in the nftables jargon. The expressions included
    in this patch provide the basic functionality, they are:
    
    * bitwise: to perform bitwise operations.
    * byteorder: to change from host/network endianess.
    * cmp: to compare data with the content of the registers.
    * counter: to enable counters on rules.
    * ct: to store conntrack keys into register.
    * exthdr: to match IPv6 extension headers.
    * immediate: to load data into registers.
    * limit: to limit matching based on packet rate.
    * log: to log packets.
    * meta: to match metainformation that usually comes with the skbuff.
    * nat: to perform Network Address Translation.
    * payload: to fetch data from the packet payload and store it into
      registers.
    * reject (IPv4 only): to explicitly close connection, eg. TCP RST.
    
    Using this instruction-set, the userspace utility 'nft' can transform
    the rules expressed in human-readable text representation (using a
    new syntax, inspired by tcpdump) to nftables bytecode.
Re:Linux 3.13 by krakensden on Monday January 20, 2014 @12:08PM (#7090517)
I don't even think this is the first vm in the networking part of the kernel.
Re:Linux 3.13 by justincormack on Monday January 20, 2014 @12:54PM (#7090788)
No, BPF is very old.