Linux????е???????????????
???????????? ???????[ 2013/2/25 10:12:12 ] ????????
????3?????????????????????н???????????ν????????????????????????????pt_regs?е?pc??????????????????????????????????????????????????????????????????????????????????????????????????????????sys_sigreturn()?????????sys_rt_sigreturn()??????????ε???sys_sigreturn()????????????????????????????sigreturn()????????e?????????????????????????????е???????????????????????????????????????β????sigreturn()???????????????arm-linux-gcc???????????????????????regs??ARM_lr?????
regs->ARM_lr = retcode;
??????????????????????н?????????lr?????????????????????????regs????????????δ???????????????lr??????????????????????????????????sys_sigreturn()????????
????4????????????sys_sigreturn()??????????????????????????????????????????(?????????÷????????????)??????????????????pt_regs???????????sys_sigreturn()??????????????????е?pt_regs???????????η?????????????????????????????“????”????????????pt_regs?????????ж????????????????????????????????pt_regs?????????????????????????????????????????????pt_regs?????????????????У?λ????????????????????????sys_sigreturn()??ν???????????????????仹???????pt_regs?????????????
????????????????????????????????????????У??????????????????????????????????????sigframe????
/*
* Do a signal return; undo the signal stack. These are aligned to 64-bit.
*/
struct sigframe {
struct sigcontext sc;//?????????????????
unsigned long extramask[_NSIG_WORDS-1];
unsigned long retcode;//???淵????
struct aux_sigframe aux __attribute__((aligned(8)));
};
struct rt_sigframe {
struct siginfo __user *pinfo;
void __user *puc;
struct siginfo info;
struct ucontext uc;
unsigned long retcode;
struct aux_sigframe aux __attribute__((aligned(8)));
};
???????е?sigcontext????????????pt_regs?????????????????????????pt_regs????????????????????????sigframe???????get_sigframe()?????????????????????get_sigframe()???????£?
static inline void __user *
get_sigframe(struct k_sigaction *ka?? struct pt_regs *regs?? int framesize)
{
unsigned long sp = regs->ARM_sp;
void __user *frame;
/*
* This is the X/Open sanctioned signal stack switching.
*/
if ((ka->sa.sa_flags & SA_ONSTACK) && !sas_ss_flags(sp))
sp = current->sas_ss_sp + current->sas_ss_size;
/*
* ATPCS B01 mandates 8-byte alignment
*/
frame = (void __user *)((sp - framesize) & ~7);
/*
* Check that we can actually write to the signal frame.
*/
if (!access_ok(VERIFY_WRITE?? frame?? framesize))
frame = NULL;
return frame;
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11