From: Alexei Starovoitov Subject: Re: [PATCH bpf] bpf: fix 32-bit divide by zero Date: Thu, 18 Jan 2018 14:40:59 -0800 Message-ID: References: <20180113025952.3451758-1-ast@kernel.org> <1516314654.3606.28.camel@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Cc: , , , To: Eric Dumazet , Alexei Starovoitov , Return-path: Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:41080 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753881AbeARWmc (ORCPT ); Thu, 18 Jan 2018 17:42:32 -0500 In-Reply-To: <1516314654.3606.28.camel@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: On 1/18/18 2:30 PM, Eric Dumazet wrote: > On Fri, 2018-01-12 at 18:59 -0800, Alexei Starovoitov wrote: >> due to some JITs doing if (src_reg == 0) check in 64-bit mode >> for div/mod opreations mask upper 32-bits of src register >> before doing the check >> > > Is the plan to fix JIT, and if they can all be fixed, > revert this patch ? No need to fix JITs. I'd rather remove 'cmp rX, 0' from JITs and let verifier emit it. It's more generic and gives us flexibility to decide what to do with divide by zero and other exceptions.