Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
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
bcc
Commits
b341d8fd
Commit
b341d8fd
authored
May 05, 2018
by
Paul Chaignon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tests for dereferences of struct with external pointers as members
parent
c2b87ba2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
0 deletions
+26
-0
tests/python/test_clang.py
tests/python/test_clang.py
+26
-0
No files found.
tests/python/test_clang.py
View file @
b341d8fd
...
@@ -343,6 +343,32 @@ int kprobe____kmalloc(struct pt_regs *ctx, size_t size) {
...
@@ -343,6 +343,32 @@ int kprobe____kmalloc(struct pt_regs *ctx, size_t size) {
return 0;
return 0;
}"""
)
}"""
)
def
test_probe_simple_member_assign
(
self
):
b
=
BPF
(
text
=
"""
#include <uapi/linux/ptrace.h>
#include <linux/netdevice.h>
struct leaf { void *ptr; };
int test(struct pt_regs *ctx, struct sk_buff *skb) {
struct leaf l = {};
struct leaf *lp = &l;
lp->ptr = skb;
return 0;
}"""
)
b
.
load_func
(
"test"
,
BPF
.
KPROBE
)
def
test_probe_member_expr
(
self
):
b
=
BPF
(
text
=
"""
#include <uapi/linux/ptrace.h>
#include <linux/netdevice.h>
struct leaf { struct sk_buff *ptr; };
int test(struct pt_regs *ctx, struct sk_buff *skb) {
struct leaf l = {};
struct leaf *lp = &l;
lp->ptr = skb;
return lp->ptr->priority;
}"""
)
b
.
load_func
(
"test"
,
BPF
.
KPROBE
)
def
test_unop_probe_read
(
self
):
def
test_unop_probe_read
(
self
):
text
=
"""
text
=
"""
#include <linux/blkdev.h>
#include <linux/blkdev.h>
...
...
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