mirror of
https://github.com/systemd/systemd.git
synced 2024-11-02 19:21:53 +03:00
bus: seal off memfds when sealing messages
This commit is contained in:
parent
9b05bc4866
commit
47e6ce32bb
@ -3555,8 +3555,10 @@ int bus_message_parse_fields(sd_bus_message *m) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int bus_message_seal(sd_bus_message *m, uint64_t serial) {
|
int bus_message_seal(sd_bus_message *m, uint64_t serial) {
|
||||||
int r;
|
struct bus_body_part *part;
|
||||||
size_t l, a;
|
size_t l, a;
|
||||||
|
unsigned i;
|
||||||
|
int r;
|
||||||
|
|
||||||
assert(m);
|
assert(m);
|
||||||
|
|
||||||
@ -3595,6 +3597,10 @@ int bus_message_seal(sd_bus_message *m, uint64_t serial) {
|
|||||||
m->header->fields_size -= a;
|
m->header->fields_size -= a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (i = 0, part = &m->body; i < m->n_body_parts; i++, part = part->next)
|
||||||
|
if (part->memfd >= 0 && part->sealed)
|
||||||
|
ioctl(part->memfd, KDBUS_CMD_MEMFD_SEAL_SET, 1);
|
||||||
|
|
||||||
m->header->serial = serial;
|
m->header->serial = serial;
|
||||||
m->sealed = true;
|
m->sealed = true;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user