Michael Ellerman
2eda7f1100
powerpc/vdso: Fix DOTSYM for 32-bit LE VDSO
...
Skirmisher reported on IRC that the 32-bit LE VDSO was hanging. This
turned out to be due to a branch to self in eg. __kernel_gettimeofday.
Looking at the disassembly with objdump -dR shows why:
00000528 <__kernel_gettimeofday>:
528: f0 ff 21 94 stwu r1,-16(r1)
52c: a6 02 08 7c mflr r0
530: f0 ff 21 94 stwu r1,-16(r1)
534: 14 00 01 90 stw r0,20(r1)
538: 05 00 9f 42 bcl 20,4*cr7+so,53c <__kernel_gettimeofday+0x14>
53c: a6 02 a8 7c mflr r5
540: ff ff a5 3c addis r5,r5,-1
544: c4 fa a5 38 addi r5,r5,-1340
548: f0 00 a5 38 addi r5,r5,240
54c: 01 00 00 48 bl 54c <__kernel_gettimeofday+0x24>
54c: R_PPC_REL24 .__c_kernel_gettimeofday
Because we don't process relocations for the VDSO, this branch remains
a branch from 0x54c to 0x54c.
With the preceding patch to prohibit R_PPC_REL24 relocations, we
instead get a build failure:
0000054c R_PPC_REL24 .__c_kernel_gettimeofday
00000598 R_PPC_REL24 .__c_kernel_clock_gettime
000005e4 R_PPC_REL24 .__c_kernel_clock_gettime64
00000630 R_PPC_REL24 .__c_kernel_clock_getres
0000067c R_PPC_REL24 .__c_kernel_time
arch/powerpc/kernel/vdso32/vdso32.so.dbg: dynamic relocations are not supported
The root cause is that we're branching to `.__c_kernel_gettimeofday`.
But this is 32-bit LE code, which doesn't use function descriptors, so
there are no dot symbols.
The reason we're trying to branch to a dot symbol is because we're
using the DOTSYM macro, but the ifdefs we use to define the DOTSYM
macro do not currently work for 32-bit LE.
So like previous commits we need to differentiate if the current
compilation unit is 64-bit, rather than the kernel as a whole. ie.
switch from CONFIG_PPC64 to __powerpc64__.
With that fixed 32-bit LE code gets the empty version of DOTSYM, which
just resolves to the original symbol name, leading to a direct branch
and no relocations:
000003f8 <__kernel_gettimeofday>:
3f8: f0 ff 21 94 stwu r1,-16(r1)
3fc: a6 02 08 7c mflr r0
400: f0 ff 21 94 stwu r1,-16(r1)
404: 14 00 01 90 stw r0,20(r1)
408: 05 00 9f 42 bcl 20,4*cr7+so,40c <__kernel_gettimeofday+0x14>
40c: a6 02 a8 7c mflr r5
410: ff ff a5 3c addis r5,r5,-1
414: f4 fb a5 38 addi r5,r5,-1036
418: f0 00 a5 38 addi r5,r5,240
41c: 85 06 00 48 bl aa0 <__c_kernel_gettimeofday>
Fixes: ab037dd87a ("powerpc/vdso: Switch VDSO to generic C implementation.")
Reported-by: "Will Springer <skirmisher@protonmail.com >"
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au >
Link: https://lore.kernel.org/r/20201218111619.1206391-3-mpe@ellerman.id.au
2020-12-21 22:06:26 +11:00
..
2020-12-17 13:34:25 -08:00
2020-12-17 13:34:25 -08:00
2020-12-21 22:06:10 +11:00
2019-05-30 11:26:32 -07:00
2017-11-02 11:10:55 +01:00
2020-01-25 12:18:51 -05:00
2018-07-30 22:48:16 +10:00
2020-10-22 14:26:09 +11:00
2020-10-08 12:50:52 +11:00
2019-05-24 17:27:11 +02:00
2020-12-04 22:13:19 +11:00
2017-11-02 11:10:55 +01:00
2020-12-04 01:01:10 +11:00
2020-11-19 14:50:13 +11:00
2017-11-02 11:10:55 +01:00
2019-06-07 19:00:14 +10:00
2020-12-09 23:48:14 +11:00
2019-05-30 11:26:32 -07:00
2020-10-25 14:51:49 -07:00
2020-09-02 11:00:21 +10:00
2019-05-30 11:26:32 -07:00
2017-11-02 11:10:55 +01:00
2020-12-15 22:50:11 +11:00
2020-12-04 01:01:10 +11:00
2020-05-28 23:24:36 +10:00
2018-08-08 00:32:25 +10:00
2020-05-19 00:10:37 +10:00
2020-09-17 13:00:46 -04:00
2017-11-02 11:10:55 +01:00
2019-05-30 11:26:32 -07:00
2020-12-09 17:00:54 +11:00
2017-11-02 11:10:55 +01:00
2019-12-09 13:54:34 -06:00
2017-11-02 11:10:55 +01:00
2020-11-19 14:49:56 +11:00
2019-05-30 11:26:32 -07:00
2019-04-30 22:37:48 +10:00
2020-12-09 16:48:59 +11:00
2020-09-16 22:05:19 +10:00
2020-07-27 00:01:31 +10:00
2020-07-29 23:47:54 +10:00
2019-08-20 21:22:15 +10:00
2017-11-02 11:10:55 +01:00
2020-07-29 21:02:09 +10:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2017-11-02 11:10:55 +01:00
2019-05-30 11:26:35 -07:00
2020-05-19 00:11:04 +10:00
2019-05-30 11:26:32 -07:00
2020-10-08 21:17:15 +11:00
2020-08-11 14:13:24 -07:00
2019-06-05 17:30:28 +02:00
2020-09-11 09:14:43 +02:00
2020-04-01 14:30:50 +11:00
2020-10-08 12:50:52 +11:00
2018-07-30 22:48:17 +10:00
2020-07-10 12:00:01 +02:00
2019-05-30 11:26:35 -07:00
2020-10-07 22:34:47 +11:00
2020-12-05 21:49:52 +11:00
2019-08-30 09:40:15 +10:00
2019-06-05 17:37:07 +02:00
2020-07-27 00:01:31 +10:00
2020-07-29 21:08:12 +10:00
2020-11-19 23:47:18 +11:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-05-04 22:29:58 +10:00
2019-09-14 00:04:45 +10:00
2017-11-02 11:10:55 +01:00
2020-12-04 01:01:23 +11:00
2020-12-04 01:01:21 +11:00
2020-11-06 23:14:57 +01:00
2020-05-12 19:34:53 +03:00
2017-08-10 23:32:12 +10:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:35 -07:00
2019-06-05 17:30:28 +02:00
2019-05-30 11:26:32 -07:00
2020-05-19 00:10:34 +10:00
2020-05-28 23:24:36 +10:00
2017-11-02 11:10:55 +01:00
2020-07-29 23:47:53 +10:00
2020-07-22 23:00:27 +10:00
2017-11-02 11:10:55 +01:00
2020-11-06 23:14:57 +01:00
2019-05-24 17:39:01 +02:00
2020-07-29 21:09:37 +10:00
2020-12-08 21:40:55 +11:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2019-01-14 20:39:27 +11:00
2020-09-15 22:13:20 +10:00
2020-10-16 12:21:15 -07:00
2020-07-22 00:01:23 +10:00
2017-11-02 11:10:55 +01:00
2020-08-25 01:31:33 +10:00
2017-11-02 11:10:55 +01:00
2020-04-30 12:35:26 +10:00
2017-11-02 11:10:55 +01:00
2020-07-16 13:12:46 +10:00
2017-11-02 11:10:55 +01:00
2020-07-23 17:41:36 +10:00
2019-05-30 11:26:32 -07:00
2017-11-02 11:10:55 +01:00
2019-08-27 13:03:34 +10:00
2020-12-04 22:13:19 +11:00
2020-10-06 07:07:03 +02:00
2019-05-30 11:26:32 -07:00
2018-03-13 15:50:37 +11:00
2020-09-02 11:00:19 +10:00
2018-01-19 22:37:01 +11:00
2017-11-02 11:10:55 +01:00
2019-05-30 11:26:32 -07:00
2020-08-18 13:39:52 +10:00
2020-08-07 10:33:50 -07:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-07-29 23:47:53 +10:00
2020-07-29 23:47:54 +10:00
2017-11-02 11:10:55 +01:00
2018-10-20 13:26:47 +11:00
2020-05-19 00:10:39 +10:00
2020-12-15 13:13:49 +11:00
2020-03-19 16:39:52 +11:00
2019-06-05 17:30:28 +02:00
2020-05-29 16:09:27 +10:00
2020-07-22 21:56:41 +10:00
2020-07-28 12:34:52 +10:00
2020-06-12 11:05:52 -07:00
2019-06-19 17:09:55 +02:00
2020-07-29 21:02:09 +10:00
2019-06-05 17:30:28 +02:00
2020-12-04 01:01:22 +11:00
2020-09-03 14:12:48 +10:00
2020-12-04 01:01:22 +11:00
2020-07-23 15:50:01 +10:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-11-13 12:15:28 -05:00
2019-11-24 15:06:33 -08:00
2020-07-10 12:00:01 +02:00
2019-05-30 11:26:39 -07:00
2020-12-08 21:41:01 +11:00
2017-11-02 11:10:55 +01:00
2019-05-30 11:26:32 -07:00
2020-12-04 01:01:23 +11:00
2017-11-02 11:10:55 +01:00
2019-08-30 09:55:41 +10:00
2018-02-05 21:34:31 +01:00
2020-08-24 14:12:54 +10:00
2019-04-08 12:09:27 +01:00
2020-12-17 13:34:25 -08:00
2020-12-09 16:48:59 +11:00
2020-11-22 10:48:22 -08:00
2020-06-05 12:39:30 -07:00
2020-09-25 00:36:41 +09:00
2019-05-24 17:27:12 +02:00
2017-11-02 11:10:55 +01:00
2018-05-25 12:04:42 +10:00
2019-05-24 17:27:12 +02:00
2019-06-05 17:37:18 +02:00
2017-11-02 11:10:55 +01:00
2019-06-05 17:37:17 +02:00
2019-05-30 11:26:32 -07:00
2018-10-21 19:32:07 +11:00
2019-06-05 17:37:17 +02:00
2019-02-26 23:28:24 +11:00
2019-05-30 11:26:32 -07:00
2017-11-02 11:10:55 +01:00
2020-12-11 09:53:10 +11:00
2019-11-13 00:33:22 +11:00
2019-05-30 11:26:32 -07:00
2020-08-07 10:33:50 -07:00
2020-12-09 23:48:14 +11:00
2020-04-10 15:36:21 -07:00
2020-07-27 00:01:30 +10:00
2020-12-04 01:01:22 +11:00
2017-11-02 11:10:55 +01:00
2019-06-05 17:37:06 +02:00
2020-10-15 13:42:49 +11:00
2020-10-06 07:07:03 +02:00
2020-08-04 23:15:59 +10:00
2019-05-30 11:26:32 -07:00
2020-11-19 16:56:55 +11:00
2020-08-17 13:11:22 +10:00
2019-09-24 15:54:09 -07:00
2019-05-03 01:20:23 +10:00
2019-05-03 01:20:23 +10:00
2020-06-09 09:39:14 -07:00
2020-07-20 22:57:59 +10:00
2020-07-26 23:34:19 +10:00
2019-05-30 11:26:32 -07:00
2018-05-25 12:04:41 +10:00
2019-07-15 12:41:26 +10:00
2019-05-30 11:26:32 -07:00
2020-12-04 01:01:30 +11:00
2020-01-23 21:31:17 +11:00
2019-07-13 16:08:36 -07:00
2019-05-24 17:27:12 +02:00
2020-12-21 22:06:26 +11:00
2020-12-11 00:09:09 +11:00
2019-08-22 23:12:47 +10:00
2019-05-30 11:26:35 -07:00
2020-12-04 01:01:26 +11:00
2020-06-02 20:59:20 +10:00
2020-12-04 01:01:22 +11:00
2019-05-30 11:26:39 -07:00
2019-06-05 17:37:07 +02:00
2019-07-13 16:08:36 -07:00
2019-07-05 00:43:50 +10:00
2020-12-04 01:01:25 +11:00
2020-07-27 00:01:29 +10:00
2020-07-27 00:01:29 +10:00
2020-01-23 21:31:14 +11:00
2019-05-30 11:26:32 -07:00
2020-12-05 21:49:18 +11:00
2018-07-30 22:48:17 +10:00
2020-12-09 23:48:14 +11:00
2018-05-25 12:04:43 +10:00
2019-05-30 11:26:32 -07:00
2020-12-08 21:41:02 +11:00
2020-12-08 21:41:01 +11:00
2017-11-02 11:10:55 +01:00
2020-11-20 11:16:35 -08:00
2020-06-18 12:10:37 -07:00
2019-11-12 12:25:49 +11:00
2020-11-19 23:47:18 +11:00
2019-11-13 00:33:22 +11:00
2019-05-30 11:26:32 -07:00
2020-04-01 14:30:51 +11:00
2020-11-19 23:47:18 +11:00
2018-12-04 19:45:01 +11:00
2017-11-02 11:10:55 +01:00
2020-04-01 13:42:13 +11:00
2020-07-26 23:34:26 +10:00
2020-07-26 23:34:26 +10:00
2020-05-26 22:22:21 +10:00
2020-12-11 00:10:25 +11:00
2020-07-27 00:01:32 +10:00
2020-11-22 10:48:22 -08:00
2020-07-27 00:01:23 +10:00
2020-07-27 00:01:29 +10:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:39 -07:00
2019-05-30 11:26:32 -07:00
2020-07-23 17:43:44 +10:00
2018-10-03 15:40:03 +10:00
2018-08-08 00:32:30 +10:00
2020-10-06 11:18:04 +02:00
2020-09-14 23:07:14 +10:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2020-04-20 16:53:01 +10:00
2020-10-06 23:22:23 +11:00
2020-05-15 11:58:54 +10:00
2018-05-10 23:25:14 +10:00
2019-02-23 22:31:39 +11:00
2019-05-03 01:20:23 +10:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:32 -07:00
2020-12-17 13:34:25 -08:00
2020-12-04 01:01:32 +11:00
2020-12-04 01:01:10 +11:00
2020-12-09 16:46:56 +11:00
2018-07-30 22:48:21 +10:00
2018-05-24 16:04:02 +10:00
2020-11-06 14:16:19 +11:00
2019-06-19 17:09:55 +02:00
2019-05-01 16:45:05 +10:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2020-11-05 10:15:59 +11:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-11-28 17:02:31 +11:00
2019-11-28 17:02:31 +11:00
2017-11-02 11:10:55 +01:00
2017-11-02 11:10:55 +01:00
2020-04-03 00:09:59 +11:00
2020-05-19 00:10:39 +10:00
2018-10-19 15:09:04 +11:00
2020-04-20 16:53:14 +10:00
2020-12-04 01:01:17 +11:00
2020-12-04 01:01:19 +11:00
2020-04-23 10:50:26 +09:00
2017-11-02 11:10:55 +01:00
2019-05-30 11:26:32 -07:00
2019-12-10 10:12:55 +01:00
2017-11-02 11:10:55 +01:00
2020-05-07 22:58:31 +10:00
2020-12-11 09:53:10 +11:00
2019-05-30 11:26:32 -07:00
2018-05-25 12:04:38 +10:00
2019-05-30 11:26:35 -07:00