Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
systemd
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
steam
systemd
Commits
e86b80b8
Commit
e86b80b8
authored
Apr 12, 2013
by
Lennart Poettering
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bus: don't calculate kmsg message too large
parent
3583882c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
src/libsystemd-bus/bus-internal.c
src/libsystemd-bus/bus-internal.c
+0
-1
src/libsystemd-bus/bus-kernel.c
src/libsystemd-bus/bus-kernel.c
+6
-2
src/shared/macro.h
src/shared/macro.h
+2
-0
No files found.
src/libsystemd-bus/bus-internal.c
View file @
e86b80b8
...
@@ -141,7 +141,6 @@ bool service_name_is_valid(const char *p) {
...
@@ -141,7 +141,6 @@ bool service_name_is_valid(const char *p) {
return
false
;
return
false
;
return
true
;
return
true
;
}
}
bool
member_name_is_valid
(
const
char
*
p
)
{
bool
member_name_is_valid
(
const
char
*
p
)
{
...
...
src/libsystemd-bus/bus-kernel.c
View file @
e86b80b8
...
@@ -57,23 +57,27 @@ static void append_payload_vec(struct kdbus_msg_data **d, const void *p, size_t
...
@@ -57,23 +57,27 @@ static void append_payload_vec(struct kdbus_msg_data **d, const void *p, size_t
assert
(
p
);
assert
(
p
);
assert
(
sz
>
0
);
assert
(
sz
>
0
);
*
d
=
ALIGN8_PTR
(
*
d
);
(
*
d
)
->
size
=
offsetof
(
struct
kdbus_msg_data
,
vec
)
+
sizeof
(
struct
kdbus_vec
);
(
*
d
)
->
size
=
offsetof
(
struct
kdbus_msg_data
,
vec
)
+
sizeof
(
struct
kdbus_vec
);
(
*
d
)
->
type
=
KDBUS_MSG_PAYLOAD_VEC
;
(
*
d
)
->
type
=
KDBUS_MSG_PAYLOAD_VEC
;
(
*
d
)
->
vec
.
address
=
(
uint64_t
)
p
;
(
*
d
)
->
vec
.
address
=
(
uint64_t
)
p
;
(
*
d
)
->
vec
.
size
=
sz
;
(
*
d
)
->
vec
.
size
=
sz
;
*
d
=
(
struct
kdbus_msg_data
*
)
((
uint8_t
*
)
*
d
+
ALIGN8
((
*
d
)
->
size
)
);
*
d
=
(
struct
kdbus_msg_data
*
)
((
uint8_t
*
)
*
d
+
(
*
d
)
->
size
);
}
}
static
void
append_destination
(
struct
kdbus_msg_data
**
d
,
const
char
*
s
,
size_t
length
)
{
static
void
append_destination
(
struct
kdbus_msg_data
**
d
,
const
char
*
s
,
size_t
length
)
{
assert
(
d
);
assert
(
d
);
assert
(
d
);
assert
(
d
);
*
d
=
ALIGN8_PTR
(
*
d
);
(
*
d
)
->
size
=
offsetof
(
struct
kdbus_msg_data
,
str
)
+
length
+
1
;
(
*
d
)
->
size
=
offsetof
(
struct
kdbus_msg_data
,
str
)
+
length
+
1
;
(
*
d
)
->
type
=
KDBUS_MSG_DST_NAME
;
(
*
d
)
->
type
=
KDBUS_MSG_DST_NAME
;
memcpy
((
*
d
)
->
str
,
s
,
length
+
1
);
memcpy
((
*
d
)
->
str
,
s
,
length
+
1
);
*
d
=
(
struct
kdbus_msg_data
*
)
((
uint8_t
*
)
*
d
+
ALIGN8
((
*
d
)
->
size
)
);
*
d
=
(
struct
kdbus_msg_data
*
)
((
uint8_t
*
)
*
d
+
(
*
d
)
->
size
);
}
}
static
int
bus_message_setup_kmsg
(
sd_bus_message
*
m
)
{
static
int
bus_message_setup_kmsg
(
sd_bus_message
*
m
)
{
...
...
src/shared/macro.h
View file @
e86b80b8
...
@@ -65,6 +65,8 @@
...
@@ -65,6 +65,8 @@
#error "Wut? Pointers are neither 4 nor 8 bytes long?"
#error "Wut? Pointers are neither 4 nor 8 bytes long?"
#endif
#endif
#define ALIGN8_PTR(p) ((void*) ALIGN8((unsigned long) p))
static
inline
size_t
ALIGN_TO
(
size_t
l
,
size_t
ali
)
{
static
inline
size_t
ALIGN_TO
(
size_t
l
,
size_t
ali
)
{
return
((
l
+
ali
-
1
)
&
~
(
ali
-
1
));
return
((
l
+
ali
-
1
)
&
~
(
ali
-
1
));
}
}
...
...
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