Files
kernel_google_wahoo/include/linux
Pi-Hsun Shih c947b45f2e include/linux/swap.h: use offsetof() instead of custom __swapoffset macro
[ Upstream commit a4046c06be50a4f01d435aa7fe57514818e6cc82 ]

Use offsetof() to calculate offset of a field to take advantage of
compiler built-in version when possible, and avoid UBSAN warning when
compiling with Clang:

  UBSAN: Undefined behaviour in mm/swapfile.c:3010:38
  member access within null pointer of type 'union swap_header'
  CPU: 6 PID: 1833 Comm: swapon Tainted: G S                4.19.23 #43
  Call trace:
   dump_backtrace+0x0/0x194
   show_stack+0x20/0x2c
   __dump_stack+0x20/0x28
   dump_stack+0x70/0x94
   ubsan_epilogue+0x14/0x44
   ubsan_type_mismatch_common+0xf4/0xfc
   __ubsan_handle_type_mismatch_v1+0x34/0x54
   __se_sys_swapon+0x654/0x1084
   __arm64_sys_swapon+0x1c/0x24
   el0_svc_common+0xa8/0x150
   el0_svc_compat_handler+0x2c/0x38
   el0_svc_compat+0x8/0x18

Link: http://lkml.kernel.org/r/20190312081902.223764-1-pihsun@chromium.org
Signed-off-by: Pi-Hsun Shih <pihsun@chromium.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-04-27 09:33:59 +02:00
..
2018-11-21 09:27:42 +01:00
2015-10-01 12:48:11 -07:00
2015-06-25 11:49:31 +03:00
2015-10-17 21:22:08 -07:00
2015-10-07 18:08:15 +01:00
2016-03-09 15:34:52 -08:00
2018-04-08 11:51:57 +02:00
2018-04-24 09:32:12 +02:00
2015-11-07 10:40:47 -07:00
2017-06-14 13:16:23 +02:00
2015-09-08 15:35:28 -07:00
2015-10-18 10:14:39 -07:00
2019-03-23 08:44:38 +01:00
2017-07-15 11:57:44 +02:00
2015-10-30 01:47:27 -04:00
2018-01-17 09:35:30 +01:00
2015-06-24 17:49:45 -07:00
2017-08-06 19:19:42 -07:00
2018-04-24 09:32:07 +02:00
2015-09-08 15:35:28 -07:00
2016-04-20 15:42:02 +09:00
2015-10-23 05:44:28 -07:00
2015-10-01 15:06:43 +02:00
2015-10-13 19:01:25 +02:00
2015-06-25 12:06:45 +02:00
2016-10-28 03:01:30 -04:00
2015-08-18 15:49:15 -07:00
2015-07-28 08:50:42 +01:00
2015-11-23 09:44:58 +01:00
2015-10-27 18:55:31 -07:00
2015-06-24 17:49:41 -07:00
2015-10-20 22:10:45 +08:00
2015-07-21 10:39:05 -07:00
2015-06-25 04:20:04 -04:00
2016-03-03 15:07:28 -08:00
2015-09-10 13:29:01 -07:00
2015-11-06 17:50:42 -08:00
2016-12-08 07:15:24 +01:00
2017-08-24 17:02:36 -07:00
2015-10-09 17:00:32 -04:00
2015-10-22 08:59:18 -07:00
2015-06-25 01:13:43 +02:00
2019-02-08 11:25:32 +01:00
2016-09-30 10:18:37 +02:00
2019-04-27 09:33:54 +02:00
2015-06-25 17:00:39 -07:00
2018-11-21 09:27:36 +01:00
2016-04-12 09:08:35 -07:00
2015-08-17 11:25:28 -07:00
2015-10-01 09:57:59 -07:00
2015-10-19 01:01:21 +02:00
2018-11-27 16:08:02 +01:00
2015-11-23 09:44:58 +01:00
2015-12-13 14:30:59 -08:00
2015-11-13 20:34:33 -05:00
2015-09-08 15:35:28 -07:00