Re: [PATCH 8/8] pstore/ram: Correctly calculate usable PRZ bytes

2018-11-05 Thread Joel Fernandes
On Mon, Nov 05, 2018 at 09:04:13AM -0800, Kees Cook wrote: > On Sun, Nov 4, 2018 at 8:42 PM, Joel Fernandes wrote: > > Dumping the magic bytes of the non decompressable .enc.z files, I get this > > which shows a valid zlib compressed header: > > > > Something like: > > 48 89 85 54 4d 6f 1a 31 > >

Re: [PATCH 8/8] pstore/ram: Correctly calculate usable PRZ bytes

2018-11-05 Thread Kees Cook
On Sun, Nov 4, 2018 at 8:42 PM, Joel Fernandes wrote: > Dumping the magic bytes of the non decompressable .enc.z files, I get this > which shows a valid zlib compressed header: > > Something like: > 48 89 85 54 4d 6f 1a 31 > > The 0b1000 in the first byte means it is "deflate". The file tool indee

Re: [PATCH 8/8] pstore/ram: Correctly calculate usable PRZ bytes

2018-11-04 Thread Joel Fernandes
Hi Kees, On Fri, Nov 02, 2018 at 01:00:08PM -0700, Kees Cook wrote: [..] > >> This corruption was visible with "ramoops.mem_size=204800 ramoops.ecc=1". > >> Any stored crashes would not be uncompressable (producing a pstorefs > >> "dmesg-*.enc.z" file), and triggering errors at boot: > >> > >>

Re: [PATCH 8/8] pstore/ram: Correctly calculate usable PRZ bytes

2018-11-02 Thread Kees Cook
On Fri, Nov 2, 2018 at 11:01 AM, Joel Fernandes wrote: > On Thu, Nov 01, 2018 at 04:52:00PM -0700, Kees Cook wrote: >> The actual number of bytes stored in a PRZ is smaller than the >> bytes requested by platform data, since there is a header on each >> PRZ. Additionally, if ECC is enabled, there

Re: [PATCH 8/8] pstore/ram: Correctly calculate usable PRZ bytes

2018-11-02 Thread Joel Fernandes
On Thu, Nov 01, 2018 at 04:52:00PM -0700, Kees Cook wrote: > The actual number of bytes stored in a PRZ is smaller than the > bytes requested by platform data, since there is a header on each > PRZ. Additionally, if ECC is enabled, there are trailing bytes used > as well. Normally this mismatch doe

[PATCH 8/8] pstore/ram: Correctly calculate usable PRZ bytes

2018-11-01 Thread Kees Cook
The actual number of bytes stored in a PRZ is smaller than the bytes requested by platform data, since there is a header on each PRZ. Additionally, if ECC is enabled, there are trailing bytes used as well. Normally this mismatch doesn't matter since PRZs are circular buffers and the leading "overfl