iter5 sweep: remove iter3+iter4 Y2 instrumentation from v4l2.c

Removes iter3 Y2 v1 (S_EXT_CTRLS rejected logging) + iter4 Y2 v3
(TRY_EXT_CTRLS retry) + iter4 per-control TRY isolation. With the
frame-11 EINVAL fix landed in iter4 (385dee1), these diagnostics no
longer fire under expected workloads, and they're noise for any
upstream submission.

If a future EINVAL re-introduces, the per-control TRY isolation
pattern is documented in feedback_kernel_obfuscation_compound.md and
can be re-applied surgically.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-05 14:45:43 +00:00
parent b81ce6981f
commit 848fc0c4c4
+1 -54
View File
@@ -445,60 +445,7 @@ static int v4l2_ioctl_controls(int video_fd, int request_fd, unsigned long ioc,
controls.request_fd = request_fd;
}
rc = ioctl(video_fd, ioc, &controls);
if (rc < 0 && errno == EINVAL && ioc == VIDIOC_S_EXT_CTRLS) {
int saved_errno = errno;
request_log("S_EXT_CTRLS EINVAL: num_controls=%u error_idx=%u (count = obfuscated)\n",
num_controls, controls.error_idx);
for (unsigned int i = 0; i < num_controls; i++) {
request_log(" ctrl[%u]: id=0x%08x size=%u\n",
i, control_array[i].id, control_array[i].size);
}
/*
* Retry with VIDIOC_TRY_EXT_CTRLS — kernel comment in
* v4l2-ctrls-api.c:222-224 says TRY_EXT_CTRLS "never modifies
* controls [so] error_idx is just set to whatever control has
* an invalid value." Unlike S_EXT_CTRLS which deliberately
* obfuscates by setting error_idx = count.
*/
struct v4l2_ext_controls try_controls;
memset(&try_controls, 0, sizeof(try_controls));
try_controls.controls = control_array;
try_controls.count = num_controls;
if (request_fd >= 0) {
try_controls.which = V4L2_CTRL_WHICH_REQUEST_VAL;
try_controls.request_fd = request_fd;
}
int try_rc = ioctl(video_fd, VIDIOC_TRY_EXT_CTRLS, &try_controls);
if (try_rc < 0) {
request_log(" TRY_EXT_CTRLS retry: errno=%d (%s) error_idx=%u\n",
errno, strerror(errno), try_controls.error_idx);
} else {
request_log(" TRY_EXT_CTRLS retry: passed (S vs TRY semantics differ — likely cluster commit)\n");
}
/* Per-control isolation: TRY each control alone to learn which
* one fails on its own. Exposes per-control compound validators
* (std_validate_compound) below the cluster commit obfuscation.
*/
for (unsigned int i = 0; i < num_controls; i++) {
struct v4l2_ext_controls one_ctrl;
memset(&one_ctrl, 0, sizeof(one_ctrl));
one_ctrl.controls = &control_array[i];
one_ctrl.count = 1;
if (request_fd >= 0) {
one_ctrl.which = V4L2_CTRL_WHICH_REQUEST_VAL;
one_ctrl.request_fd = request_fd;
}
int one_rc = ioctl(video_fd, VIDIOC_TRY_EXT_CTRLS, &one_ctrl);
request_log(" TRY[%u] id=0x%08x: %s (errno=%d error_idx=%u)\n",
i, control_array[i].id,
one_rc < 0 ? "FAIL" : "pass",
one_rc < 0 ? errno : 0,
one_ctrl.error_idx);
}
errno = saved_errno;
}
return rc;
return ioctl(video_fd, ioc, &controls);
}
int v4l2_get_controls(int video_fd, int request_fd,