From nobody Tue Apr 7 12:52:16 2026 Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3B4FE30E831 for ; Fri, 13 Mar 2026 13:11:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773407503; cv=none; b=l1NxNciHqnoIkVhWB7OZVzGNkqyB1Yii0KVNIplmU/7YFeAWdVqF9RVQCl4ZCK/3IwG+OISb+NJ4hfniMoLgQILCHns4xz9al2XzoOiJtllRkPsXqmXWpDpbSr1iS9sw+H+LTGGXdxW5uQ8Om6CuOC1wIwxvq3s8pTuQlaBSbEY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773407503; c=relaxed/simple; bh=IDRek7YZfB+4Kr1w0QgBbJ4cZK+zQPKPw+4cJp1INA0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ObW2KSmJYAtr20a7e/q0nzbZ0No+xUyYGTcscFcuY7wlhdBah34LrflDp7+QT5ycp0vdfdro9XYdD2eOyCI/vLGEjStFVjMqNsUTqEn00H7p8Nq4P68n1hgGh9VCLj2sX7rlbO0Z4Z2fra+POGeedrZjfMHzmy430IlFX+e7vcg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PcvJ/Oly; arc=none smtp.client-ip=209.85.210.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PcvJ/Oly" Received: by mail-ot1-f42.google.com with SMTP id 46e09a7af769-7d74c1157a4so2208866a34.1 for ; Fri, 13 Mar 2026 06:11:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773407501; x=1774012301; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=J7LRJl13Yqup7eJj7JB8u2raYRuugKEd6d7nm5DRaag=; b=PcvJ/OlyC1eID0BVumFb1vdQIc7Tpwk7MkhA5KoWJZZGLhbgp9CDEARqi9nkFN2c+H Y4DpWCpav6wdFazEHUONGatxGgi8GAIct+Zab47SQXichAm3v1RSdHEC2F5ORBqfwti8 H54PrnPdFDDzj+KECnOcENB/jUflFzn10Oj8K8sL2HxWUVZ+kXngZnFQCOWcQ4k1+HAZ 7F/d5q8/DBfJT4hamDPw9h01FHHikrHsP6yjvRw1nzndPf7oclQEgFD1Lgz84/idgIh2 PEQN3hKnlAAYz1a7vRckn2ujisQ2HVVVvm18Ay0wivzK8swKOXzQsguW7YMbyDkV+mCL F3zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773407501; x=1774012301; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=J7LRJl13Yqup7eJj7JB8u2raYRuugKEd6d7nm5DRaag=; b=loI/PEoTomZebNPlJT0YpedOJnI1DCZRqh2dkO5wiH5hQ6TusnnemoPMhFxBTHNtzM sBEp3agEg+yufHiCtMMifThBUjjv6FbYTyO/xWVa+xld/HVu3fpisfU3doE0tSQGfwbn EELJdZpyOy2bWI/I2ZA1WNx2B4M9zAVyOzXkDSW9T+JAQgI6H5qZ/f4X6Pg94f72/LGG Yf2l+o4Q4KbFFrr5oevDJd2UNLEvxcNupFHfFKiH2D9Nfo/e20Ke+t4sAEZC/S1fi6Ar Fl+4mwpquGryvb1JYvA+egQ/aAViZdrBuq7cMGxvOj08tS7ORj3k5XtY+X4AO7qzSO7w 64gw== X-Forwarded-Encrypted: i=1; AJvYcCXiVj7W+w83RpJg331w1wzAl9A29tmnUu+o0hhqx8dxa6PQTKPjQoRgMhZOCbpFZ6YT1fNK2ViAiBgltO0=@vger.kernel.org X-Gm-Message-State: AOJu0Yz8oKEL12xu3r3ft5Et1Z0nuhbYnlw74Wa6n9+0PM8KbtJXwwfQ MsCBlTuwLerSJ9Vtb5mNHMW+ieDFWRq7mlydrFY/J1kB3twUh5WMAU8m X-Gm-Gg: ATEYQzw2zfawgwegMKpXjeVYDF/WnAHlNTl+WDrmaGMBQXbH0gdLneM2oll4hODCc+I mnTGFwvxvNG/9NJ7gzmf3pDzIuJdXBJ9OG2AT7d/T5EYoT80Ycuwh6LI4c0VDwbiK/eB9RW/AxO XflikhgqbIIMVM263HpVOpvuhVc92Z4XVFqJlZjDz0aL8x4PR7u1Mwg0YurLhb+OQiJG52xA8uJ ZUms+JjccKO+2jsiqukHnH6VkRIOfR6P9YNbaKpn2gBxzPDGWQWM6RrbtnbqLAJU2gB9Y6wvkgs R/BRGgNJN1xl3SOXp3s5wiHzYXkH1pUjvblClzv/4ZQVWXbdVdPD1rlBYOAlS82ZfLT0lEmYTCv RAQx9zszG40OZs/6gxV0IQVu58mMlEvLoUbttoLqm4le5ZkFipEaONm5GhMIAoqTbojNvtOEyu9 XiZsXzi1Thsx2rZpssoVNA2xdcLyMrf7y5z0TD0HlRA2MPEymp X-Received: by 2002:a05:6830:258c:b0:7d1:586a:32a2 with SMTP id 46e09a7af769-7d78232b1a0mr2235981a34.0.1773407500985; Fri, 13 Mar 2026 06:11:40 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 46e09a7af769-7d76ae90586sm6733728a34.22.2026.03.13.06.11.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:11:40 -0700 (PDT) From: Jim Cromie To: Arnd Bergmann , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , mripard@kernel.org, tzimmermann@suse.de, maarten.lankhorst@linux.intel.com, jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, kernel test robot Subject: [PATCH v11 01/65] dyndbg: fix NULL ptr on i386 due to section alignment Date: Fri, 13 Mar 2026 07:09:08 -0600 Message-ID: <20260313131045.2526422-2-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313131045.2526422-1-jim.cromie@gmail.com> References: <20260313131045.2526422-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When dyndbg classmaps get used (later in this series), the __dyndbg_classes section (which has 28 byte structs on i386), causes mis-alignment of the following __dyndbg section, resulting in a NULL pointer deref in dynamic_debug_init(). To fix this, employ belt + suspenders: 1. move __dyndbg section above __dyndbg_classes. This restores it to its original position directly after the ALIGN(8), and fixes the immediate problem. 2. add ALIGN(8) to the BOUNDED_SECTION* macros. This aligns all existing sections using the macro, and also fixes a future dyndbg_class_* addition which would suffer the same misalignment on i386. Many of the existing macro uses already have a preceding ALIGN, these are now redundant, but are harmless, so are left to avoid churn. 3. remove BOUNDED_SECTION* uses in ORC_UNWINDER sections. These have smaller alignments, *and* scripts/sorttable.c does not tolerate the added ALIGN(8) padding. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202601211325.7e1f336-lkp@intel.com Signed-off-by: Jim Cromie --- include/asm-generic/vmlinux.lds.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinu= x.lds.h index eeb070f330bd..a2ba7e3d9994 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -212,11 +212,13 @@ #endif =20 #define BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) \ + . =3D ALIGN(8); \ _BEGIN_##_label_ =3D .; \ KEEP(*(_sec_)) \ _END_##_label_ =3D .; =20 #define BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_) \ + . =3D ALIGN(8); \ _label_##_BEGIN_ =3D .; \ KEEP(*(_sec_)) \ _label_##_END_ =3D .; @@ -383,8 +385,8 @@ *(__tracepoints) \ /* implement dynamic printk debug */ \ . =3D ALIGN(8); \ - BOUNDED_SECTION_BY(__dyndbg_classes, ___dyndbg_classes) \ BOUNDED_SECTION_BY(__dyndbg, ___dyndbg) \ + BOUNDED_SECTION_BY(__dyndbg_classes, ___dyndbg_classes) \ CODETAG_SECTIONS() \ LIKELY_PROFILE() \ BRANCH_PROFILE() \ @@ -867,15 +869,21 @@ #ifdef CONFIG_UNWINDER_ORC #define ORC_UNWIND_TABLE \ .orc_header : AT(ADDR(.orc_header) - LOAD_OFFSET) { \ - BOUNDED_SECTION_BY(.orc_header, _orc_header) \ + __start_orc_header =3D .; \ + KEEP(*(.orc_header)) \ + __stop_orc_header =3D .; \ } \ . =3D ALIGN(4); \ .orc_unwind_ip : AT(ADDR(.orc_unwind_ip) - LOAD_OFFSET) { \ - BOUNDED_SECTION_BY(.orc_unwind_ip, _orc_unwind_ip) \ + __start_orc_unwind_ip =3D .; \ + KEEP(*(.orc_unwind_ip)) \ + __stop_orc_unwind_ip =3D .; \ } \ . =3D ALIGN(2); \ .orc_unwind : AT(ADDR(.orc_unwind) - LOAD_OFFSET) { \ - BOUNDED_SECTION_BY(.orc_unwind, _orc_unwind) \ + __start_orc_unwind =3D .; \ + KEEP(*(.orc_unwind)) \ + __stop_orc_unwind =3D .; \ } \ text_size =3D _etext - _stext; \ . =3D ALIGN(4); \ --=20 2.53.0