Re: [PATCH 2/3] pstore/ram: Switch to persistent_ram routines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 17, 2012 at 09:34:19AM -0700, Kees Cook wrote:
[...]
> > -       memcpy(buf, cxt->pstore.buf, size);
> > -       memset(buf + size, '\0', available - size);
> > +       hlen = ramoops_write_kmsg_hdr(prz);
> > +       if (size + hlen > prz->buffer_size)
> > +               size = prz->buffer_size - hlen;
> > +       persistent_ram_write(prz, cxt->pstore.buf, size);
> 
> This still needs to wipe out the remaining bytes in the buffer (the
> second memset above).
[...]
> > -       buf = cxt->virt_addr + (id * cxt->record_size);
> > -       memset(buf, '\0', cxt->record_size);
> > +       persistent_ram_free_old(cxt->przs[id]);
> 
> Same here -- erasing the buffer means wiping it with NULL bytes.

Well, with persistent_ram we don't need to actually erase buffers
(with persistent_ram we might even hold binary data). But yes,
we'd better reset size pointer, otherwise the unlinked buffer
will show up on the next reboot. Thanks for noticing!

-- 
Anton Vorontsov
Email: cbouatmailru@xxxxxxxxx
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux