Hi,
On Thursday, 18 January 2007 15:04, Michal Schmidt wrote:
> Hi,
>
> When saving the image, uswsusp measures the time it takes and saves it
> in the writeout_time member of struct swsusp_info. During resume the
> information is printed. I found this feature useful. Unfortunately, it
> doesn't work when configured with CONFIG_ENCRYPT=yes.
>
> The reason is that struct swsusp_info doesn't fit into one page anymore
> and the overflowing pieces are not saved. On my i386 system I have:
> sizeof(struct swsusp_info) == 4568
> page_size == 4096
> Therefore part of key.data array overflows (only the first 538 bytes of
> 1000 fit into the page) and of course writeout_time is not saved at all.
>
> Bits of key.data getting lost seems scary at first, but we are lucky -
> we use the maximum key size of 4096 bits (512 bytes). So the overflowing
> bytes of key.data were never used.
>
> The solution is to decrease KEY_DATA_SIZE to 512. We know we never need
> more than that. The attached patch does that. And just in case we want
> to use larger keys in the future, it checks that the encrypted key fits
> into the buffer.
Hm, as far as I remember, key_data is not just plain key and it can be
greater than 512 bytes. And that would explain one bug report related to
the encryption with RSA.
Frankly, I have to check the code, but that will need to wait for a couple of
days.
Now, I think we can fix all that by using two pages for the header, but it
would complicate things a bit (not too much, but still).
Greetings,
Rafael
--
If you don't have the time to read,
you don't have the time or the tools to write.
- Stephen King
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Suspend-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/suspend-devel