set_fs() get_fs and general protection fault

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

 



Hi all,
I'm developing a module that checkpoints thread
processes.
In order to do the checkpoint, I use get_fs() and
set_fs() instructions. The way I use them is as
follow:

checkpoint_function()
{
   fs = get_fs();
   set_fs(KERNEL_DS);

   INSTRUCTIONS TO SAVE MEMORY DESCRIPTOR

   set_fs(fs);
}

restore_function()
{
   fs = get_fs();
   set_fs(KERNEL_DS);

   INSTRUCTIONS TO RESTORE MEMORY DESCRIPTOR

   set_fs(fs);
}

When I execute checkpoint_function(), all seems to go
well. 
But when I execute restore_function, a "general
protection fault" error is returned.
If I omit the instructions get_fs and set_fs, no error
of this type is returned (but the checkpoint does not
work well).
Can anyone help me on the usage of these instructions.
I've also found some previous emails regarding them,
but I've not well understood in which way get_fs and
set_fs must be applied in my module.
I've also read some checkpoint tools, e.g. CRACK, in
which they are used in about the same way I do it.
Thanks.
Vincenzo Mallozzi.


		
___________________________________ 
Nuovo Yahoo! Messenger: E' molto più divertente: Audibles, Avatar, Webcam, Giochi, Rubrica? Scaricalo ora! 
http://it.messenger.yahoo.it

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux