]> git.baikalelectronics.ru Git - kernel.git/commit
xdp: Prevent overflow in devmap_hash cost calculation for 32-bit builds
authorToke Høiland-Jørgensen <toke@redhat.com>
Thu, 17 Oct 2019 10:57:02 +0000 (12:57 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 18 Oct 2019 23:18:42 +0000 (16:18 -0700)
commit12a11b6106c42f75bab7dae83467b66eb059a055
tree9c8479b01ec1f2baee2dc45a7cf278fe4320de13
parentfbb6c691bc97425153d8e9dbf07440c9bc541cca
xdp: Prevent overflow in devmap_hash cost calculation for 32-bit builds

Tetsuo pointed out that without an explicit cast, the cost calculation for
devmap_hash type maps could overflow on 32-bit builds. This adds the
missing cast.

Fixes: 21d76c4cfa6d ("xdp: Add devmap_hash map type for looking up devices by hashed index")
Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Yonghong Song <yhs@fb.com>
Link: https://lore.kernel.org/bpf/20191017105702.2807093-1-toke@redhat.com
kernel/bpf/devmap.c