summaryrefslogtreecommitdiffstats
path: root/include/linux/tipc_config.h
diff options
context:
space:
mode:
authorAllan Stephens2011-01-18 19:24:55 +0100
committerPaul Gortmaker2011-02-24 00:05:09 +0100
commit5413b4c6c07b659e52c84a4e40d897b32b89834f (patch)
treea0f108cc7396f0a715ed36cd1d6b2636c52798b1 /include/linux/tipc_config.h
parenttipc: Prevent invalid memory access when sending to configuration service (diff)
downloadkernel-qcow2-linux-5413b4c6c07b659e52c84a4e40d897b32b89834f.tar.gz
kernel-qcow2-linux-5413b4c6c07b659e52c84a4e40d897b32b89834f.tar.xz
kernel-qcow2-linux-5413b4c6c07b659e52c84a4e40d897b32b89834f.zip
tipc: Improve handling of invalid link tolerance values
Enhances TIPC link code to ignore an invalid link tolerance value contained in an incoming LINK_PROTOCOL message, rather than processing the value and potentially causing a divide-by-zero error. Also add a compile-time check that catches attempts to redefine TIPC's minimum link tolerance value in a manner that might result in the same divide-by-zero error at run-time. Signed-off-by: Allan Stephens <Allan.Stephens@windriver.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Diffstat (limited to 'include/linux/tipc_config.h')
-rw-r--r--include/linux/tipc_config.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h
index 7d42460a5e3c..c14102dee22e 100644
--- a/include/linux/tipc_config.h
+++ b/include/linux/tipc_config.h
@@ -193,6 +193,10 @@
#define TIPC_DEF_LINK_TOL 1500
#define TIPC_MAX_LINK_TOL 30000
+#if (TIPC_MIN_LINK_TOL < 16)
+#error "TIPC_MIN_LINK_TOL is too small (abort limit may be NaN)"
+#endif
+
/*
* Link window limits (min, default, max), in packets
*/