From patchwork Wed Jan 24 07:48:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang YanQing X-Patchwork-Id: 865338 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Yf4IdrS4"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zRQVF0GgFz9s7n for ; Thu, 25 Jan 2018 00:09:08 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933700AbeAXNIz (ORCPT ); Wed, 24 Jan 2018 08:08:55 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:44110 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933305AbeAXNIx (ORCPT ); Wed, 24 Jan 2018 08:08:53 -0500 Received: by mail-pf0-f196.google.com with SMTP id m26so2989415pfj.11; Wed, 24 Jan 2018 05:08:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:mime-version :content-disposition:user-agent; bh=6sGndZX2XjDUGYSaVTKpSHWnf0dg4uRxUzUVucwJsAE=; b=Yf4IdrS4pcub8zKvXsAfoP64TcfQv9dwO+o+HCY6FTFx2dAGJd+ljjcqitirahfJHN dQzMEQDdhDiTyMIo6r+OST2ocsjVZFdvDfJTXUKxToPp8fJtxkFDOzZX4Yd5Q8dSPjLp 05wixhbf1zOT/E+MTGs7Jz9UHDITtR5VNnmKSqCFxKC79jhhFBMfqxTNrl/sob8wCygV FEVGBwgAU4hITExJElZ1bA5lOm+hCq5fACczkjOgbW3dLLVk8mu63Zt2ClZQh49t7k/S /G1kqKZI08sbHAUgyM356sfO+vVcB6Biox2Xv7jfVbaRC2PO76hs4DY6AIeFHHTI0WiI kTMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:mime-version:content-disposition:user-agent; bh=6sGndZX2XjDUGYSaVTKpSHWnf0dg4uRxUzUVucwJsAE=; b=AynlxbMl4CfYZL/NlN1GtPLcA2Ih8tjixsH5f3Bq27WiT3OYoQdXXYH0Ax2+SAvkvW kR/+fVa653x6aY8YmqNAHZwtU9Lgv8bq0BWQ/VIISvnM/MVrGj167lqDdjjJ1ImZY9CR SMkfxdQYAsuY1bbo+wKM5YPE1e0kSOUIxIphgSe5KnwJgBihc9ol6TpNVRzwqXD5XFUw HXf4qX5wu9CwobbUDiRHd8dL33g7H4gt0pWcxAlCjK12EApzVjplUerUL+yoo41Cs99C onBPQ6/rrSUP3183PncIXR4aRlTxGBNF7SZKfeevE9NoWJqtB3L/gmYnKNjw6xxi1JiF 1YWA== X-Gm-Message-State: AKwxytd2zQXId3EgHrbObHREZX1j1X/0lrI+WzkLloKKPjN2JGsXlX3Y bnEdPfNHJCkRugIZneFigxoVAw3H X-Google-Smtp-Source: AH8x22578p01Q5b+eWfRqGrt3hkSbv+WrVkGtjgrr3XqT7uIqdl0XXmXEU8+/U2qS7NLdmTE8o+FIQ== X-Received: by 2002:a17:902:44c:: with SMTP id 70-v6mr7980329ple.221.1516799333022; Wed, 24 Jan 2018 05:08:53 -0800 (PST) Received: from udknight.localhost ([27.154.196.208]) by smtp.gmail.com with ESMTPSA id a75sm11882835pfc.47.2018.01.24.05.08.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Jan 2018 05:08:52 -0800 (PST) Received: from udknight.localhost (localhost [127.0.0.1]) by udknight.localhost (8.14.9/8.14.4) with ESMTP id w0O7mSuO014368; Wed, 24 Jan 2018 15:48:58 +0800 Received: (from root@localhost) by udknight.localhost (8.14.9/8.14.9/Submit) id w0O7mQI0014365; Wed, 24 Jan 2018 15:48:26 +0800 Date: Wed, 24 Jan 2018 15:48:26 +0800 From: Wang YanQing To: davem@davemloft.net Cc: ast@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] bpf, doc: Correct one wrong value in "Register value tracking" Message-ID: <20180124074826.GA14229@udknight> Mail-Followup-To: Wang YanQing , davem@davemloft.net, ast@kernel.org, daniel@iogearbox.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.7.1 (2016-10-04) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org If we then OR this with 0x40, then the value of 6th bit (0th is first bit) become known, so the right mask is 0xbf instead of 0xcf. Signed-off-by: Wang YanQing Acked-by: Edward Cree --- Documentation/networking/filter.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/networking/filter.txt b/Documentation/networking/filter.txt index 8781485..a4508ec 100644 --- a/Documentation/networking/filter.txt +++ b/Documentation/networking/filter.txt @@ -1134,7 +1134,7 @@ The verifier's knowledge about the variable offset consists of: mask and value; no bit should ever be 1 in both. For example, if a byte is read into a register from memory, the register's top 56 bits are known zero, while the low 8 are unknown - which is represented as the tnum (0x0; 0xff). If we -then OR this with 0x40, we get (0x40; 0xcf), then if we add 1 we get (0x0; +then OR this with 0x40, we get (0x40; 0xbf), then if we add 1 we get (0x0; 0x1ff), because of potential carries. Besides arithmetic, the register state can also be updated by conditional branches. For instance, if a SCALAR_VALUE is compared > 8, in the 'true' branch