All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] cve-2017-16939: drop linux/xfrm.h include
@ 2018-04-26 10:52 Jan Stancek
  2018-04-26 12:46 ` Petr Vorel
  2018-05-03  8:45 ` Cyril Hrubis
  0 siblings, 2 replies; 4+ messages in thread
From: Jan Stancek @ 2018-04-26 10:52 UTC (permalink / raw)
  To: ltp

Mixing libc and linux headers can cause conflicts on some
distros. Drop linux/xfrm.h include and add needed defines
to a new lapi header.

Signed-off-by: Jan Stancek <jstancek@redhat.com>
---
 include/lapi/xfrm.h            | 29 +++++++++++++++++++++++++++++
 testcases/cve/cve-2017-16939.c |  2 +-
 2 files changed, 30 insertions(+), 1 deletion(-)
 create mode 100644 include/lapi/xfrm.h

diff --git a/include/lapi/xfrm.h b/include/lapi/xfrm.h
new file mode 100644
index 000000000000..013199b1a092
--- /dev/null
+++ b/include/lapi/xfrm.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2018 Linux Test Project
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it would be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write the Free Software Foundation
+ */
+
+#ifndef __XFRM_H__
+#define __XFRM_H__
+
+#ifndef XFRMNLGRP_NONE
+# define XFRMNLGRP_NONE 0
+#endif
+
+#ifndef XFRM_MSG_GETPOLICY
+# define XFRM_MSG_GETPOLICY 21
+#endif
+
+#endif
diff --git a/testcases/cve/cve-2017-16939.c b/testcases/cve/cve-2017-16939.c
index 223ca834b8db..a4a38ba34375 100644
--- a/testcases/cve/cve-2017-16939.c
+++ b/testcases/cve/cve-2017-16939.c
@@ -30,8 +30,8 @@
 #include <sys/wait.h>
 #include <netinet/in.h>
 #include <linux/netlink.h>
-#include <linux/xfrm.h>
 
+#include "lapi/xfrm.h"
 #include "tst_test.h"
 #include "tst_res_flags.h"
 #include "tst_safe_macros.h"
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [LTP] [PATCH] cve-2017-16939: drop linux/xfrm.h include
  2018-04-26 10:52 [LTP] [PATCH] cve-2017-16939: drop linux/xfrm.h include Jan Stancek
@ 2018-04-26 12:46 ` Petr Vorel
  2018-05-03  8:45 ` Cyril Hrubis
  1 sibling, 0 replies; 4+ messages in thread
From: Petr Vorel @ 2018-04-26 12:46 UTC (permalink / raw)
  To: ltp

Hi,

> Mixing libc and linux headers can cause conflicts on some
> distros. Drop linux/xfrm.h include and add needed defines
> to a new lapi header.

> Signed-off-by: Jan Stancek <jstancek@redhat.com>
> ---
Tested-by: Petr Vorel <pvorel@suse.cz>

Tested on various distros (but not affected RHEL 7.2).

Kind regards,
Petr

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [LTP] [PATCH] cve-2017-16939: drop linux/xfrm.h include
  2018-04-26 10:52 [LTP] [PATCH] cve-2017-16939: drop linux/xfrm.h include Jan Stancek
  2018-04-26 12:46 ` Petr Vorel
@ 2018-05-03  8:45 ` Cyril Hrubis
  2018-05-03  9:45   ` Jan Stancek
  1 sibling, 1 reply; 4+ messages in thread
From: Cyril Hrubis @ 2018-05-03  8:45 UTC (permalink / raw)
  To: ltp

Hi!
> +#ifndef __XFRM_H__
> +#define __XFRM_H__

I tend to avoid double underscores in identifier names, since these are
reserved for libc, so I would have named this LAPI_XFRM_H__ or something
similar, but that is very minor.

Other than that acked.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [LTP] [PATCH] cve-2017-16939: drop linux/xfrm.h include
  2018-05-03  8:45 ` Cyril Hrubis
@ 2018-05-03  9:45   ` Jan Stancek
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Stancek @ 2018-05-03  9:45 UTC (permalink / raw)
  To: ltp



----- Original Message -----
> Hi!
> > +#ifndef __XFRM_H__
> > +#define __XFRM_H__
> 
> I tend to avoid double underscores in identifier names, since these are
> reserved for libc, so I would have named this LAPI_XFRM_H__ or something
> similar, but that is very minor.
> 
> Other than that acked.

Pushed with suggested change.

Regards,
Jan

> 
> --
> Cyril Hrubis
> chrubis@suse.cz
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-05-03  9:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-26 10:52 [LTP] [PATCH] cve-2017-16939: drop linux/xfrm.h include Jan Stancek
2018-04-26 12:46 ` Petr Vorel
2018-05-03  8:45 ` Cyril Hrubis
2018-05-03  9:45   ` Jan Stancek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.