Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
seL4
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Panda
seL4
Commits
06bd6e00
Commit
06bd6e00
authored
9 years ago
by
Adrian Danis
Committed by
Sophie Taylor
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
SELFOUR-420: Avoid indexing intStateIRQTable with an invalid IRQ
parent
603484f9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
haskell/src/SEL4/Object/Interrupt.lhs
+24
-16
24 additions, 16 deletions
haskell/src/SEL4/Object/Interrupt.lhs
src/object/interrupt.c
+10
-0
10 additions, 0 deletions
src/object/interrupt.c
with
34 additions
and
16 deletions
haskell/src/SEL4/Object/Interrupt.lhs
+
24
−
16
View file @
06bd6e00
...
...
@@ -165,22 +165,30 @@ This function is called when the kernel receives an interrupt event.
>
handleInterrupt
::
IRQ
->
Kernel
()
>
handleInterrupt
irq
=
do
>
st
<-
getIRQState
irq
>
case
st
of
>
IRQSignal
->
do
>
slot
<-
getIRQSlot
irq
>
cap
<-
getSlotCap
slot
>
case
cap
of
>
NotificationCap
{
capNtfnCanSend
=
True
}
->
>
sendSignal
(
capNtfnPtr
cap
)
(
capNtfnBadge
cap
)
>
_
->
doMachineOp
$
debugPrint
$
>
"Undelivered interrupt: "
++
show
irq
>
doMachineOp
$
maskInterrupt
True
irq
>
IRQTimer
->
do
>
timerTick
>
doMachineOp
resetTimer
>
IRQInactive
->
fail
$
"Received disabled IRQ "
++
show
irq
>
doMachineOp
$
ackInterrupt
irq
>
if
(
irq
>
maxIRQ
)
then
doMachineOp
$
(
do
mask, ack and pretend it didn't happen. We assume that because
the interrupt controller for the platform returned this IRQ that
it is safe to use in mask and ack operations, even though it is
above the claimed maxIRQ. i.e. we're assuming maxIRQ is wrong
> maskInterrupt True irq
> ackInterrupt irq)
> else do
> st <- getIRQState irq
> case st of
> IRQSignal -> do
> slot <- getIRQSlot irq
> cap <- getSlotCap slot
> case cap of
> NotificationCap { capNtfnCanSend = True } ->
> sendSignal (capNtfnPtr cap) (capNtfnBadge cap)
> _ -> doMachineOp $ debugPrint $
> "Undelivered interrupt: " ++ show irq
> doMachineOp $ maskInterrupt True irq
> IRQTimer -> do
> timerTick
> doMachineOp resetTimer
> IRQInactive -> fail $ "Received disabled IRQ " ++ show irq
> doMachineOp $ ackInterrupt irq
\subsection{Accessing the Global State}
...
...
This diff is collapsed.
Click to expand it.
src/object/interrupt.c
+
10
−
0
View file @
06bd6e00
...
...
@@ -179,6 +179,16 @@ deletedIRQHandler(irq_t irq)
void
handleInterrupt
(
irq_t
irq
)
{
if
(
irq
>
maxIRQ
)
{
/* mask, ack and pretend it didn't happen. We assume that because
* the interrupt controller for the platform returned this IRQ that
* it is safe to use in mask and ack operations, even though it is
* above the claimed maxIRQ. i.e. we're assuming maxIRQ is wrong */
printf
(
"Received IRQ %d, which is above the platforms maxIRQ of %d
\n
"
,
irq
,
maxIRQ
);
maskInterrupt
(
true
,
irq
);
ackInterrupt
(
irq
);
return
;
}
switch
(
intStateIRQTable
[
irq
])
{
case
IRQSignal
:
{
cap_t
cap
;
...
...
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