Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit ef8dca81 authored by Hugo Benichi's avatar Hugo Benichi Committed by Abhisek Devkota
Browse files

Do not crash on malformed DHCP packets.

This fixes possible crashes with malformed DHCP packets.
It is part of Android Security Bulletin of January 2017 and
mitigates CVE CVE-2017-0389.

Squash of:

Author: Lorenzo Colitti <lorenzo@google.com>
Date:   Wed Mar 02 13:31:52 2016 +0900
    Don't crash if we get a DHCP packet with the wrong port.
    This should only happen if we get a packet in the small time
    window between binding the packet socket and programming the
    BPF filter on it.
    Bug: 26696823
    Change-Id: I481f1bc74bbaeb9646d96e1841d2a69acdb47d62

Author: Hugo Benichi <hugobenichi@google.com>
Date:   Wed Oct 05 18:33:21 2016 +0900
    Catch runtime exceptions when parsing DHCP packets
    This patch adds a try catch all to DHCP packet parsing so that
    DhcpClient does not choke on malformed packets, brinding down with it
    the whole framework.
    Test: added new unit tests catching the issue fixed in this patch.
    Bug: 31850211
    Change-Id: I3c50a149fed6b2cbc4f40bb4f0e5bb2b56859b44

Author: Hugo Benichi <hugobenichi@google.com>
Date:   Wed Oct 05 21:07:19 2016 +0900
    Reject DHCP packets with no magic cookie
    This patch adds an explicit check in the DHCP packet parser for
    rejecting packets without a magic cookie, instead of relying on the
    top-level try-catch-all in the parser.
    This allows to add to DHCP error metrics this specific error.
    It also allows to add two poor man's fuzzing tests that tries to find
    additional gaps in the DHCP packet parser by
     - trying to parse all subslices of a valid offer packet.
     - trying to parse random byte arrays.
    Test: covered by previously introduced malformed DHCP packet unit tests
          + additional fuzzing tests.
    Bug: 31850211
    Change-Id: If53c9ba9df78d7604ec018c9d67c237ae59c4833

Change-Id: Ic5a8fa4feb46cca325cb5c47616ee63b22d2e7c8
mh0rst: Backported to cm-13.0.
parent 012f0762
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment