Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp86814imm; Thu, 2 Aug 2018 14:30:18 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdUYt4WScObEJ13wAJ4bHT+VmROfv0uue7gv0TiH2bx7+OQ5wMQU//iELPdqU/RY1Tb0wct X-Received: by 2002:a63:9f0a:: with SMTP id g10-v6mr1057382pge.324.1533245418937; Thu, 02 Aug 2018 14:30:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533245418; cv=none; d=google.com; s=arc-20160816; b=xYmC/vEaxeWC7rJn7i0+m0ITF9W1y1U6J7benH9CnYOHGJSr7Ef+OED38iTWd0pxwg j4jsrm+5fiM/Fwz3g7BHuXss5YupNtvCIpFviUvNsK3CIOJi2VVVmN8pjMl4E7Ef9En9 GxGs7hLyK7N/kFTUDsu/l0FXf6+4v51Qd5HRt2atKkIERNh3jXyCSvV0VSv4t4+4tSAz VNWYuPY1vZaCmIvzM5KyTxizgwmKzCos12pUE36ZfJqRCgWQgp+vfFdK+vj+z+5Rbh9c HcT24QqbJayK6JpBucZwbC8uuuK2shCNg+q+KlEpH+t4I9O21otVraaOd69plwyGjmjz b+NQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-signature :arc-authentication-results; bh=2f2oZ5nTFhXCCxmD98z07ydS7myVbDZ2bdmu5+ktmlM=; b=Os96et3/q5EBHU2xWuRyuJVpU2vvkfQ0XxVAxk24c0dk+OOW3Rf+AWye4AbpCyH+3o EYG1AUWgLrgmL38LqStJcct9vLEy7QxQi+cNXlSZll2EOhl7DJ3zwMMN2WSbaopWKU/e 22POjvPD1vbw1dwofRUq410kDkqDZhONRuF6HWGiXum10deIdlJBHaHXZFf7Vx4MNKwQ RaPB8Z1mAkiBtVsBEV1oU8+dbzuZcXQRZNV1FZk5kJy4ajwgq8/p31c4H2VpFDp4xNE5 AtWukWAnLgUN33pJ8pjjSJJx5t+aYxRdh4IM2jkmTo6VsO4OJ0B8QV0866y7qDeNpAsP Gc9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=GNnbjhcm; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=Kw0U5Rxa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m70-v6si3451324pfa.45.2018.08.02.14.30.04; Thu, 02 Aug 2018 14:30:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=GNnbjhcm; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=Kw0U5Rxa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732252AbeHBXV0 (ORCPT + 99 others); Thu, 2 Aug 2018 19:21:26 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:59162 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732116AbeHBXV0 (ORCPT ); Thu, 2 Aug 2018 19:21:26 -0400 Received: from pps.filterd (m0001255.ppops.net [127.0.0.1]) by mx0b-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w72LROUf012185; Thu, 2 Aug 2018 14:28:07 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=2f2oZ5nTFhXCCxmD98z07ydS7myVbDZ2bdmu5+ktmlM=; b=GNnbjhcmT+v8UeY2Kny7RJDr6nYm+4TovMCnyxujA46pK5kK7QS29T7ELDiuAUvb2QN1 VpluBOiPOomQ+bi4Tfjrp9QlhcpkNyE2egsz+DLy4gytm4IRP+YRnViAd1ZaRvllaH+H f5Idg5PXJCANWPoLXaLhvHmrpnJZ7RproIk= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0b-00082601.pphosted.com with ESMTP id 2km6jy8nt5-7 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 02 Aug 2018 14:28:07 -0700 Received: from NAM05-CO1-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.20) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 2 Aug 2018 14:28:04 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2f2oZ5nTFhXCCxmD98z07ydS7myVbDZ2bdmu5+ktmlM=; b=Kw0U5RxaNPqaqQhMTSSiudcrhsfMkinBShFvT4HbEHKFr98s49L01X4SqX1vJkMX5c4Z7q8OkhzRSTH8GYrDuYS52mcTq56N8mgh9kTFqcmh9+VDDWz/6Kzu28DjhImqm4UKb1CcCLbkmaGeiUEJnWcQLcd0dx8V8tWaGYxQhic= Received: from castle.thefacebook.com (2620:10d:c090:200::4:6653) by BY2PR15MB0167.namprd15.prod.outlook.com (2a01:111:e400:58e0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.19; Thu, 2 Aug 2018 21:27:59 +0000 From: Roman Gushchin To: CC: , , Roman Gushchin , Alexei Starovoitov , Daniel Borkmann Subject: [PATCH v7 bpf-next 06/14] bpf/verifier: introduce BPF_PTR_TO_MAP_VALUE Date: Thu, 2 Aug 2018 14:27:22 -0700 Message-ID: <20180802212730.18579-7-guro@fb.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180802212730.18579-1-guro@fb.com> References: <20180802212730.18579-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [2620:10d:c090:200::4:6653] X-ClientProxiedBy: MWHPR19CA0058.namprd19.prod.outlook.com (2603:10b6:300:94::20) To BY2PR15MB0167.namprd15.prod.outlook.com (2a01:111:e400:58e0::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a96e1209-e30f-4420-75c9-08d5f8bed242 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:BY2PR15MB0167; X-Microsoft-Exchange-Diagnostics: 1;BY2PR15MB0167;3:CwYIRbp+kyEDKZEO/BAgVDORvTrGh/Hs4GP31GsWgk0a24bkrJfWvvCuqfLlRzSXgyWd5uhNTOxrN8f/a3yphDLe5+F0ck8sRhkyrTXV8yuvCehwEBVIRy7yr43tkokJMplScTafx5PwOtV+UIYNS/HZeu920K5CDAFrYQB7jxDCQLW+XCwNh3n9SPhgIHdCukWbhVlnmIuPN9GfeN6Krm3LCZ9/Xj39vzLl4UJVHzvI6QCTcVIR4L7W5SrYmY9/;25:04pQUIAvAhdfbMVDDtTvnVXadcYxp10yioslnzXOV7f4fCLzt9Kju4MCf6dvX/ZIsuzULkpaHY+GFMQOW3/Aj6/G15vP9HDxtkpTTd3U0OcOsco5p+KpCY5kMmX4vlKbT/ToBi+8o8ePgA+Rv6GiX9gZ7p2zZ5rT10PeJR2XlUaZiKqBNFT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D6P2XFDFppXrWz/TXopaTfgil4IFLfNY2pvfjMMQNmdN79SAQ0CRE5U92reEV6sTLhzWt/Mr31Mi7VcuOwMPMmC1I+a9WAwE8U/OFwzsb9mpbWf5umABQXPjlgrBnBZRvmrZ27DV/BelbI+FxJbbTbhm7MdNEWAub7FBQDbmWYFX4fs0Er8h9rKnPrI6Y7LPCRAqP+Hh0Mlq/bvnOvYcu7fmQtAJB X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231311)(11241501184)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011)(7699016);SRVR:BY2PR15MB0167;BCL:0;PCL:0;RULEID:;SRVR:BY2PR15MB0167; X-Forefront-PRVS: 07521929C1 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(396003)(136003)(346002)(376002)(366004)(39860400002)(199004)(189003)(446003)(48376002)(2906002)(97736004)(86362001)(1076002)(305945005)(8676002)(186003)(8936002)(11346002)(6916009)(6666003)(7736002)(486006)(6116002)(2351001)(476003)(14444005)(106356001)(81156014)(2616005)(2361001)(105586002)(16526019)(478600001)(81166006)(69596002)(47776003)(46003)(53416004)(36756003)(316002)(53936002)(51416003)(4326008)(52116002)(50226002)(16586007)(68736007)(54906003)(50466002)(52396003)(386003)(6506007)(5660300001)(76176011)(6486002)(25786009)(6512007)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR15MB0167;H:castle.thefacebook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?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Xa7jV1e7/aHDRdm/keMpexTIeY1ksjG+peymhebUYyGgDTF4i9iZhdvpGrVwkdsh8b3K24b62LycCqpPY3f+h6mfAjT4vCkoHv++wcNIjCQsxFC0td8jbCckxww4AOv2dQdfBX2ATHIn9Mv3jjLS4XP2L5NczmNAmGqS5Ab4Q0MyQCAp/a5XyTxIhK8yScnIeSSdYiQcVGphK+1aTMwdf0dr9UXZ9HOzQRTNczU0I+QH/784TQvWj+GsFJc9pgZeyuDcI5XeMD/gy/AMCmqP55q/vKUHe3Lv9bMHie4Sngi/+EHuElUgx71SplCs7/LgJcxbRzmNfVASGPZPGqvhIyGkhByJjmxlyhDkPAUawPVnovvN3PNRqwKiw==;5:2BmrzMKPkPggoiPPI0znOPCi6MT2ntWQUZ52kJUjok2b6GMIPDzChEwznUW6/4m6ryf1oAkkQx+QGzfRUJgXIM47GztkDp5kb7FkWmhZkCnU8vsZ5IwoFJLt6mU3lP6d2ZRX5Fa3XWyRX2vqkxYyILne3tzZ5/giGnTRvCGLPC8=;7:gfVzyKPLktxLu1IZqaQTUO0uqDAfZEPicAG6G0+fQnZZjRSID+e8EUzfqCYmpwnb4g9Dd7dNHw06IfxMSKe7x7PhmR8WzZWjU3Z0pLIskTS+EqFwnP/JZsOb1/JlOWQjisJMArI+Phsuy7lUAb1AE248HC1rl6o1NFk9D7QnCC5E8RCrNQgPJ0p+/ziFFihTZKQQ8haWE764I7JWQO3yhfajAvU8y8iWLRzBBmrUNP18k/yzzonta608Ho9Yy/6k SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BY2PR15MB0167;20:7Bs5+Jnj+4IBet4eqfHVcOVvZ/jfbeyglShbXm3w4Deb0/xXKHVcVieWhuWbHDUJOLiriikWUDR8XWbtgEEJea7A3JHJUlodbm7L9S73K4bAm7/2gne5aovDBUapGs305UyG1SfnS8gNmBLimVNtclq8M8rXC4wBBjTLaXNDB6o= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Aug 2018 21:27:59.0842 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a96e1209-e30f-4420-75c9-08d5f8bed242 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR15MB0167 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-02_05:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org BPF_MAP_TYPE_CGROUP_STORAGE maps are special in a way that the access from the bpf program side is lookup-free. That means the result is guaranteed to be a valid pointer to the cgroup storage; no NULL-check is required. This patch introduces BPF_PTR_TO_MAP_VALUE return type, which is required to cause the verifier accept programs, which are not checking the map value pointer for being NULL. Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Martin KaFai Lau --- include/linux/bpf.h | 1 + kernel/bpf/verifier.c | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 16be67888c30..ca4ac2a39def 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -155,6 +155,7 @@ enum bpf_arg_type { enum bpf_return_type { RET_INTEGER, /* function returns integer */ RET_VOID, /* function doesn't return anything */ + RET_PTR_TO_MAP_VALUE, /* returns a pointer to map elem value */ RET_PTR_TO_MAP_VALUE_OR_NULL, /* returns a pointer to map elem value or NULL */ }; diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c index 7e75434a9e54..1ede16c8bb40 100644 --- a/kernel/bpf/verifier.c +++ b/kernel/bpf/verifier.c @@ -2545,8 +2545,12 @@ static int check_helper_call(struct bpf_verifier_env *env, int func_id, int insn mark_reg_unknown(env, regs, BPF_REG_0); } else if (fn->ret_type == RET_VOID) { regs[BPF_REG_0].type = NOT_INIT; - } else if (fn->ret_type == RET_PTR_TO_MAP_VALUE_OR_NULL) { - regs[BPF_REG_0].type = PTR_TO_MAP_VALUE_OR_NULL; + } else if (fn->ret_type == RET_PTR_TO_MAP_VALUE_OR_NULL || + fn->ret_type == RET_PTR_TO_MAP_VALUE) { + if (fn->ret_type == RET_PTR_TO_MAP_VALUE) + regs[BPF_REG_0].type = PTR_TO_MAP_VALUE; + else + regs[BPF_REG_0].type = PTR_TO_MAP_VALUE_OR_NULL; /* There is no offset yet applied, variable or fixed */ mark_reg_known_zero(env, regs, BPF_REG_0); regs[BPF_REG_0].off = 0; -- 2.14.4