From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f45.google.com (mail-ot1-f45.google.com [209.85.210.45]) (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 3D7F635959 for ; Sun, 3 May 2026 00:05:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777766751; cv=none; b=i17gADI5evcEGweRh03civRzJT3AIFwQtbupO74sQKzE45TLHmUAvh0Ou/Lyk4k/AtqXcgZAdBfxtY/Eb571e7s3Gvnbepf6MNnv/dvmAWUwWBnd/mWJez1JBExgnJj02/OLK9L2wtRFrBulTg+Q7YZl4kN4HzE7ynoQlGsGh6k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777766751; c=relaxed/simple; bh=XIgrbxGfBcI1a1vO4dXszCHdSe19TSDFODvG8fCABn8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=HMZobn78mJj3WONmpHZNzx94GODrKrVhfB1a19lmBZDkUibnoNaY6lqlo/7se60YWvEqesS2il6WjxyKKt5Tz7GcWpVGBkqIPLAkRKG6d//DuCS2kng4O4uLBGGAKUYExYJVB8gbu2op8+9+cyp6S9g3dJg+k9SpZe0gc55uo74= 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=GivwvlBy; arc=none smtp.client-ip=209.85.210.45 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="GivwvlBy" Received: by mail-ot1-f45.google.com with SMTP id 46e09a7af769-7dca00c1591so903374a34.3 for ; Sat, 02 May 2026 17:05:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777766746; x=1778371546; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=ZJy3pLduHUQEJsOIJ6mQFn4RDUX2xoMEEvvPtoEzxc4=; b=GivwvlByN1p9NqV3NI0jcoEEvGTmxj9t5IS46kZmrjS49q4xheA1FJ5NZHp94aIFD4 W/2l5MUgHPp5NqNIkBt9W3XoHQ7/IB3HUIOJNpfJd0LTdmq1Z4uHYpfDuGwNMUtjIO6E 9EbwLbvdkV533TrQOjxiAI33pqIUM3Q4YQonm0Q+WvwqAL1av7bfQyKAxIKfITFQJ3GG kX+jmmXZvoRzyM68Nnyb1zZBCqGCrOUyfPPsSUq3L8cbxkAMb/aJTmlbS/KksuFhDNpr +aviNW/EOU0Huxs2rj7AocXd+myqGdvHuxjNye4drvxnNU+JmQOtuOI4+O8Fyf+bEFIE N/Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777766746; x=1778371546; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=ZJy3pLduHUQEJsOIJ6mQFn4RDUX2xoMEEvvPtoEzxc4=; b=L7uMppJZQJXqz4quFlBuuTxY5cYzfAG1q9NBB0wtnb/o7expuZhCiuGf7InEiqdYzs HnRdw4+vBbYG8FmLMBTaYC3+NSJuXZUoNb5Qy5jSBXwGM+7tzXA7Md7JFsO+3iZB8JcA 7O2ps8gMufOfiYUNsLed4JgaxfiydvMlhVQ4Dj4FGltJnYvrI8kYXSqhBM4qjKrMj0u+ N+bMOzQ4k2S3PIT3n2iRn9XBlqDLnGeqiLNl6YSez8BMCcL0Vky0UZkBg/5KmmEEs9Dc 21oAy9yB2bWYvDJk4z4ihVe8HVofDS4nbu1bxMwgaF2rmTCT3wgY9giwddnV7N+JvXUt 36Ag== X-Forwarded-Encrypted: i=1; AFNElJ8B0NeraKtoqtaDcwXKC+gA+mdQAXI1Yee4X1F6TyehPaCFLPQqNxx2ISqRfoEkl1V1ezEZ0/hR+9wDDj8=@vger.kernel.org X-Gm-Message-State: AOJu0YxLJ1f04zt7wh+6iflLumnIhQhZjwbe6EctcN/j6ziHPxmjsDYt jK6oOvPpflTcgeYuoy9heislWC4lWVAM55RZ2Xo17vsZqqK607mQ7rJi X-Gm-Gg: AeBDietNAn3i4a5bZyL1XWzPOVu76ZRaw7DiZtCTdxlecyNo94B46TxXGLx+X95avI1 xGbV0S54yz5wX/8ItDO9hO0ETnNaTLZSewg3fqQTNcTnW+zD9G8QvLZZU0+APm3tVW9YdUOKpQM 50fLCvUP9xVDWnipaHp+RYCOaFj+1yCpzKUb69tDFPk2hicQa0GzT5gq2/flsmxTLkdSoiT0UZX Yh6UqhXK0LQeSrHPSHHKLDBHabNRYFSxMnVXcs5ELwVpaqsCGuO5j8+wOhrufPCDGegoi1qgmCq +Onh1CG0RiG0W32c8O3gxxmpMm24dgWiPzBotmfCDkpb0x7c+fC/fQNpWkidrht4gjBM3t3thQU wGm+Sri1/iGwA7TWL8rI1xI+T3cXfdvC4QhLH29ZE278KwDfmAihGafgciMC5SIzmBWy5KtD+eD j0SU5D8C7BVJ7QkvB4KXZKb1uMEeflA6U9WZQB0R6gAV48rqnx8NJrQ9cC9TTsUJQR/lo/dqpe X-Received: by 2002:a05:6830:2785:b0:7dc:d0e3:5bdd with SMTP id 46e09a7af769-7dee143b7f2mr2634196a34.19.1777766746228; Sat, 02 May 2026 17:05:46 -0700 (PDT) Received: from [100.82.231.29] (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 46e09a7af769-7decae2b090sm5379676a34.24.2026.05.02.17.05.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 May 2026 17:05:45 -0700 (PDT) From: Jim Cromie Date: Sat, 02 May 2026 18:05:34 -0600 Subject: [PATCH 3/5] vmlinux.lds.h: Fix ALIGN(8) omission causing NULL ptr on i386 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260502-asm-generic-1-v1-3-1103ee0152df@gmail.com> References: <20260502-asm-generic-1-v1-0-1103ee0152df@gmail.com> In-Reply-To: <20260502-asm-generic-1-v1-0-1103ee0152df@gmail.com> To: Arnd Bergmann , Jason Baron , Luis Chamberlain , Petr Pavlu , Daniel Gomez , Sami Tolvanen , Aaron Tomlin Cc: linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, linux-modules@vger.kernel.org, Jim Cromie , Louis Chauvet X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1777766741; l=4326; i=jim.cromie@gmail.com; s=20260203; h=from:subject:message-id; bh=XIgrbxGfBcI1a1vO4dXszCHdSe19TSDFODvG8fCABn8=; b=go6hhL+GZg1MThN9GkA9ic1Z78uoIl9KSJI4Z5X2pyNkZNh0ik2MzyKvza1Afhw/pxKZTBqDx anyKKlk04nGDEyOuxGZCfj6ccvMp/3eL7VTpDsT8sKq0f/X4eVaeSLU X-Developer-Key: i=jim.cromie@gmail.com; a=ed25519; pk=C6E5ODlPQo7ZBynATXH9wg7K6HxP0pIXyf4s38Qw0XE= Almost all uses of the BOUNDED_SECTION macros are ALIGN(8), either explicitly, or by being below an aligned section. The noteworthy exception is BOUNDED_SECTION(__dyndbg), which immediately follows BOUNDED_SECTION(__dyndbg_classes). On i386, struct _ddebug_classmap is 28 bytes, so without an explicit ALIGN(8) in the macro, the following __dyndbg section gets misaligned, causing a NULL ptr deref in dynamic_debug_init(). So fix this with an explicit ALIGN(8) in the existing macros, and introduce _ALIGNED variants to handle the rare exceptions. NOTES: ORC_UNWIND_TABLE now uses _ALIGNED macros to match the explicit . = ALIGN(x) instructions, but keeps the instructions so the symbols between them are not "re-aligned"; scripts/sorttable.c does not tolerate sloppy padding. Also add . = ALIGN(4) and change BOUNDED_SECTION to _ALIGNED, to agree with .orc_header, added here: b9f174c811e3 ("x86/unwind/orc: Add ELF section with ORC version identifier") Suggested-by: Louis Chauvet # _ALIGNED variants. Link: https://lore.kernel.org/lkml/177402491426.6181.12855763650074831089.b4-review@b4/ Signed-off-by: Jim Cromie --- include/asm-generic/bounded_sections.lds.h | 17 ++++++++++++++--- include/asm-generic/vmlinux.lds.h | 9 +++++---- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/include/asm-generic/bounded_sections.lds.h b/include/asm-generic/bounded_sections.lds.h index 268cdc34389b..8ff3e3420f60 100644 --- a/include/asm-generic/bounded_sections.lds.h +++ b/include/asm-generic/bounded_sections.lds.h @@ -3,19 +3,30 @@ #ifndef _ASM_GENERIC_BOUNDED_SECTIONS_H #define _ASM_GENERIC_BOUNDED_SECTIONS_H -#define BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) \ +#define BOUNDED_SECTION_PRE_LABEL_ALIGNED(_sec_, _label_, _BEGIN_, _END_, _ALIGNED_) \ + . = ALIGN(_ALIGNED_); \ _BEGIN_##_label_ = .; \ KEEP(*(_sec_)) \ _END_##_label_ = .; -#define BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_) \ +#define BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, _BEGIN_, _END_) \ + BOUNDED_SECTION_PRE_LABEL_ALIGNED(_sec_, _label_, _BEGIN_, _END_, 8) + +#define BOUNDED_SECTION_POST_LABEL_ALIGNED(_sec_, _label_, _BEGIN_, _END_, _ALIGNED_) \ + . = ALIGN(_ALIGNED_); \ _label_##_BEGIN_ = .; \ KEEP(*(_sec_)) \ _label_##_END_ = .; +#define BOUNDED_SECTION_POST_LABEL(_sec_, _label_, _BEGIN_, _END_) \ + BOUNDED_SECTION_POST_LABEL_ALIGNED(_sec_, _label_, _BEGIN_, _END_, 8) + #define BOUNDED_SECTION_BY(_sec_, _label_) \ BOUNDED_SECTION_PRE_LABEL(_sec_, _label_, __start, __stop) -#define BOUNDED_SECTION(_sec) BOUNDED_SECTION_BY(_sec, _sec) +#define BOUNDED_SECTION_BY_ALIGNED(_sec_, _label_, _ALIGNED_) \ + BOUNDED_SECTION_PRE_LABEL_ALIGNED(_sec_, _label_, __start, __stop, _ALIGNED_) + +#define BOUNDED_SECTION(_sec) BOUNDED_SECTION_BY(_sec, _sec) #endif /* _ASM_GENERIC_BOUNDED_SECTIONS_H */ diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index f78300aea8f6..d3f20b411e16 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h @@ -641,7 +641,7 @@ #define EXCEPTION_TABLE(align) \ . = ALIGN(align); \ __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { \ - BOUNDED_SECTION_BY(__ex_table, ___ex_table) \ + BOUNDED_SECTION_BY_ALIGNED(__ex_table, ___ex_table, align) \ } /* @@ -833,16 +833,17 @@ #ifdef CONFIG_UNWINDER_ORC #define ORC_UNWIND_TABLE \ + . = ALIGN(4); \ .orc_header : AT(ADDR(.orc_header) - LOAD_OFFSET) { \ - BOUNDED_SECTION_BY(.orc_header, _orc_header) \ + BOUNDED_SECTION_BY_ALIGNED(.orc_header, _orc_header, 4) \ } \ . = ALIGN(4); \ .orc_unwind_ip : AT(ADDR(.orc_unwind_ip) - LOAD_OFFSET) { \ - BOUNDED_SECTION_BY(.orc_unwind_ip, _orc_unwind_ip) \ + BOUNDED_SECTION_BY_ALIGNED(.orc_unwind_ip, _orc_unwind_ip, 4)\ } \ . = ALIGN(2); \ .orc_unwind : AT(ADDR(.orc_unwind) - LOAD_OFFSET) { \ - BOUNDED_SECTION_BY(.orc_unwind, _orc_unwind) \ + BOUNDED_SECTION_BY_ALIGNED(.orc_unwind, _orc_unwind, 2) \ } \ text_size = _etext - _stext; \ . = ALIGN(4); \ -- 2.54.0