--- a/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
+++ b/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
@@ -176,7 +176,12 @@ ResultExpr EvaluateSyscallImpl(int fs_de
   if (sysno == __NR_madvise) {
     // Only allow MADV_DONTNEED (aka MADV_FREE).
     const Arg<int> advice(2);
-    return If(advice == MADV_DONTNEED, Allow()).Else(Error(EPERM));
+#if defined(MADV_FREE)
+    return If(AnyOf(advice == MADV_DONTNEED, advice == MADV_FREE), Allow())
+#else
+    return If(advice == MADV_DONTNEED, Allow())
+#endif
+           .Else(Error(EPERM));
   }
 
 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \
--- a/third_party/WebKit/Source/wtf/allocator/PageAllocator.cpp
+++ b/third_party/WebKit/Source/wtf/allocator/PageAllocator.cpp
@@ -41,6 +41,9 @@
 #include <errno.h>
 #include <sys/mman.h>
 
+// Added in Linux 4.5, but we don't want to depend on 4.5 at runtime
+#undef MADV_FREE
+
 #ifndef MADV_FREE
 #define MADV_FREE MADV_DONTNEED
 #endif
