Skip to content

Commit

Permalink
base: buffer: allow sealing operations on memfd
Browse files Browse the repository at this point in the history
  • Loading branch information
prajnoha committed Jan 20, 2021
1 parent 9eaf259 commit 99b185d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/base/buffer-type-linear.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static int _buffer_linear_realloc(struct buffer *buf, size_t needed, int force)

case BUFFER_BACKEND_MEMFD:
if (buf->fd == -1 &&
(buf->fd = memfd_create("buffer", MFD_CLOEXEC)) < 0)
(buf->fd = memfd_create("buffer", MFD_CLOEXEC | MFD_ALLOW_SEALING)) < 0)
return -errno;

if (ftruncate(buf->fd, needed) < 0)
Expand Down
2 changes: 1 addition & 1 deletion src/base/buffer-type-vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static int _buffer_vector_realloc(struct buffer *buf, size_t needed, int force)

case BUFFER_BACKEND_MEMFD:
if (buf->fd == -1 &&
(buf->fd = memfd_create("buffer", MFD_CLOEXEC)) < 0)
(buf->fd = memfd_create("buffer", MFD_CLOEXEC | MFD_ALLOW_SEALING)) < 0)
return -errno;

if (ftruncate(buf->fd, needed * VECTOR_ITEM_SIZE) < 0)
Expand Down

0 comments on commit 99b185d

Please sign in to comment.