Bug 296727 - rk8xx_rtc: Stack buffer overflow
Summary: rk8xx_rtc: Stack buffer overflow
Status: Closed DUPLICATE of bug 296719
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: arm64 Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-07-12 14:09 UTC by Benjamin Jacobs
Modified: 2026-07-12 15:39 UTC (History)
1 user (show)

See Also:


Attachments
0001-rk8xx_rtc-Fix-stack-buffer-overflow.patch (2.75 KB, patch)
2026-07-12 14:09 UTC, Benjamin Jacobs
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Jacobs 2026-07-12 14:09:40 UTC
Created attachment 272764 [details]
0001-rk8xx_rtc-Fix-stack-buffer-overflow.patch

My rockpro64 panics after bootup since -fstack-protector-strong has been turned on.
There is an overflow of rk8xx_settime's char data[7], caused by a typo in the attach functions which is initializing rtc_regs.weeks to RK8xx_RTC_WEEKS_MASK (0x07) instead of RK8xx_RTC_WEEKS (0x06). The attached patch fixes this issue for me (rk808): the board no longer panics.

vpanic() at vpanic+0x1c8
panic() at panic+0x48
__stack_chk_fail() at __stack_chk_fail+0x14
rk8xx_settime() at rk8xx_settime+0x1a0
settime_task_func() at settime_task_func+0xc8
taskqueue_run_locked() at taskqueue_run_locked+0x1cc
taskqueue_thread_loop() at taskqueue_thread_loop+0x120
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2026-07-12 15:39:03 UTC
Looks like the problem was already fixed.

*** This bug has been marked as a duplicate of bug 296719 ***