From ed5426d36fe2da648b4b16ec8173398558d8490f Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Sat, 20 Aug 2011 09:43:48 -0400 Subject: [PATCH] comment shm Signed-off-by: Mathieu Desnoyers --- libringbuffer/shm.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libringbuffer/shm.h b/libringbuffer/shm.h index 9f72a5a2..22c9afdc 100644 --- a/libringbuffer/shm.h +++ b/libringbuffer/shm.h @@ -17,6 +17,11 @@ /* * Pointer dereferencing. We don't trust the shm_ref, so we validate * both the index and offset with known boundaries. + * + * "shmp" and "shmp_index" guarantee that it's safe to use the pointer + * target type, even in the occurrence of shm_ref modification by an + * untrusted process having write access to the shm_ref. We return a + * NULL pointer if the ranges are invalid. */ static inline char *_shmp_offset(struct shm_object_table *table, struct shm_ref *ref, -- 2.34.1