Commit Graph
18348 Commits
Author SHA1 Message Date
boa-z bd6c9fbfc9 [cherryusb][ehci] Fix missing SETUP buffer cache clean
Backport cherry-embedded/CherryUSB@41f5796:
https://github.com/cherry-embedded/CherryUSB/commit/41f57964cc442145099250f0190eb71e9d1d9d5a

The fix is already merged in CherryUSB upstream but is not included in
the v1.6.1 copy integrated in RT-Thread.  The EHCI port cleans qTD/QH
descriptors and the transfer buffer for DMA, but not the SETUP packet,
so on a non-coherent platform the controller can read a stale packet and
a device may never enumerate.

Apply the upstream change: clean the SETUP buffer in ehci_qh_add_head()
before the QH is linked into the asynchronous or periodic list.
2026-11-09 10:30:27 +08:00
sexenteen cc533832d3 feat[utest]: repeat the automatic run and sample free/ps between loops 2026-11-09 09:31:47 +08:00
Wooohaaa b3a0eb5e12 [bsp][bouffalo] Validate ADC DMA sample channels (#12003)
* fix(bouffalo): validate ADC DMA channel indexes

* fix(bouffalo): validate configured ADC channels

* fix(bouffalo): keep ADC channel validation warning-free
2026-11-09 09:29:17 +08:00
WEI MingjiangandRbb666 adbf7de5d1 [libcpu][arm] Correct format specifiers in GIC dump functions (#11914)
* fix(libcpu/arm): correct format specifiers in GIC dump functions

Fix -Wformat warnings in arm_gic_dump_type() and arm_gic_dump() for
both GICv2 (gic.c) and GICv3 (gicv3.c):

- %p with rt_uint32_t physical address -> 0x%08x (non-pointer passed to
  %p is undefined behavior)
- %d with unsigned int / unsigned long -> %u (signed/unsigned mismatch)
- Add explicit (unsigned int) cast for GIC version extracted with 0xfUL

These warnings appear when compiling Cortex-A BSPs with -Wall -Wformat.

* style: format code with clang-format

* style: format code with clang-format

* [libcpu][arm] Fix undefined signed shift in GIC RWP macros

---------

Co-authored-by: Rbb666 <zhangbingru@rt-thread.com>
2026-11-08 16:20:04 +08:00
Chen Moushun 37d8b8d1d0 drivers/spi: QEMU virtual SPI loopback bus for utest (#11972) (#11979)
* drivers/spi: add QEMU virtual SPI loopback bus for utest (#11972)

Register a pure-software SPI bus (default name spi2) with memcpy
loopback xfer so components.drivers.spi.loopback passes on
qemu-vexpress-a9 without a PL022 model. Fix utest include/CPPPATH
and align Kconfig/rtconfig bus name.

Verified: scons + qemu utest_run components.drivers.spi.loopback PASSED.

Fixes #11972 (SPI/QEMU checklist item).

* drivers/spi: fix clang-format violations in spi_virt_bus.c

Fix the 'Check File Format and License' CI job failure:

- put the spi_virt_ops initializer brace on the assignment line
- add the missing newline at end of file

No functional change.

* drivers/spi: separate virt bus Kconfig from loopback utest (#11972)

Add a dedicated, default-off RT_UTEST_SPI_VIRT_BUS switch (default name
spi_virt) so enabling RT_UTEST_SPI_LOOPBACK no longer compiles or
registers a software SPI bus. Hardware loopback now always runs on the
real controller named by RT_UTEST_SPI_LOOPBACK_BUS_NAME, while QEMU/CI
targets opt in to the virtual bus explicitly.

Also move the utest enablement out of the qemu-vexpress-a9 BSP defaults
and into ci.attachconfig as peripheral.SPI_VIRT_LOOPBACK.

* cla: empty commit to retrigger license/cla check (#11979)

* ci(utest): add A9 SPI loopback virt bus config (#11979)

* [drivers][spi] gate virtual SPI bus utest on !RT_USING_DM

RT_UTEST_SPI_VIRT_BUS compiles spi_virt_bus.c, which registers a software
loopback bus with rt_spi_bus_register(). That path needs no device tree
node, so on a BSP that enables RT_USING_DM and RT_USING_OFW the
registration fails with -RT_EINVAL when no matching DT node exists.

Add "depends on !RT_USING_DM" to the option and document in help that it
is only available without the device model and must stay disabled on DM
based BSPs. spi_virt_bus.c is already fully wrapped in
#ifdef RT_UTEST_SPI_VIRT_BUS, so no C change is needed.

The A9 utest config (bsp/qemu-vexpress-a9) has RT_USING_DM disabled, and
.github/utest/configs/components/spi.cfg still enables both the virt bus
and the loopback test with bus name "spi_virt", so CI coverage is kept.

Refs #11972
2026-11-08 14:48:35 +08:00
bernard 2b0b1044c0 [libc][posix] fix: validate fd type in timerfd_settime/gettime
timerfd_do_settime() and timerfd_do_gettime() used vnode->data from any
file descriptor as struct rt_timerfd. Validate that the descriptor's file
operations are timerfd_fops before dereferencing the private data, using
df->fops under DFS v2 and vnode->fops under DFS v1.
2026-11-08 14:12:22 +08:00
bernard cf85de90b8 [libc] fix: bounds-check timer id in timer_gettime/settime
timer_gettime() and timer_settime() indexed _g_timerid[] with the raw
timer_t value, unlike timer_delete(). Reject ids >= TIMER_ID_MAX before
the lookup to keep the table access in bounds.
2026-11-08 14:11:28 +08:00
Parthiban Nallathambi 0b682003ff [libc][common] Match the picolibc asctime_r and ctime_r prototypes
picolibc declares the buffer as char[restrict static 26], so the pointer
form warns with -Warray-parameter and the NULL check with -Wnonnull-compare.
Other C libraries keep the pointer form.

Signed-off-by: Parthiban Nallathambi <parthiban@linumiz.com>
2026-11-08 14:01:29 +08:00
Rbb666 c63d7bc9f4 [kernel] fix non-SMART CPU time accounting
Compile the user-time accounting branch only for RT_USING_SMART, so non-SMART threads contribute system or idle time. Preserve existing SMART accounting behavior.

Signed-off-by: Rbb666 <zhangbingru@rt-thread.com>
2026-11-07 21:39:27 +08:00
usualtreee 7395c5d7f0 [ci][utest] run DAC and I2C framework tests in QEMU (#11990)
* [ci][utest] run DAC and I2C framework tests in QEMU

* [ci][utest] split DAC and I2C QEMU jobs
2026-11-06 13:10:53 +08:00
CYFS 16d725e578 [utest][can] Add CAN send and receive tests (#11752)
* [utest][can] Add CAN send and receive tests

* [utest][can] Fix external CAN FD receive timeout

Check the no-progress timeout after duplicate or unmatched frames, and
only wait on the receive semaphore when no complete frame is available.
Exit immediately once all expected patterns have been received.

Format the test with the current mainline configuration and clang-format
22.1.8.

Validation: reproduced the original duplicate/unmatched-frame hang with
a 50-tick timeout and a 1000-tick watchdog. All 22 host-stub scenarios pass,
including timeout renewal, tick wraparound, empty reads, error propagation,
and successful reception. The mainline formatting check also passes.
No full BSP build or hardware test was performed.
2026-11-06 09:45:46 +08:00
CYFS 905e4832bf [UTEST][SDIO] Add block device read and write test (#11758)
* [UTEST][SDIO] Add block device read and write test

* [UTEST][SDIO] Fix change log author

* [utest][sdio] Format block read and write test

Align macros and continuation indentation using the current mainline
configuration and clang-format 22.1.8.

Validation: the mainline formatting check and git diff --check pass.
Verified that all changes are whitespace-only.
2026-11-06 09:44:49 +08:00
Bernard Xiong f97ab55751 [bsp][k230] add K230D support and Smart improvements #11897 2026-11-06 09:37:01 +08:00
wdfk-prog 7ac0b44a8d feat[bsp][stm32]: add Input Capture support for STM32F1 and STM32H7
- Implement RT-Thread Input Capture devices using STM32 HAL TIM1-TIM4, with configurable channels, filters and initial capture polarity.

- Add STM32F1 and STM32H7 configuration headers and integrate the driver into Kconfig and SConscript.

- Handle APB timer clock multipliers, TIMPRE and 32-bit counter capabilities using HAL feature macros.

- Clear pending capture and overcapture flags before restarting a capture channel.
2026-11-06 09:20:03 +08:00
TENGZIJUN 89c70abccd kconfig部分搬至arm/kconfig 2026-11-05 22:26:23 +08:00
yan hu cbadbdf1bf tools: fix CI git diff path parsing 2026-11-05 18:40:30 +08:00
Geek_simple 8ba46938e8 fix dist strip compile command path parsing 2026-11-05 18:40:18 +08:00
wdfk-prog e81380c798 fix[tools][eclipse]: avoid unnecessary project file rewrites during eclipse target generation 2026-11-05 18:36:54 +08:00
hanzhijian 67861fa4fd [drivers][virtio] Fix RX buffer leak on pbuf allocation failure 2026-11-05 18:30:59 +08:00
Old-Ding e2e507c499 drivers: fix CFI MTD array bounds checks (#11558)
* drivers: fix CFI MTD array bounds checks

Generated-by: OpenAI Codex
Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>

* drivers: reject truncated CFI erase geometry

A truncated erase-region table leaves the full flash size registered
with only part of its sector geometry. Fail probing instead of exposing a
device whose erase address lookup can select the wrong sector.

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>

* drivers: fix CFI log indentation

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>

---------

Signed-off-by: Old-Ding <35417409+Old-Ding@users.noreply.github.com>
2026-11-05 18:30:26 +08:00
Adil Alperen ÇiftciandAdil Alperen Ciftci d279c43627 dfs/posix: validate bounds and safely detach listener in signalfd_close (#11935)
* dfs/posix: enforce bounds check and clean unregister in signalfd

Validate array bounds on signalfd notification registration and remove
the unsafe global index counter.

Tie the registered process lifetime to the registration: each slot in
sfd->lwp[] holds an LWP reference, and the listener node carries a detach
hook that the process exit path runs under LWP_LOCK to unlink the node,
clear the slot and drop the reference. Final close therefore never walks
a freed process, and a child that registered through an inherited
descriptor is unregistered when it exits.

Move every change of lwp->signalfd_notify_head behind lwp_signal_notify_*
helpers in the lwp core, which take LWP_LOCK, the lock lwp_signal_notify()
traverses the list under. The lock order is LWP_LOCK -> sfd->lock, the
same order the signal path already uses; sfd->lock is never held while
taking LWP_LOCK, and a node is only unlinked under LWP_LOCK, so no
in-flight notification can be inside it when it is freed.

Tear down the vnode, context and mutex before fd_release() when the
initial registration fails, and return instead of falling through to
freed objects. Propagate registration failures: read returns the error
and poll reports POLLERR before anything is added to the poll queue.

Fixes: #11933
Signed-off-by: Adil Alperen Ciftci <adilalperenciftci@users.noreply.github.com>

* dfs/posix: state the signalfd context lifetime and tighten close

State the lifetime assumption of the signalfd context explicitly: the
descriptor the caller operates on pins the context for the whole read,
poll and registration, and a concurrent close of that same descriptor by
another thread is not supported, which is what the existing read and poll
paths already rely on. The post-registration slot re-check therefore does
not add a new requirement.

Clear all registration slots in one pass under sfd->lock in close and run
the per-process unlink and reference drop outside the lock afterwards, so
the "clear first, unlink later" invariant is one block instead of a lock
round-trip per slot.

Rename SIGNALFD_SHART_MAX to SIGNALFD_SHARE_MAX while the macro block is
being touched.

Signed-off-by: Adil Alperen Ciftci <adilalperenciftci@users.noreply.github.com>

* dfs/posix: keep the LWP lock out of signalfd close and make registration atomic

dfs_file_close() calls the signalfd close callback under the global DFS
file lock, and the process exit path takes that same lock while it already
holds LWP_LOCK (__exit_files() under _resr_cleanup()). Unlinking the
listeners from close() through lwp_signal_notify_remove_queue() therefore
took the two locks in the opposite order to process exit, and a parent
closing a shared signalfd while a registered child exits could block each
side on the other's lock.

Close no longer takes any LWP lock. It marks the context closing, detaches
it from the vnode and submits a release work item to the system workqueue.
The work takes the slots over under sfd->lock, unlinks the listeners under
each process's own LWP_LOCK with no other lock held, drops the references
the slots owned, and frees the context. A process that exits before the
work runs has already cleared its slot and dropped its reference through
the exit hook, so the work only sees slots that are still live.

Registration now does the lookup, the slot assignment and the listener
insertion in one critical section under LWP_LOCK(self) -> sfd->lock, the
same order the exit hook already uses. A slot is never visible without its
listener, so a second thread cannot observe a registration whose listener
is still missing, and the lookup cannot go stale between the check and the
assignment. lwp_signal_notify_add() accordingly expects the caller to hold
LWP_LOCK; the single-node unlink helper that the post-registration
re-check used is gone with that re-check. A registration that races with
close finds the closing flag and fails with EBADF instead of taking a slot
the release work will not see.

Signed-off-by: Adil Alperen Ciftci <adilalperenciftci@users.noreply.github.com>

* dfs/posix: do not allocate for an existing signalfd registration

signalfd_add_notify() allocated the listener node before looking the
calling process up, so read and poll on an already registered descriptor
failed with ENOMEM or POLLERR under memory pressure even though no node
was needed and a signal may already have been queued.

Look the process up first, under LWP_LOCK(self) -> sfd->lock, and return
from there when it is registered or the context is closing. Only when a
new registration is needed drop the locks, allocate the node, take the
locks again and repeat the lookup unconditionally: the closing flag, an
existing registration and the free slot are all re-evaluated before the
slot is assigned and the listener is linked in the same critical section.
A node left over because another thread registered the process meanwhile
is freed after the locks are released.

Signed-off-by: Adil Alperen Ciftci <adilalperenciftci@users.noreply.github.com>

* dfs/posix: align signalfd context member comments for clang-format

Signed-off-by: Adil Alperen Ciftci <adilalperenciftci@users.noreply.github.com>

---------

Signed-off-by: Adil Alperen Ciftci <adilalperenciftci@users.noreply.github.com>
Co-authored-by: Adil Alperen Ciftci <adilalperenciftci@users.noreply.github.com>
2026-11-05 16:37:23 +08:00
40e07d970e [smart] lwp: enforce user buffer validation and copyin/copyout in terminal ioctl (#11941)
* [smart] lwp: enforce user buffer validation and copyin/copyout in terminal ioctl

In the RT-Smart terminal subsystem, userspace ioctl commands (such as TIOCGWINSZ, TIOCSWINSZ, TIOCGPGRP, TIOCGSID, FIONREAD, and TIOCGPTN) were previously passed directly to underlying FreeBSD ioctl handlers as raw user pointers without kernel staging or copy validation.

This patch addresses the user pointer dereference sinks:
1. In lwp_tty_ioctl_adapter(), stage arguments in kernel stack buffers and use _copy_from_user() / _copy_to_user() (lwp_get_from_user / lwp_put_to_user) for TIOCGWINSZ, TIOCSWINSZ, TIOCGPGRP, TIOCSPGRP, TIOCGSID, TIOCSTI, TIOCOUTQ, FIONREAD, and modem commands.
2. In ptm_fops_ioctl(), safely buffer arguments for TIOCGPTN, TIOCPKT, TIOCSIG, TIOCGPGRP, TIOCGSID, FIONREAD, TIOCOUTQ, TIOCGWINSZ, TIOCSWINSZ, and termios settings, returning -ENOTTY on unrecognized commands.
3. In tty_generic_ioctl(), add defense-in-depth boundary checks using lwp_in_user_space() to safeguard kernel memory from arbitrary pointer dereferences.

Signed-off-by: Adil Alperen Çiftci <adilalperenciftci@users.noreply.github.com>

* [smart] lwp: make the tty ioctl adapters the single uaccess boundary

lwp_tty_ioctl_adapter() and ptm_fops_ioctl() (through
lwp_ptmx_ioctl_forward()) already stage every user argument into a kernel
buffer before entering the BSD tty layer, so tty_generic_ioctl() only ever
sees kernel pointers on the syscall path. Drop the lwp_in_user_space()
branches that were added there, and the older one on TIOCSPGRP, so the
trust boundary is in exactly one place per entry point and the switch no
longer mixes two models.

Zero the staging union in lwp_ptmx_ioctl_forward() before the backend
runs: an *_OUT command copies it back to the caller, and a backend that
returns 0 without filling it would otherwise hand out stack contents.

Add the BSD termios commands TIOCGETA, TIOCSETA, TIOCSETAW and TIOCSETAF
to the /dev/ptmx argument table so they keep reaching the tty layer as
they did before the table existed. The termio-based TCGETA family is not
handled by the BSD layer on this path and stays ENOTTY, as before.

Rename lwp_ptmx_ioctl_arg_type() to lwp_ptmx_ioctl_arg_type_get() so the
function no longer shares its name with the enum tag, rename the test
case to testcases.lwp.tty_ptmx.regression since it covers more than the
buffer bounds, and add the terminal directory to the utest CPPPATH
instead of a relative include.

Signed-off-by: Adil Alperen Ciftci <adilalperenciftci@users.noreply.github.com>

* [smart] lwp: drop duplicate termios cases from the ptmx ioctl table

In this port TIOCGETA and TIOCSETA/TIOCSETAW/TIOCSETAF are defined to the
same values as TCGETS and TCSETS/TCSETSW/TCSETSF, so listing both sets
makes the switch fail to compile with duplicate case values. The TCGETS
family entries already cover the BSD names; the test asserts for the BSD
spellings stay valid through the aliases.

Signed-off-by: Adil Alperen Ciftci <adilalperenciftci@users.noreply.github.com>

---------

Signed-off-by: Adil Alperen Çiftci <adilalperenciftci@users.noreply.github.com>
Signed-off-by: Adil Alperen Ciftci <adilalperenciftci@users.noreply.github.com>
Co-authored-by: Adil Alperen Çiftci <adilalperenciftci@users.noreply.github.com>
Co-authored-by: Rbb666 <zhangbingru@rt-thread.com>
2026-11-05 16:11:50 +08:00
liangzhan5 7feb0edadb [components][ofw]fix: add depth limit check for fdt_unflatten to prevent stack flow #11901 2026-11-05 16:05:45 +08:00
seteiro 5a385acca1 utest/watchdog: tolerate timeout quantize and non-stoppable close (#11446) 2026-11-05 15:52:18 +08:00
seteiroandGrok 6e7f9e3a37 [utest][watchdog] Add watchdog smoke test for #11446
Add components.drivers.watchdog.smoke covering device find/open and
timeout set/get. Optional start/keepalive/stop stays off by default
to avoid board reset when STOP is unsupported.

Co-Authored-By: Grok <seteiro@mail.grokbot.com>
2026-11-05 15:52:18 +08:00
CYFSandRbb666 8b3c2db64b [ci] Fix scheduled failure reporting and monthly BSP builds (#11921)
* [ci] Fix scheduled failure reporting and monthly BSP builds

* [ci] Preserve partial monitoring results and abnormal job details

---------

Co-authored-by: Rbb666 <zhangbingru@rt-thread.com>
2026-11-05 14:56:59 +08:00
usualtreee 964dd80240 [drivers][nvme] Fix inactive namespace allocation leaks (#11920)
Allocate namespace devices only after validation and release them on registration failure.
2026-11-05 14:11:03 +08:00
usualtreee 995cb5ac3a [dfs][9pfs] Bound response parsing by received data length (#11918)
Validate error codes and limit file and directory parsing to the received reply while preserving unaligned access fixes.
2026-11-05 13:50:52 +08:00
CXSforHPU 1a27d8b098 [tools][mkdist] Fix repeated RTT_ROOT injection and read-only directory cleanup (#11874)
Make RTT_ROOT injection idempotent and handle read-only files when rebuilding distribution directories.
2026-11-05 13:23:46 +08:00
usualtreee bd99153931 [utest][i2c] 增加 I2C 框架模拟总线测试 (#11982)
覆盖消息转发、10 位地址、错误传播、锁释放和收发返回值。
2026-11-05 11:18:32 +08:00
usualtreee 54862ee1e8 [utest][dac] 增加 DAC 框架模拟设备测试 (#11976)
覆盖设备注册、通道控制、数据写入、错误传播及重复执行。
2026-11-05 11:18:17 +08:00
Chen Moushun 7b0edb4979 [drivers][ipc] 校验 pipe ioctl 用户指针 (#11971)
在用户态 ioctl 路径验证目标地址并检查回拷长度。
2026-11-05 11:18:03 +08:00
usualtreee 3277e831bf [drivers][graphic] 拒绝非法帧缓冲偏移 (#11970)
在读写长度计算前拒绝负偏移和缓冲区外偏移。
2026-11-05 11:17:49 +08:00
Zhang Yuyang b5de39d977 [drivers][virtio] 修复 RPMsg 探测错误及 NS 资源泄漏 (#11968)
传播 NS 分配错误,并在注册失败和卸载路径释放资源。
2026-11-05 11:17:34 +08:00
usualtreee 7f1f625f36 [bsp][bluetrum] 校验 AB32 ADC 通道 (#11962)
统一 ADC 回调签名,在转换和寄存器索引前拒绝无效通道。
2026-11-05 11:17:20 +08:00
usualtreee c4d85d8628 [net][dhcp] 限制地址池耗尽后的客户端分配 (#11947)
在地址池遍历完成后退出分配,避免持续分配客户端对象。
2026-11-05 11:17:07 +08:00
陈泽堂 0aae54ae97 [drivers][serial] 保留共享串口的接收回调 (#11931)
仅在最后一个使用者关闭串口时清理接收回调。
2026-11-05 11:16:53 +08:00
Chen Moushun d42ffde1b5 [bsp][allwinner] 增加 D1s QEMU 启动脚本 (#11903)
为 D1s BSP 提供匹配虚拟机参数的 QEMU 启动入口。
2026-11-05 11:16:29 +08:00
Bernard Xiong 4d1e4e58f0 [lwp] 校验 sigaction 信号编号 (#11899)
在信号处理表访问前校验信号编号,避免越界访问。
2026-11-05 11:16:16 +08:00
Bernard Xiong f14ab20efd [lwp] 修复信号顺序与 ELF 段保护 (#11895)
修正信号处理顺序和 ELF 段的内存保护设置。
2026-11-05 11:16:02 +08:00
Bernard Xiong 2b69e18fc3 [libcpu][riscv] 修复 Smart MMU 与用户异常处理 (#11892)
修正 RISC-V Smart 的地址映射、用户异常处理及玄铁平台配置。
2026-11-05 11:15:49 +08:00
Bernard Xiong b47754d44b [sdio] 在块配置完成后设置块大小 (#11886)
使用块设备配置完成后的实际块大小初始化存储参数。
2026-11-05 11:15:36 +08:00
Chen Moushun 47831b7386 [dfs][9pfs] 修复协议字段未对齐访问 (#11876)
通过局部对齐变量读写协议字段,补充错误码边界检查和打开状态初始化。
2026-11-05 11:14:57 +08:00
陈泽堂 af3eb7b811 [usb][hid] 修正接口描述符协议选择 (#11873)
根据键盘和鼠标配置选择 HID 接口协议,并同步复合设备描述符。
2026-11-05 10:58:37 +08:00
ymj0440 a0a2d762fa feat(bsp): add Kconfig and .config for efm32 to support menuconfig 2026-11-05 10:51:45 +08:00
Bernard Xiong f6857f9fb0 [DM/PCI] Validate MSI-X table BIR and offset against BAR (#11986)
* [DM/PCI] Validate MSI-X table BIR and offset against BAR

BIR and the table offset in the MSI-X capability are controlled by the
device. msix_table_remap() used BIR directly as an index into
pdev->resource[] and never checked the table against the BAR size, so a
malicious device could make the kernel map and write to an arbitrary
physical address during probe.

Reject out-of-range BIR values, unassigned or zero-sized BARs, and
tables that do not fit completely inside the assigned BAR. Also verify
that the requested vector count does not exceed the table size read
from the MSI-X control register.

Fixes #11985

* [DM/PCI] Fix cppcheck warnings in MSI-X code

- Restore the default IRQ only when an MSI descriptor exists, avoiding
  a potential NULL pointer dereference in rt_pci_msi_shutdown
- Initialize the error code in msix_setup_msi_descs so that an empty
  vector list returns a defined value
2026-11-05 10:47:23 +08:00
Bernard Xiong d3a368d565 [drivers][serial] improve TIOCGWINSZ and termios updates #11891 2026-11-04 21:33:18 +08:00
bernardandDeepSeek 4.1 Flash d59285201a [drivers][block] reject GPT entries with ending_lba before starting_lba
is_pte_valid() accepted a GPT entry as long as both LBAs were inside the
disk, so a crafted image could set ending_lba < starting_lba. The size
computed in efi_partition() then underflowed to a huge value and was
registered as the logical partition size.

Reject entries whose end LBA is below the start LBA, and compute the
partition start/size only after the entry passed validation. This avoids
evaluating the underflow at all and reuses the validated start value for
the size calculation.

Fixes RT-Thread/rt-thread#11271.

Co-authored-by: DeepSeek 4.1 Flash <noreply@deepseek.com>
2026-11-04 21:30:29 +08:00
kurisaw 1f024e372b docs/release: add mainline versioning and release process documentation 2026-11-04 10:44:19 +08:00
Zhaoqi Xu e12183f7b8 [bsp][dm365] reject zero max_hz in SPI setup to avoid divide-by-zero 2026-11-03 13:11:42 +08:00