Front end hardening: bound the descriptor-chain walk, thin query and configure log lines
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 64/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- cpp
- Lĩnh vực
- computer-graphics
Hướng nghiên cứu
Start in clean/fsr/src/frontend.cpp: the pNext walk in CreateContext (~line 460) and CreateUpscale (~533), and the logging in Query (~1445) and Configure (~1195), which should use ShouldLogDispatch (~446). Read config.h:113 and log_win.h:137 for the log_dispatches and size rules. Done when a self-referencing chain returns FFX_API_RETURN_ERROR_PARAMETER in a CPU test, and 1200 jitter queries with log_dispatches=1 leave about 2 query lines.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Two small, independent changes in clean/fsr/src/frontend.cpp. Found by reading the code; neither has been reproduced.
1. The descriptor-chain walk is not bounded
What happens
The walk over the pNext chain in CreateContext (:460) has no bound, and neither has the walk in CreateUpscale (:533). A chain that points back to itself would hang the calling thread. DescribeChain (clean/fsr/src/ffx_describe.cpp:337) stops at 16 nodes and CreateAmdWithoutPrivateVersion (frontend.cpp:192) stops at 64.
When it can happen
Only for a caller that breaks the API contract. A cyclic chain is malformed input, and AMD's runtime walks the same chains when a call is forwarded to it. No working game or host sends one.
To do
At the top of CreateContext, walk the chain once with a bound of 64 (the existing limit) and return FFX_API_RETURN_ERROR_PARAMETER if it is exceeded. CreateUpscale then only sees chains that passed.
Test
CPU. Build a two-node chain that points back to itself, call fe->CreateContext, and expect ERROR_PARAMETER. Without the change the test hangs, so the runner's timeout catches it.
2. Query and configure log lines are not thinned with log_dispatches = 1
What happens
log_dispatches is documented to thin dispatch lines to one in 600 above the log size limit (clean/fsr/src/config.h:113, clean/fsr/README.md:124). ShouldLogDispatch (frontend.cpp:446) does that. Query (:1445) and Configure (:1195) use seen < 3 || config_.logDispatches instead and never thin. A game that queries the jitter every frame keeps writing about two lines per frame after the log passes log_max_mb. The text log is only moved aside when it is opened, above 8 MiB (clean/fsr/src/log_win.h:137).
When it can happen
Only with log_dispatches = 1, a diagnostic setting that is off by default, over a long session. With the default only the first 3 calls of each type are logged.
To do
In both places, use seen < 3 || (config_.logDispatches && ShouldLogDispatch(seen)). Failed calls are still always logged. A live size cap for the text log is optional; if added, it has to coordinate with the writer's write_mutex_.
Test
CPU. Give the front end a stand-in platform_.logBytes that returns more than log_max_mb, set log_dispatches = 1, run 1200 jitter queries, and check that the log holds about 2 query lines, not 1200.
- Ngôn ngữ chính
- C++
- Star
- 12
- Fork
- 2
- Merge trung bình
- 3 giờ 10 phút
- Pull request đã merge (30 ngày)
- 171
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của phantoslayer21/wronggpu
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
phantoslayer21/wronggpu#275 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
phantoslayer21/wronggpu#274 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
phantoslayer21/wronggpu#241 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug build
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
phantoslayer21/wronggpu#234 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Launcher tests: "an older record: update available" fakes a version newer than the test buildĐang mởbug build
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
phantoslayer21/wronggpu#233 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của phantoslayer21/wronggpu
Issue tương tự
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
ReyeMe/SaturnRingLib#155 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Nheko-Reborn/nheko#2092 ·
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 78/100
isocpp/CppCoreGuidelines#2345 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 71/100
ROCm/rocm-libraries#16108 ·
Maintainer thường phản hồi trong vòng 2 ngày