Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allocate a new keyring if we can to prevent information leak. Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
- Loading branch information
Christian Brauner
committed
Sep 28, 2018
1 parent
c73fbad
commit b25291d
Showing
6 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* liblxcapi | ||
* | ||
* Copyright © 2018 Christian Brauner <christian.brauner@ubuntu.com>. | ||
* Copyright © 2018 Canonical Ltd. | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2, as | ||
* published by the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along | ||
* with this program; if not, write to the Free Software Foundation, Inc., | ||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
*/ | ||
|
||
#ifndef __LXC_SYSCALL_WRAPPER_H | ||
#define __LXC_SYSCALL_WRAPPER_H | ||
|
||
#ifndef _GNU_SOURCE | ||
#define _GNU_SOURCE 1 | ||
#endif | ||
#include <asm/unistd.h> | ||
#include <linux/keyctl.h> | ||
#include <stdint.h> | ||
#include <sys/syscall.h> | ||
#include <sys/types.h> | ||
#include <unistd.h> | ||
|
||
#include "config.h" | ||
|
||
typedef int32_t key_serial_t; | ||
|
||
#if !HAVE_KEYCTL | ||
static inline long __keyctl(int cmd, unsigned long arg2, unsigned long arg3, | ||
unsigned long arg4, unsigned long arg5) | ||
{ | ||
#ifdef __NR_keyctl | ||
return syscall(__NR_keyctl, cmd, arg2, arg3, arg4, arg5); | ||
#else | ||
errno = ENOSYS; | ||
return -1; | ||
#endif | ||
} | ||
#define keyctl __keyctl | ||
#endif | ||
|
||
#endif /* __LXC_SYSCALL_WRAPPER_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters