Re: [RFC] Persist ima logs to disk

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

 



On Tue, Jan 5, 2021 at 9:57 PM Raphael Gianotti
<raphgi@xxxxxxxxxxxxxxxxxxx> wrote:

> In a thread with Janne Karhunen[2], it was mentioned that another
> approach, using mm had been considered. Upon some investigation the
> approach used in this RFC still seemed adequate for solving this
> problem.

Curious to hear in more detail where did this land?

Not sure I remember this correctly anymore, but wouldn't it be
possible to have mmap'd tmpfile at address __heap of size __heap_sz
and have something this simple pulling memory from it?

uint8_t *get_static_buffer(size_t size)
{
        static size_t buf_index;
        uint8_t *bufp = NULL;

        size = ROUND_UP(size, sizeof(double));
        if ((buf_index + size) >= __heap_sz)
                return NULL;

        bufp = (uint8_t *)__heap + buf_index;
        buf_index += size;
        *bufp = 0;

        return bufp;
}

Then just replace every related measurement list allocation with this
get_static_buffer and that would be pretty much all there is to it?

The mm code should automatically push those pages out when it needs
memory. It will also read those pages back in when someone scans
through the measurement list creating a nicely formatted one. I think.


--
Janne



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux Kernel]     [Linux Kernel Hardening]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux