Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pmaports
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
postmarketOS
pmaports
Commits
905b4e31
Unverified
Commit
905b4e31
authored
6 years ago
by
Valentin Marinov
Committed by
Oliver Smith
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
linux-sony-amami: Backport getrandom to support libressl on linux < 3.17
parent
45c0d685
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
device/linux-sony-amami/APKBUILD
+3
-1
3 additions, 1 deletion
device/linux-sony-amami/APKBUILD
device/linux-sony-amami/downstream-backport-getrandom.patch
+127
-0
127 additions, 0 deletions
device/linux-sony-amami/downstream-backport-getrandom.patch
with
130 additions
and
1 deletion
device/linux-sony-amami/APKBUILD
+
3
−
1
View file @
905b4e31
...
...
@@ -26,6 +26,7 @@ source="
$_config
gcc7-give-up-on-ilog2-const-optimizations.patch
gcc8-fix-put-user.patch
downstream-backport-getrandom.patch
"
builddir
=
"
$srcdir
/
${
_repository
}
-
${
_commit
}
"
...
...
@@ -64,4 +65,5 @@ package() {
sha512sums
=
"fae2299d9d36956be71f40ae724ac0a5069b53d440c114184f82495550c76743e9275e37ad00f6d4a012d32e91a580f424cdb1a1222647c5f2fd678a405a225f linux-sony-amami-2134cafba220b32c43701368413ee333b41b7fe0.tar.gz
0896618a3bb536dc5f8d9932fe704e8f279000207054039bf8df25e89fb9b2d7d70175cbc4af2ee42982ff7af39fd98c41ec5d79d517a36d9ac3fad5344ce615 config-sony-amami.armhf
77eba606a71eafb36c32e9c5fe5e77f5e4746caac292440d9fb720763d766074a964db1c12bc76fe583c5d1a5c864219c59941f5e53adad182dbc70bf2bc14a7 gcc7-give-up-on-ilog2-const-optimizations.patch
00ef6044df2e904289fcbbe268c0200e94b085c374e6126b7f8ff7763285c689bafe9781dc17b85b3684d1d438f3839891925d6ca892ddb6610e68f12e3784a2 gcc8-fix-put-user.patch"
00ef6044df2e904289fcbbe268c0200e94b085c374e6126b7f8ff7763285c689bafe9781dc17b85b3684d1d438f3839891925d6ca892ddb6610e68f12e3784a2 gcc8-fix-put-user.patch
b921570e799682d3ac6bff5dae2c7a69da24cd6988e57605fea0bd039e8b677e8335e11846c51798a5fb15011eaf0495fe6a410833a244319140798d7b70fea1 downstream-backport-getrandom.patch"
This diff is collapsed.
Click to expand it.
device/linux-sony-amami/downstream-backport-getrandom.patch
0 → 100644
+
127
−
0
View file @
905b4e31
diff --git a/arch/arm/include/asm/unistd.h b/arch/arm/include/asm/unistd.h
index 43876245..32640c43 100644
--- a/arch/arm/include/asm/unistd.h
+++ b/arch/arm/include/asm/unistd.h
@@ -15,7 +15,17 @@
#include <uapi/asm/unistd.h>
-#define __NR_syscalls (384)
+/*
+ * This may need to be greater than __NR_last_syscall+1 in order to
+ * account for the padding in the syscall table
+ */
+#define __NR_syscalls (388)
+
+/*
+ * *NOTE*: This is a ghost syscall private to the kernel. Only the
+ * __kuser_cmpxchg code in entry-armv.S should be aware of its
+ * existence. Don't ever use this from user code.
+ */
#define __ARM_NR_cmpxchg (__ARM_NR_BASE+0x00fff0)
#define __ARCH_WANT_STAT64
diff --git a/arch/arm/include/uapi/asm/unistd.h b/arch/arm/include/uapi/asm/unistd.h
index 86f5789d..ea1f4a74 100644
--- a/arch/arm/include/uapi/asm/unistd.h
+++ b/arch/arm/include/uapi/asm/unistd.h
@@ -408,15 +408,9 @@
#define __NR_finit_module (__NR_SYSCALL_BASE+379)
#define __NR_sched_setattr (__NR_SYSCALL_BASE+380)
#define __NR_sched_getattr (__NR_SYSCALL_BASE+381)
-/* Reserve for later
#define __NR_renameat2 (__NR_SYSCALL_BASE+382)
-*/
#define __NR_seccomp (__NR_SYSCALL_BASE+383)
-
-/*
- * This may need to be greater than __NR_last_syscall+1 in order to
- * account for the padding in the syscall table
- */
+#define __NR_getrandom (__NR_SYSCALL_BASE+384)
/*
* The following SWIs are ARM private.
diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
index b75c9688..7b866d48 100644
--- a/arch/arm/kernel/calls.S
+++ b/arch/arm/kernel/calls.S
@@ -391,9 +391,9 @@
CALL(sys_finit_module)
/* 380 */ CALL(sys_sched_setattr)
CALL(sys_sched_getattr)
- CALL(sys_ni_syscall) /* reserved sys_renameat2 */
+ CALL(sys_ni_syscall)
CALL(sys_seccomp)
-
+ CALL(sys_getrandom)
#ifndef syscalls_counted
.equ syscalls_padding, ((NR_syscalls + 3) & ~3) - NR_syscalls
#define syscalls_counted
diff --git a/arch/x86/syscalls/syscall_32.tbl b/arch/x86/syscalls/syscall_32.tbl
index 531bb142..fc853fb1 100644
--- a/arch/x86/syscalls/syscall_32.tbl
+++ b/arch/x86/syscalls/syscall_32.tbl
@@ -361,3 +361,4 @@
352 i386 sched_getattr sys_sched_getattr
# 353 i386 renameat2 sys_renameat2
354 i386 seccomp sys_seccomp
+355 i386 getrandom sys_getrandom
diff --git a/arch/x86/syscalls/syscall_64.tbl b/arch/x86/syscalls/syscall_64.tbl
index 1c7aebc4..c16897e6 100644
--- a/arch/x86/syscalls/syscall_64.tbl
+++ b/arch/x86/syscalls/syscall_64.tbl
@@ -324,6 +324,7 @@
315 common sched_getattr sys_sched_getattr
# 316 common renameat2 sys_renameat2
317 common seccomp sys_seccomp
+318 common getrandom sys_getrandom
#
# x32-specific system call numbers start at 512 to avoid cache impact
diff --git a/drivers/char/random.c b/drivers/char/random.c
index b020ebf4..2b58738d 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -681,7 +681,7 @@
retry:
r->entropy_total = 0;
if (r == &nonblocking_pool) {
prandom_reseed_late();
- wake_up_interruptible(&urandom_init_wait);
+ wake_up_all(&urandom_init_wait);
pr_notice("random: %s pool is initialized\n",
r->name);
}
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index a981ef05..46e2889d 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -759,6 +759,9 @@
asmlinkage long sys_linkat(int olddfd, const char __user *oldname,
int newdfd, const char __user *newname, int flags);
asmlinkage long sys_renameat(int olddfd, const char __user * oldname,
int newdfd, const char __user * newname);
+asmlinkage long sys_renameat2(int olddfd, const char __user *oldname,
+ int newdfd, const char __user *newname,
+ unsigned int flags);
asmlinkage long sys_futimesat(int dfd, const char __user *filename,
struct timeval __user *utimes);
asmlinkage long sys_faccessat(int dfd, const char __user *filename, int mode);
diff --git a/include/uapi/linux/random.h b/include/uapi/linux/random.h
index 8ae57842..d5066b6f 100644
--- a/include/uapi/linux/random.h
+++ b/include/uapi/linux/random.h
@@ -42,6 +42,14 @@
struct rand_pool_info {
/* Exported functions */
+/*
+ * Flags for getrandom(2)
+ *
+ * GRND_NONBLOCK Don't block and return EAGAIN instead
+ * GRND_RANDOM Use the /dev/random pool instead of /dev/urandom
+ */
+#define GRND_NONBLOCK 0x0001
+#define GRND_RANDOM 0x0002
/*
* Flags for getrandom(2)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment