From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56BECC43215 for ; Thu, 21 Nov 2019 22:37:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2615F20708 for ; Thu, 21 Nov 2019 22:37:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=kroah.com header.i=@kroah.com header.b="GTH5lR8J"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="VktoD1Jc" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726548AbfKUWhl (ORCPT ); Thu, 21 Nov 2019 17:37:41 -0500 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:40347 "EHLO out3-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725956AbfKUWhl (ORCPT ); Thu, 21 Nov 2019 17:37:41 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id D7BE922C7A; Thu, 21 Nov 2019 17:37:40 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Thu, 21 Nov 2019 17:37:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=hal4X0n3HWrSNl8EikRGFxkks21 oOIJec8CstnXW8c8=; b=GTH5lR8JyUrnQGs2kxhpvqvIXbPZeqoOryHuH5Tve0d +a7STiCNAOH0pnQ0lhtlRSYHzLAf/UKZ9QExPWQ6gIjWVfmzokkJrdv6JXy3ExIh wC2QwxNIGCkxZcrObn5C6xjrkjWc78Wl3U7YxTNVtQxQMMU47ISI8VlwmMrZVyPh RfZ7eIYixbM5QscQ1omigOCW0aPydG50PBTCPMC4O4679kFNhwpCMbvseUUwps2/ m0/bzrctu6FKb6IZto5kcD8WwoWJ8X/XafVYRt8sFPjO1d1d/+f/KjswybNaILFS Rfwu0E9zgq3c20kIKzAU7gXMkn210ZMEiyOPTRQyj6g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=hal4X0 n3HWrSNl8EikRGFxkks21oOIJec8CstnXW8c8=; b=VktoD1Jc3bN8qSBMXH9323 4SJwwjsr3cOD/A5nDpfkV+g0LPKCBolQjRa9XBBjRUIp07XPBKOkMCany6xFfNWf JW/FixILJq/yiB1BHO3375+Mjb29mv53WnLmemM7Avduqu5cyak8IuJjWR4HxP/N cWdO1aOh5RA/x1hzbSDnaXSZ3rG6N3pPJtmFyyKMOP4BO5/5A3l3VVMenQ+i/nm5 ZXBh9YLz38LsrFR10CQ0YOCA8H4Fqvr7beCSuMj10nFNI14GDSEBLzaJC/pqPbaC hAvGa0qmmux9gl65DZI6GiA+ysFSFeKx5RXL0vCbfGpQ5PlnVax+B3A3J2ailVPw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrudehfecutefuodetggdotefrodftvfcurf hrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpeffhffvuffkfhggtggujggfsehttdertddtredvnecuhfhrohhmpefirhgvghcumffj uceoghhrvghgsehkrhhorghhrdgtohhmqeenucffohhmrghinhepkhgvrhhnvghlrdhorh hgnecukfhppeekfedrkeeirdekledruddtjeenucfrrghrrghmpehmrghilhhfrhhomhep ghhrvghgsehkrhhorghhrdgtohhmnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 2929F306005F; Thu, 21 Nov 2019 17:37:40 -0500 (EST) Date: Thu, 21 Nov 2019 23:37:38 +0100 From: Greg KH To: Daniel Borkmann Cc: Wang YanQing , stable@vger.kernel.org, stephen@networkplumber.org, ast@kernel.org, songliubraving@fb.com, yhs@fb.com, itugrok@yahoo.com, bpf@vger.kernel.org Subject: Re: [PATCH] bpf, x32: Fix bug for BPF_JMP | {BPF_JSGT, BPF_JSLE, BPF_JSLT, BPF_JSGE} Message-ID: <20191121223738.GA1170586@kroah.com> References: <20191121074336.GA15326@udknight> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Thu, Nov 21, 2019 at 10:43:28AM +0100, Daniel Borkmann wrote: > On 11/21/19 8:43 AM, Wang YanQing wrote: > > commit 711aef1bbf88212a21f7103e88f397b47a528805 upstream. > > > > The current method to compare 64-bit numbers for conditional jump is: > > > > 1) Compare the high 32-bit first. > > > > 2) If the high 32-bit isn't the same, then goto step 4. > > > > 3) Compare the low 32-bit. > > > > 4) Check the desired condition. > > > > This method is right for unsigned comparison, but it is buggy for signed > > comparison, because it does signed comparison for low 32-bit too. > > > > There is only one sign bit in 64-bit number, that is the MSB in the 64-bit > > number, it is wrong to treat low 32-bit as signed number and do the signed > > comparison for it. > > > > This patch fixes the bug. > > > > Note: > > The original commit adds a testcase in selftests/bpf for such bug, this > > backport patch doesn't include the testcase, because the testcase needs > > another upstream commit. > > > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=205469 > > Reported-by: Tony Ambardar > > Cc: Tony Ambardar > > Cc: stable@vger.kernel.org #v4.19 > > Signed-off-by: Wang YanQing > > Signed-off-by: Daniel Borkmann > > Thanks a lot for backporting & testing, Wang, much appreciated! Greg, if you get a > chance, please queue this & the other stable requests from Wang up. All now queued up, thanks. greg k-h