Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
relibc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Peter Limkilde Svendsen
relibc
Commits
f7d9f4e2
Verified
Commit
f7d9f4e2
authored
8 months ago
by
Jacob Lorentzon
Browse files
Options
Downloads
Patches
Plain Diff
Fix infinite loop & spurious signals for i686.
parent
b71c34dd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
redox-rt/src/arch/i686.rs
+23
-3
23 additions, 3 deletions
redox-rt/src/arch/i686.rs
with
23 additions
and
3 deletions
redox-rt/src/arch/i686.rs
+
23
−
3
View file @
f7d9f4e2
...
...
@@ -155,7 +155,7 @@ asmfunction!(__relibc_internal_sigentry: ["
// Try clearing the pending bit, otherwise retry if another thread did that first
lock btr [ecx + {pctl_word}], eax
jc 1b
j
n
c 1b
jmp 2f
3:
// Read realtime thread and process signal word together
...
...
@@ -170,7 +170,7 @@ asmfunction!(__relibc_internal_sigentry: ["
jc 8f
lock btr [ecx + {pctl_word} + 4], eax
jc 1b
j
n
c 1b
add eax, 32
jmp 2f
8:
...
...
@@ -238,7 +238,23 @@ __relibc_internal_sigentry_crit_first:
__relibc_internal_sigentry_crit_second:
jmp dword ptr gs:[{tcb_sa_off} + {sa_tmp_eip}]
7:
ud2
mov eax, gs:[0]
lea esp, [eax + {tcb_sc_off} + {sc_saved_eflags}]
popfd
mov esp, gs:[{tcb_sa_off} + {sa_tmp_esp}]
mov eax, gs:[{tcb_sc_off} + {sc_saved_eip}]
mov gs:[{tcb_sa_off} + {sa_tmp_eip}], eax
mov eax, gs:[{tcb_sa_off} + {sa_tmp_eax}]
mov ecx, gs:[{tcb_sa_off} + {sa_tmp_ecx}]
mov edx, gs:[{tcb_sa_off} + {sa_tmp_edx}]
and dword ptr gs:[{tcb_sc_off} + {sc_control}], ~1
.globl __relibc_internal_sigentry_crit_third
__relibc_internal_sigentry_crit_third:
jmp dword ptr gs:[{tcb_sa_off} + {sa_tmp_eip}]
"
]
<=
[
inner
=
sym
inner_fastcall
,
sa_tmp_eip
=
const
offset_of!
(
SigArea
,
tmp_eip
),
...
...
@@ -249,6 +265,7 @@ __relibc_internal_sigentry_crit_second:
sa_altstack_top
=
const
offset_of!
(
SigArea
,
altstack_top
),
sa_altstack_bottom
=
const
offset_of!
(
SigArea
,
altstack_bottom
),
sa_pctl
=
const
offset_of!
(
SigArea
,
pctl
),
sc_control
=
const
offset_of!
(
Sigcontrol
,
control_flags
),
sc_saved_eflags
=
const
offset_of!
(
Sigcontrol
,
saved_archdep_reg
),
sc_saved_eip
=
const
offset_of!
(
Sigcontrol
,
saved_ip
),
sc_word
=
const
offset_of!
(
Sigcontrol
,
word
),
...
...
@@ -281,6 +298,7 @@ asmfunction!(__relibc_internal_rlct_clone_ret -> usize: ["
extern
"C"
{
fn
__relibc_internal_sigentry_crit_first
();
fn
__relibc_internal_sigentry_crit_second
();
fn
__relibc_internal_sigentry_crit_third
();
}
pub
unsafe
fn
arch_pre
(
stack
:
&
mut
SigStack
,
area
:
&
mut
SigArea
)
{
if
stack
.regs.eip
==
__relibc_internal_sigentry_crit_first
as
usize
{
...
...
@@ -289,6 +307,8 @@ pub unsafe fn arch_pre(stack: &mut SigStack, area: &mut SigArea) {
stack
.regs.eip
=
stack_ptr
.sub
(
1
)
.read
();
}
else
if
stack
.regs.eip
==
__relibc_internal_sigentry_crit_second
as
usize
{
stack
.regs.eip
=
area
.tmp_eip
;
}
else
if
stack
.regs.eip
==
__relibc_internal_sigentry_crit_third
as
usize
{
stack
.regs.eip
=
area
.tmp_eip
;
}
}
#[no_mangle]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment