* must be the same.
  */
 static bool rb_meta_valid(struct ring_buffer_meta *meta, int cpu,
-                         struct trace_buffer *buffer, int nr_pages)
+                         struct trace_buffer *buffer, int nr_pages,
+                         unsigned long *subbuf_mask)
 {
        int subbuf_size = PAGE_SIZE;
        struct buffer_data_page *subbuf;
        unsigned long buffers_end;
        int i;
 
+       if (!subbuf_mask)
+               return false;
+
        /* Check the meta magic and meta struct size */
        if (meta->magic != RING_BUFFER_META_MAGIC ||
            meta->struct_size != sizeof(*meta)) {
 
        subbuf = rb_subbufs_from_meta(meta);
 
+       bitmap_clear(subbuf_mask, 0, meta->nr_subbufs);
+
        /* Is the meta buffers and the subbufs themselves have correct data? */
        for (i = 0; i < meta->nr_subbufs; i++) {
                if (meta->buffers[i] < 0 ||
                        return false;
                }
 
+               if (test_bit(meta->buffers[i], subbuf_mask)) {
+                       pr_info("Ring buffer boot meta [%d] array has duplicates\n", cpu);
+                       return false;
+               }
+
+               set_bit(meta->buffers[i], subbuf_mask);
                subbuf = (void *)subbuf + subbuf_size;
        }
 
 static void rb_range_meta_init(struct trace_buffer *buffer, int nr_pages)
 {
        struct ring_buffer_meta *meta;
+       unsigned long *subbuf_mask;
        unsigned long delta;
        void *subbuf;
        int cpu;
        int i;
 
+       /* Create a mask to test the subbuf array */
+       subbuf_mask = bitmap_alloc(nr_pages + 1, GFP_KERNEL);
+       /* If subbuf_mask fails to allocate, then rb_meta_valid() will return false */
+
        for (cpu = 0; cpu < nr_cpu_ids; cpu++) {
                void *next_meta;
 
                meta = rb_range_meta(buffer, nr_pages, cpu);
 
-               if (rb_meta_valid(meta, cpu, buffer, nr_pages)) {
+               if (rb_meta_valid(meta, cpu, buffer, nr_pages, subbuf_mask)) {
                        /* Make the mappings match the current address */
                        subbuf = rb_subbufs_from_meta(meta);
                        delta = (unsigned long)subbuf - meta->first_buffer;
                        subbuf += meta->subbuf_size;
                }
        }
+       bitmap_free(subbuf_mask);
 }
 
 static void *rbm_start(struct seq_file *m, loff_t *pos)