summaryrefslogtreecommitdiffstats
path: root/sys/sys/signal.h
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2001-04-18 22:18:39 +0000
committeralfred <alfred@FreeBSD.org>2001-04-18 22:18:39 +0000
commit3405c2ccfaa89a7eae96cd33fc941b60ba3f2ceb (patch)
tree1a78f947f681ecfa0a4ea98318a2d0311d11b38d /sys/sys/signal.h
parenta222601bea58d10488a2942c409fda3e5890ea4c (diff)
downloadFreeBSD-src-3405c2ccfaa89a7eae96cd33fc941b60ba3f2ceb.zip
FreeBSD-src-3405c2ccfaa89a7eae96cd33fc941b60ba3f2ceb.tar.gz
Check validity of signal callback requested via aio routines.
Also move the insertion of the request to after the request is validated, there's still looks like there may be some problems if an invalid address is passed to the aio routines, basically a possible leak or having a not completely initialized structure on the queue may still be possible. A new sig macro was made _SIG_VALID to check the validity of a signal, it would be advisable to use it from now on (in kern/kern_sig.c) rather than rolling your own. PR: kern/17152
Diffstat (limited to 'sys/sys/signal.h')
-rw-r--r--sys/sys/signal.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/sys/signal.h b/sys/sys/signal.h
index 95891ff..ebbc4f5 100644
--- a/sys/sys/signal.h
+++ b/sys/sys/signal.h
@@ -53,6 +53,7 @@
#define _SIG_IDX(sig) ((sig) - 1)
#define _SIG_WORD(sig) (_SIG_IDX(sig) >> 5)
#define _SIG_BIT(sig) (1 << (_SIG_IDX(sig) & 31))
+#define _SIG_VALID(sig) ((sig) < _SIG_MAXSIG && (sig) > 0)
/*
* System defined signals.
OpenPOWER on IntegriCloud