From: Sasha Levin <sashal@kernel.org>
To: patches@lists.linux.dev, stable@vger.kernel.org
Cc: Jocelyn Falempe <jfalempe@redhat.com>,
Javier Martinez Canillas <javierm@redhat.com>,
Sasha Levin <sashal@kernel.org>,
maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de, dri-devel@lists.freedesktop.org
Subject: [PATCH AUTOSEL 6.17-6.12] drm/panic: Fix overlap between qr code and logo
Date: Tue, 28 Oct 2025 08:48:03 -0400 [thread overview]
Message-ID: <20251028124815.1058740-3-sashal@kernel.org> (raw)
In-Reply-To: <20251028124815.1058740-1-sashal@kernel.org>
From: Jocelyn Falempe <jfalempe@redhat.com>
[ Upstream commit cfa56e0a0e9b259077b0cb88b431e37dc9a67dee ]
The borders of the qr code was not taken into account to check if it
overlap with the logo, leading to the logo being partially covered.
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://lore.kernel.org/r/20251009122955.562888-3-jfalempe@redhat.com
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
LLM Generated explanations, may be completely bogus:
Based on my analysis of the Linux kernel repository, I can now provide a
comprehensive assessment.
## BACKPORT RECOMMENDATION: **YES**
## DETAILED ANALYSIS:
### 1. COMMIT CONTEXT & HISTORY
Using git history examination, I found:
- The QR code feature was introduced in commit **cb5164ac43d0f**
(2024-08-22) and first appeared in **v6.12**
- The bug was present from the initial QR code implementation
- This fix is currently only in **v6.18-rc3** and has NOT been
backported to any stable kernel (v6.12.x, v6.16.x, v6.17.x)
- The commit is part of a patch series (patch 3/3, Link:
20251009122955.562888-3) alongside other panic screen fixes
### 2. CODE ANALYSIS
**The Bug (drivers/gpu/drm/drm_panic.c:749):**
```c
- if (!drm_rect_overlap(&r_logo, &r_msg) && !drm_rect_overlap(&r_logo,
&r_qr))
+ if (!drm_rect_overlap(&r_logo, &r_msg) &&
!drm_rect_overlap(&r_logo, &r_qr_canvas))
```
**Context Understanding:**
- Line 727: `qr_canvas_width = qr_width + QR_MARGIN * 2` (canvas
includes margins)
- Line 734: `r_qr_canvas` = full QR area including **4-module margins**
(QR_MARGIN=4)
- Line 739: `r_qr` = actual QR code area **excluding margins**
- Lines 756-758: The margin is intentionally drawn with foreground color
for visual contrast
**Impact:** The incorrect overlap check allows the logo to be drawn over
the QR code's margin area, causing visual corruption of the panic
screen.
### 3. SCOPE & IMPACT ASSESSMENT
**Affected Code Paths:**
- `draw_panic_static_qr_code()` (line 762) → called when user selects
"qr_code" panic screen (line 796)
- Only affects systems using the QR code panic screen option
- No security implications, no data corruption, no crashes
**User Visibility:**
- Medium impact: Visible corruption on panic screens that use QR codes
with logos
- QR code readability may be reduced if logo overlaps the margin
- Affects user experience during critical system failures
### 4. BACKPORT SUITABILITY ANALYSIS
**Positive Indicators:**
- ✅ **Bug fix**: Corrects incorrect overlap detection logic introduced
in v6.12
- ✅ **Minimal change**: Single-line fix, extremely low regression risk
- ✅ **Self-contained**: No dependencies, no API changes
- ✅ **Stable kernel affected**: v6.12.x series is actively maintained
(currently at v6.12.55)
- ✅ **Related fixes exist**: Sibling commit 179753aa5b789 "Fix drawing
the logo on a small narrow screen" has `Fixes: 4b570ac2eb54` tag and
addresses similar issues
- ✅ **Active subsystem**: 50+ drm/panic commits since QR feature
introduction shows active maintenance
**Negative Indicators:**
- ⚠️ **No stable tag**: Missing `Cc: stable@vger.kernel.org` (likely
oversight)
- ⚠️ **No Fixes tag**: Should have `Fixes: cb5164ac43d0f ("drm/panic:
Add a QR code panic screen")`
- ⚠️ **Cosmetic bug**: Visual-only issue, not a critical functional or
security bug
### 5. STABLE KERNEL RULES COMPLIANCE
According to stable kernel rules (Documentation/process/stable-kernel-
rules.rst):
- ✅ Must fix a real bug that affects users (visual corruption affects
usability)
- ✅ Must be obviously correct (trivial rectangle variable substitution)
- ✅ Must be small and self-contained (1 line changed)
- ✅ Must not introduce new features (pure bug fix)
- ✅ Should already exist in mainline (exists in v6.18-rc3)
### 6. TOOLS USED IN ANALYSIS
- **git log/show**: Commit history, patch series identification
- **git tag --contains**: Version tracking (feature introduction, fix
propagation)
- **git diff**: Code change examination
- **Grep**: Function and pattern location
- **Read**: Contextual code analysis around the bug
### 7. RECOMMENDATION RATIONALE
This commit **should be backported** to stable trees (v6.12.x, v6.16.x,
v6.17.x) because:
1. **Fixes a real user-visible bug** in the panic screen QR code display
2. **Extremely low risk**: One-line variable substitution with no side
effects
3. **Consistent with kernel practices**: Similar logo fixes
(179753aa5b789) were deemed worthy of Fixes: tags
4. **Affects stable kernels**: The QR feature exists in all kernels ≥
v6.12
5. **Missing tags likely oversight**: The commit should have had `Fixes:
cb5164ac43d0f` tag based on pattern of similar fixes
6. **Improves panic screen quality**: Better visual presentation during
critical system failures aids debugging
The lack of explicit stable tags appears to be an oversight rather than
intentional exclusion, especially given that the closely related commit
in the same patch series (179753aa5b789) includes proper Fixes: tags.
drivers/gpu/drm/drm_panic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_panic.c b/drivers/gpu/drm/drm_panic.c
index 1d6312fa14293..ea6a64e5ddd76 100644
--- a/drivers/gpu/drm/drm_panic.c
+++ b/drivers/gpu/drm/drm_panic.c
@@ -746,7 +746,7 @@ static int _draw_panic_static_qr_code(struct drm_scanout_buffer *sb)
/* Fill with the background color, and draw text on top */
drm_panic_fill(sb, &r_screen, bg_color);
- if (!drm_rect_overlap(&r_logo, &r_msg) && !drm_rect_overlap(&r_logo, &r_qr))
+ if (!drm_rect_overlap(&r_logo, &r_msg) && !drm_rect_overlap(&r_logo, &r_qr_canvas))
drm_panic_logo_draw(sb, &r_logo, font, fg_color);
draw_txt_rectangle(sb, font, panic_msg, panic_msg_lines, true, &r_msg, fg_color);
--
2.51.0
next prev parent reply other threads:[~2025-10-28 12:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-28 12:48 [PATCH AUTOSEL 6.17-6.1] spi: intel-pci: Add support for Intel Wildcat Lake SPI serial flash Sasha Levin
2025-10-28 12:48 ` [PATCH AUTOSEL 6.17] erofs: consolidate z_erofs_extent_lookback() Sasha Levin
2025-10-28 12:48 ` Sasha Levin [this message]
2025-10-28 12:48 ` [PATCH AUTOSEL 6.17-6.1] net: datagram: introduce datagram_poll_queue for custom receive queues Sasha Levin
2025-10-28 12:48 ` [PATCH AUTOSEL 6.17-5.4] of/irq: Fix OF node refcount in of_msi_get_domain() Sasha Levin
2025-10-28 12:48 ` [PATCH AUTOSEL 6.17-6.1] riscv: mm: Define MAX_POSSIBLE_PHYSMEM_BITS for zsmalloc Sasha Levin
2025-10-28 12:48 ` [PATCH AUTOSEL 6.17-6.6] firmware: arm_scmi: Skip RAW initialization on failure Sasha Levin
2025-10-28 12:48 ` [PATCH AUTOSEL 6.17-6.1] spi: intel-pci: Add support for Arrow Lake-H SPI serial flash Sasha Levin
2025-10-28 12:48 ` [PATCH AUTOSEL 6.17-6.12] drm/panic: Fix divide by 0 if the screen width < font width Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251028124815.1058740-3-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=javierm@redhat.com \
--cc=jfalempe@redhat.com \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=patches@lists.linux.dev \
--cc=stable@vger.kernel.org \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).