mm: kasan: remove unused 'reserved' field from struct kasan_alloc_meta
[deliverable/linux.git] / mm / kasan / kasan.h
index 30a2f0ba0e097e0b270f58be50bcd7ff7e4177fa..fb87923552ef2b90c65847fdb5c56644560ca7ec 100644 (file)
@@ -62,6 +62,7 @@ struct kasan_global {
 enum kasan_state {
        KASAN_STATE_INIT,
        KASAN_STATE_ALLOC,
+       KASAN_STATE_QUARANTINE,
        KASAN_STATE_FREE
 };
 
@@ -76,12 +77,16 @@ struct kasan_alloc_meta {
        struct kasan_track track;
        u32 state : 2;  /* enum kasan_state */
        u32 alloc_size : 30;
-       u32 reserved;
 };
 
+struct qlist_node {
+       struct qlist_node *next;
+};
 struct kasan_free_meta {
-       /* Allocator freelist pointer, unused by KASAN. */
-       void **freelist;
+       /* This field is used while the object is in the quarantine.
+        * Otherwise it might be used for the allocator freelist.
+        */
+       struct qlist_node quarantine_link;
        struct kasan_track track;
 };
 
@@ -105,4 +110,15 @@ static inline bool kasan_report_enabled(void)
 void kasan_report(unsigned long addr, size_t size,
                bool is_write, unsigned long ip);
 
+#ifdef CONFIG_SLAB
+void quarantine_put(struct kasan_free_meta *info, struct kmem_cache *cache);
+void quarantine_reduce(void);
+void quarantine_remove_cache(struct kmem_cache *cache);
+#else
+static inline void quarantine_put(struct kasan_free_meta *info,
+                               struct kmem_cache *cache) { }
+static inline void quarantine_reduce(void) { }
+static inline void quarantine_remove_cache(struct kmem_cache *cache) { }
+#endif
+
 #endif
This page took 0.024795 seconds and 5 git commands to generate.