[PATCH v2 4.14 06/17] bpf: Refactor and streamline bounds check into helper