]> www.infradead.org Git - users/jedix/linux-maple.git/commit
docs/bpf: Document some special sdiv/smod operations
authorYonghong Song <yonghong.song@linux.dev>
Thu, 7 Nov 2024 17:09:24 +0000 (09:09 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 26 Feb 2025 15:54:49 +0000 (07:54 -0800)
commitb123480eec64dd879785c28f2a2d582d111cfb59
treee7edb9b2f34a12d7bce283e96954ed5eb1a72eda
parent9138048bb5899fc73cd951e8b7374351e37394d8
docs/bpf: Document some special sdiv/smod operations

Patch [1] fixed possible kernel crash due to specific sdiv/smod operations
in bpf program. The following are related operations and the expected results
of those operations:
  - LLONG_MIN/-1 = LLONG_MIN
  - INT_MIN/-1 = INT_MIN
  - LLONG_MIN%-1 = 0
  - INT_MIN%-1 = 0

Those operations are replaced with codes which won't cause
kernel crash. This patch documents what operations may cause exception and
what replacement operations are.

  [1] https://lore.kernel.org/all/20240913150326.1187788-1-yonghong.song@linux.dev/

Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20241107170924.2944681-1-yonghong.song@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Documentation/bpf/standardization/instruction-set.rst