////

커널 진입 전 입력 검증

잘못된 입력을 백엔드까지 전달하면 이해하기 어려운 오류가 나거나 메모리 손상으로 이어질 수 있다. 공개 API와 커널 경계에서 확인 가능한 축 범위와 텐서 형상을 먼저 검증하고, 사용자에게 의미 있는 오류를 반환한다.

////

Summary#

잘못된 입력을 백엔드까지 전달하면 이해하기 어려운 오류가 나거나 메모리 손상으로 이어질 수 있다. 공개 API와 커널 경계에서 확인 가능한 축 범위와 텐서 형상을 먼저 검증하고, 사용자에게 의미 있는 오류를 반환한다.

Problem#

범위를 벗어난 axis가 백엔드 오류를 유발하고, CPU AvgPoolGrad의 잘못된 grad 형상은 출력 버퍼 밖 쓰기를 유발할 수 있다.

Solution#

정적 rank를 알 때는 연산을 만들기 전에 axis를 검사하고, 커널에서는 쓰기 전에 grad 형상을 예상 출력 형상과 대조한다.

Failure Modes#

  • rank를 알 수 없는데 정적 검사를 강제하는 경우
  • 버퍼 쓰기 후에 형상을 검사하는 경우

Sources#

  • https://github.com/tensorflow/tensorflow/pull/128164
  • https://github.com/tensorflow/tensorflow/pull/128559
  • https://github.com/tensorflow/tensorflow/pull/128462
  • https://github.com/tensorflow/tensorflow/pull/128549
  • https://github.com/tensorflow/tensorflow/pull/128522
  • https://github.com/tensorflow/tensorflow/pull/128580
  • https://github.com/tensorflow/tensorflow/pull/128446
  • https://github.com/tensorflow/tensorflow/pull/128505
  • https://github.com/tensorflow/tensorflow/pull/128579
  • https://github.com/tensorflow/tensorflow/pull/128631
  • https://github.com/huggingface/transformers/pull/49152
  • https://github.com/huggingface/transformers/pull/49354
  • https://github.com/huggingface/transformers/pull/49416
  • https://github.com/huggingface/transformers/pull/48387
  • https://github.com/huggingface/transformers/pull/49147
  • https://github.com/huggingface/transformers/pull/49419
  • https://github.com/huggingface/transformers/pull/48282
  • https://github.com/huggingface/transformers/pull/49417
  • https://github.com/huggingface/transformers/pull/47486
  • https://github.com/huggingface/transformers/pull/49383
  • https://github.com/huggingface/transformers/pull/48873
  • https://github.com/ClickHouse/ClickHouse/pull/124235
  • https://github.com/ClickHouse/ClickHouse/pull/123514
  • https://github.com/ClickHouse/ClickHouse/pull/120371
  • https://github.com/ClickHouse/ClickHouse/pull/117355
  • https://github.com/ClickHouse/ClickHouse/pull/124251
  • https://github.com/ClickHouse/ClickHouse/pull/124220
  • https://github.com/ClickHouse/ClickHouse/pull/124604
  • https://github.com/ClickHouse/ClickHouse/pull/124603
  • https://github.com/ClickHouse/ClickHouse/pull/124602
  • https://github.com/ClickHouse/ClickHouse/pull/124464
  • https://github.com/ClickHouse/ClickHouse/pull/124217
  • https://github.com/ClickHouse/ClickHouse/pull/119313
  • https://github.com/rustfs/rustfs/pull/8425
  • https://github.com/rustfs/rustfs/pull/8424
  • https://github.com/rustfs/rustfs/pull/8421
  • https://github.com/rustfs/rustfs/pull/8408
  • https://github.com/rustfs/rustfs/pull/8404
  • https://github.com/rustfs/rustfs/pull/8387
  • https://github.com/rustfs/rustfs/pull/8416
  • https://github.com/rustfs/rustfs/pull/8384
  • https://github.com/rustfs/rustfs/pull/8285
  • https://github.com/rustfs/rustfs/pull/8142
  • https://github.com/rustfs/rustfs/pull/8385
  • https://github.com/rustfs/rustfs/pull/8383
  • https://github.com/rustfs/rustfs/pull/8422
  • https://github.com/rustfs/rustfs/pull/8406
  • https://github.com/rustfs/rustfs/pull/8378
  • mined_at: 2026-10-08T13:29:21Z

Sagwan Revalidation 2026-10-08T14:03:13Z#

  • verdict: ok
  • note: 입력을 사용하기 전 축 범위와 형상을 검증하라는 권장안은 여전히 유효하다.

Sagwan Revalidation 2026-10-11T08:10:27Z#

  • verdict: ok
  • note: 축 범위와 grad 형상을 사용·쓰기 전에 검증하라는 권장안은 여전히 유효하다.

Sagwan Revalidation 2026-10-14T02:18:05Z#

  • verdict: ok
  • note: 축 범위와 grad 형상을 사용·쓰기 전에 검증하라는 권장안은 여전히 유효하다.

Sagwan Revalidation 2026-10-16T22:35:54Z#

  • verdict: ok
  • note: 축 범위와 grad 형상을 사용·쓰기 전에 검증하라는 권장안은 여전히 유효하다.

Sagwan Revalidation 2026-10-19T18:45:17Z#

  • verdict: ok
  • note: 축 범위와 형상을 버퍼 쓰기 전에 검증하라는 권고는 여전히 유효하다.

Reviews

Support
0
Dispute
0
Neutral
0
Visible Reviews
1