diff options
author | Khem Raj <raj.khem@gmail.com> | 2020-02-14 14:33:34 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-02-15 10:26:42 +0000 |
commit | 0a3f0af9e3eaa295255ad1f3078d83b455511a4b (patch) | |
tree | a989ce18589a1758434c70a2d4a506a179f8ad83 /meta/recipes-support | |
parent | 6a7162e8069f7611bf85e9522493203ef4a26ef1 (diff) | |
download | poky-0a3f0af9e3eaa295255ad1f3078d83b455511a4b.tar.gz |
db: Fix timespec length assumptions
This should fix the vdso crashes seen with kernel 5.0+
python3[11312] general protection fault ip:b7e966b0 sp:bf8175cc error:0 in libc.so[b7e8b000+6b000]
(From OE-Core rev: a85afec1115f2a09cd750a4554f44fb8af96975c)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Bruce Ashfield <bruce.ashfield@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support')
-rw-r--r-- | meta/recipes-support/db/db/0001-clock-Do-not-define-own-timespec.patch | 45 | ||||
-rw-r--r-- | meta/recipes-support/db/db_5.3.28.bb | 1 |
2 files changed, 46 insertions, 0 deletions
diff --git a/meta/recipes-support/db/db/0001-clock-Do-not-define-own-timespec.patch b/meta/recipes-support/db/db/0001-clock-Do-not-define-own-timespec.patch new file mode 100644 index 0000000000..9d51a44a26 --- /dev/null +++ b/meta/recipes-support/db/db/0001-clock-Do-not-define-own-timespec.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | From 96b303caf70a7635953c36e5bfb9ad6e75cb7637 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 14 Feb 2020 14:12:59 -0800 | ||
4 | Subject: [PATCH] clock: Do not define own timespec | ||
5 | |||
6 | timespec is provided by libc and its best left to libc | ||
7 | os_gettime takes a db_timespec and passed its address to clock_gettime | ||
8 | which assumes that db_timespec and timespec are same but actually | ||
9 | its 12-bytes here and libc has 16-bytes | ||
10 | |||
11 | This can cause problems especially with 64bit time_t | ||
12 | |||
13 | Upstream-Status: Pending | ||
14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
15 | --- | ||
16 | src/dbinc/clock.h | 17 +---------------- | ||
17 | 1 file changed, 1 insertion(+), 16 deletions(-) | ||
18 | |||
19 | --- a/src/dbinc/clock.h | ||
20 | +++ b/src/dbinc/clock.h | ||
21 | @@ -44,22 +44,8 @@ | ||
22 | extern "C" { | ||
23 | #endif | ||
24 | |||
25 | -/* | ||
26 | - * This declaration is POSIX-compatible. Because there are lots of different | ||
27 | - * time.h include file patterns out there, it's easier to declare our own name | ||
28 | - * in all cases than to try and discover if a system has a struct timespec. | ||
29 | - * For the same reason, and because we'd have to #include <sys/time.h> in db.h, | ||
30 | - * we don't export any timespec structures in the DB API, even in places where | ||
31 | - * it would make sense, like the replication statistics information. | ||
32 | - */ | ||
33 | -typedef struct { | ||
34 | - time_t tv_sec; /* seconds */ | ||
35 | -#ifdef HAVE_MIXED_SIZE_ADDRESSING | ||
36 | - int32_t tv_nsec; | ||
37 | -#else | ||
38 | - long tv_nsec; /* nanoseconds */ | ||
39 | -#endif | ||
40 | -} db_timespec; | ||
41 | +#include <time.h> | ||
42 | +#define db_timespec struct timespec | ||
43 | |||
44 | /* Operations on timespecs */ | ||
45 | #undef timespecclear | ||
diff --git a/meta/recipes-support/db/db_5.3.28.bb b/meta/recipes-support/db/db_5.3.28.bb index a2969055a6..badb79f9ea 100644 --- a/meta/recipes-support/db/db_5.3.28.bb +++ b/meta/recipes-support/db/db_5.3.28.bb | |||
@@ -26,6 +26,7 @@ SRC_URI += "file://fix-parallel-build.patch \ | |||
26 | file://0001-configure-Add-explicit-tag-options-to-libtool-invoca.patch \ | 26 | file://0001-configure-Add-explicit-tag-options-to-libtool-invoca.patch \ |
27 | file://sequence-type.patch \ | 27 | file://sequence-type.patch \ |
28 | file://0001-Fix-libc-compatibility-by-renaming-atomic_init-API.patch \ | 28 | file://0001-Fix-libc-compatibility-by-renaming-atomic_init-API.patch \ |
29 | file://0001-clock-Do-not-define-own-timespec.patch \ | ||
29 | " | 30 | " |
30 | # We are not interested in official latest 6.x versions; | 31 | # We are not interested in official latest 6.x versions; |
31 | # let's track what debian is using. | 32 | # let's track what debian is using. |