Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
6adad2d5
Commit
6adad2d5
authored
Feb 26, 2010
by
Pekka Enberg
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'kmemcheck/fixes' into kmemcheck-for-linus
parents
60b341b7
81fc0390
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
3 deletions
+17
-3
arch/x86/mm/kmemcheck/kmemcheck.c
arch/x86/mm/kmemcheck/kmemcheck.c
+1
-1
arch/x86/mm/kmemcheck/shadow.c
arch/x86/mm/kmemcheck/shadow.c
+14
-2
arch/x86/mm/kmemcheck/shadow.h
arch/x86/mm/kmemcheck/shadow.h
+2
-0
No files found.
arch/x86/mm/kmemcheck/kmemcheck.c
View file @
6adad2d5
...
...
@@ -337,7 +337,7 @@ bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size)
if
(
!
shadow
)
return
true
;
status
=
kmemcheck_shadow_test
(
shadow
,
size
);
status
=
kmemcheck_shadow_test
_all
(
shadow
,
size
);
return
status
==
KMEMCHECK_SHADOW_INITIALIZED
;
}
...
...
arch/x86/mm/kmemcheck/shadow.c
View file @
6adad2d5
...
...
@@ -125,12 +125,12 @@ void kmemcheck_mark_initialized_pages(struct page *p, unsigned int n)
enum
kmemcheck_shadow
kmemcheck_shadow_test
(
void
*
shadow
,
unsigned
int
size
)
{
#ifdef CONFIG_KMEMCHECK_PARTIAL_OK
uint8_t
*
x
;
unsigned
int
i
;
x
=
shadow
;
#ifdef CONFIG_KMEMCHECK_PARTIAL_OK
/*
* Make sure _some_ bytes are initialized. Gcc frequently generates
* code to access neighboring bytes.
...
...
@@ -139,13 +139,25 @@ enum kmemcheck_shadow kmemcheck_shadow_test(void *shadow, unsigned int size)
if
(
x
[
i
]
==
KMEMCHECK_SHADOW_INITIALIZED
)
return
x
[
i
];
}
return
x
[
0
];
#else
return
kmemcheck_shadow_test_all
(
shadow
,
size
);
#endif
}
enum
kmemcheck_shadow
kmemcheck_shadow_test_all
(
void
*
shadow
,
unsigned
int
size
)
{
uint8_t
*
x
;
unsigned
int
i
;
x
=
shadow
;
/* All bytes must be initialized. */
for
(
i
=
0
;
i
<
size
;
++
i
)
{
if
(
x
[
i
]
!=
KMEMCHECK_SHADOW_INITIALIZED
)
return
x
[
i
];
}
#endif
return
x
[
0
];
}
...
...
arch/x86/mm/kmemcheck/shadow.h
View file @
6adad2d5
...
...
@@ -11,6 +11,8 @@ enum kmemcheck_shadow {
void
*
kmemcheck_shadow_lookup
(
unsigned
long
address
);
enum
kmemcheck_shadow
kmemcheck_shadow_test
(
void
*
shadow
,
unsigned
int
size
);
enum
kmemcheck_shadow
kmemcheck_shadow_test_all
(
void
*
shadow
,
unsigned
int
size
);
void
kmemcheck_shadow_set
(
void
*
shadow
,
unsigned
int
size
);
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment