X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;ds=sidebyside;f=libringbuffer%2Fshm.h;h=22c9afdcbd2beaf557aa894ca37cd975908f3b37;hb=58d4b2a2484f1d6277c5553a661cf161a9de9af3;hp=9f72a5a248657f73c3176877d2e6357930dd10db;hpb=cba4b7a3bf98faff4c905f71064f7d66b9869e79;p=lttng-ust.git 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,