Add test for CVE-2017-7308 on a raw socket's ring buffer
PATCH 1/1 Add test for CVE-2017-7308 on a raw socket's ring buffer
This test uses a Linux only interface which has not been fully integrated into glibc and it is not clear if it ever will be. So I have kept the fallback logic relatively simple and use only the Linux headers if they are present or just define what is needed in the test.
---
configure.ac | 3 + m4/ltp-tpacket-v3.m4 | 22 +++++++ runtest/cve | 1 + testcases/cve/.gitignore | 1 + testcases/cve/cve-2017-7308.c | 138 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 165 insertions(+) create mode 100644 m4/ltp-tpacket-v3.m4 create mode 100644 testcases/cve/cve-2017-7308.c
configure.ac +3 -0
@@ -37,6 +37,8 @@ AC_CHECK_HEADERS([ \ pthread.h \ sys/xattr.h \ linux/genetlink.h \ + linux/if_packet.h \ + linux/if_ether.h \ linux/mempolicy.h \ linux/module.h \ linux/netlink.h \
@@ -192,5 +194,6 @@ LTP_CHECK_BUILTIN_CLEAR_CACHE LTP_CHECK_MMSGHDR LTP_CHECK_UNAME_DOMAINNAME LTP_CHECK_X_TABLES +LTP_CHECK_TPACKET_V3 AC_OUTPUT
m4/ltp-tpacket-v3.m4 new file +22 -0
@@ -0,0 +1,22 @@ +dnl Copyright (c) 2017 Richard Palethorpe <[email protected]> +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +dnl the GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program. If not, see <http://www.gnu.org/licenses/>. + +AC_DEFUN([LTP_CHECK_TPACKET_V3],[ +AC_CHECK_TYPES([struct tpacket_req3],,,[ +#ifdef HAVE_LINUX_IF_PACKET_H +# include <linux/if_packet.h> +#endif +]) +])
runtest/cve +1 -0
@@ -16,5 +16,6 @@ cve-2017-2618 cve-2017-2618 cve-2017-2671 cve-2017-2671 cve-2017-5669 cve-2017-5669 cve-2017-6951 cve-2017-6951 +cve-2017-7308 cve-2017-7308 cve-2017-7472 keyctl04 cve-2017-1000364 stack_clash
testcases/cve/.gitignore +1 -0
@@ -8,4 +8,5 @@ cve-2017-2618 cve-2017-2671 cve-2017-6951 cve-2017-5669 +cve-2017-7308 stack_clash
testcases/cve/cve-2017-7308.c new file +138 -0
138 lines not on this page · raw message
Signature · 1 line
2.14.1
PATCH v4 1/1 Add test for CVE-2017-7308 on a raw socket's ring buffer
This test uses a Linux only interface which has not been fully integrated into glibc and it is not clear if it ever will be. So I have kept the fallback logic relatively simple and use only the Linux headers if they are present or just define what is needed in the test.
--- configure.ac | 3 + m4/ltp-tpacket-v3.m4 | 22 +++++++ runtest/cve | 1 + testcases/cve/.gitignore | 1 + testcases/cve/cve-2017-7308.c | 138 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 165 insertions(+) create mode 100644 m4/ltp-tpacket-v3.m4 create mode 100644 testcases/cve/cve-2017-7308.c
configure.ac +3 -0
@@ -37,6 +37,8 @@ AC_CHECK_HEADERS([ \ pthread.h \ sys/xattr.h \ linux/genetlink.h \ + linux/if_packet.h \ + linux/if_ether.h \ linux/mempolicy.h \ linux/module.h \ linux/netlink.h \
@@ -192,5 +194,6 @@ LTP_CHECK_BUILTIN_CLEAR_CACHE LTP_CHECK_MMSGHDR LTP_CHECK_UNAME_DOMAINNAME LTP_CHECK_X_TABLES +LTP_CHECK_TPACKET_V3 AC_OUTPUT
m4/ltp-tpacket-v3.m4 new file +22 -0
@@ -0,0 +1,22 @@ +dnl Copyright (c) 2017 Richard Palethorpe <[email protected]> +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +dnl the GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program. If not, see <http://www.gnu.org/licenses/>. + +AC_DEFUN([LTP_CHECK_TPACKET_V3],[ +AC_CHECK_TYPES([struct tpacket_req3],,,[ +#ifdef HAVE_LINUX_IF_PACKET_H +# include <linux/if_packet.h> +#endif +]) +])
runtest/cve +1 -0
@@ -16,5 +16,6 @@ cve-2017-2618 cve-2017-2618 cve-2017-2671 cve-2017-2671 cve-2017-5669 cve-2017-5669 cve-2017-6951 cve-2017-6951 +cve-2017-7308 cve-2017-7308 cve-2017-7472 keyctl04 cve-2017-1000364 stack_clash
testcases/cve/.gitignore +1 -0
@@ -8,4 +8,5 @@ cve-2017-2618 cve-2017-2671 cve-2017-6951 cve-2017-5669 +cve-2017-7308 stack_clash
testcases/cve/cve-2017-7308.c new file +138 -0
138 lines not on this page · raw message
Signature · 1 line
2.14.1
PATCH v5 1/1 Add test for CVE-2017-7308 on a raw socket's ring buffer
In reply to Richard PalethorpeThis test uses a Linux only interface which has not been fully integrated into glibc and it is not clear if it ever will be. So I have kept the fallback logic relatively simple and use only the Linux headers if they are present or just define what is needed in the test.
---
V5 - Split test variations into different functions
configure.ac | 3 + m4/ltp-tpacket-v3.m4 | 22 +++++++ runtest/cve | 1 + testcases/cve/.gitignore | 1 + testcases/cve/cve-2017-7308.c | 138 ++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 165 insertions(+) create mode 100644 m4/ltp-tpacket-v3.m4 create mode 100644 testcases/cve/cve-2017-7308.c
configure.ac +3 -0
@@ -37,6 +37,8 @@ AC_CHECK_HEADERS([ \ pthread.h \ sys/xattr.h \ linux/genetlink.h \ + linux/if_packet.h \ + linux/if_ether.h \ linux/mempolicy.h \ linux/module.h \ linux/netlink.h \
@@ -192,5 +194,6 @@ LTP_CHECK_BUILTIN_CLEAR_CACHE LTP_CHECK_MMSGHDR LTP_CHECK_UNAME_DOMAINNAME LTP_CHECK_X_TABLES +LTP_CHECK_TPACKET_V3 AC_OUTPUT
m4/ltp-tpacket-v3.m4 new file +22 -0
@@ -0,0 +1,22 @@ +dnl Copyright (c) 2017 Richard Palethorpe <[email protected]> +dnl +dnl This program is free software; you can redistribute it and/or modify +dnl it under the terms of the GNU General Public License as published by +dnl the Free Software Foundation; either version 2 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See +dnl the GNU General Public License for more details. +dnl +dnl You should have received a copy of the GNU General Public License +dnl along with this program. If not, see <http://www.gnu.org/licenses/>. + +AC_DEFUN([LTP_CHECK_TPACKET_V3],[ +AC_CHECK_TYPES([struct tpacket_req3],,,[ +#ifdef HAVE_LINUX_IF_PACKET_H +# include <linux/if_packet.h> +#endif +]) +])
runtest/cve +1 -0
@@ -16,5 +16,6 @@ cve-2017-2618 cve-2017-2618 cve-2017-2671 cve-2017-2671 cve-2017-5669 cve-2017-5669 cve-2017-6951 cve-2017-6951 +cve-2017-7308 cve-2017-7308 cve-2017-7472 keyctl04 cve-2017-1000364 stack_clash
testcases/cve/.gitignore +1 -0
@@ -8,4 +8,5 @@ cve-2017-2618 cve-2017-2671 cve-2017-6951 cve-2017-5669 +cve-2017-7308 stack_clash
testcases/cve/cve-2017-7308.c new file +138 -0
138 lines not on this page · raw message
Signature · 1 line
2.14.1