Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp7975942imm; Thu, 28 Jun 2018 12:23:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgpf/SISqtw+gPj0BtM9WaP+xg11mRCyqwjrdPdwjGQEL+nGnD8789tufR5tbV0GR3iDeuOSp X-Received: by 2002:a63:68c1:: with SMTP id d184-v6mr9794300pgc.239.1530213792436; Thu, 28 Jun 2018 12:23:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530213792; cv=none; d=google.com; s=arc-20160816; b=Ca1GG2tdAIm9aaREHwLokbXR1ZymGg0JFkQqGJG+GrbySAMpNw708y7LCbLWQonry6 dcmXckexc9Egn0HaLmkbq7Q4u0cXw2iSJGkJxf2tvPuhBhrJUYGhqkF32YesLvq6S0eF JA/5L7cUcHXMAi7PZZ5e9Tn5QCAuBYbPGH7fFEXa/ZoPYJdp1eHkb7cr2XUAE7YuFmLm bIr2oU5K0SsyMyjPDB7OAnp5MYAJc4LNR4OC8+urWvzIeJb1yqC9kpEv+oW/qaym7MMM wLzVre06GAu73sO8MBE/TyyW4SGUtaDVo5CEtwL7ct8pn7QXIUKW/3dmHOYJCiuSASkY H6fA== 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=NgXyUaAYyyXPp7pAZXAadjQHufX3Th3SE5gX1R08jVA=; b=qPnuhTkijF/+qHPzA5auFkdwBseyiZKHP87WVS/kHCnLLUsk1cjqtULzqiGqnT4A+H K+XHUBScR6NKNt19hpSB4lXEbisXBfpqVdkH0JLYyPbdco80DV+ED/MtliIl1rS9P8uy 1xkodgtLZXKXxo/9fRClwpjxH7P3VRUW/lGxZod1w8xpMEPjNx38TmuM8z2b0bJYJkCO AK6Ylavl2dP3GB1cYR8yAm8PmEvTCKUpf1XXSthzihXkTrb3yBVmep+hRsGyr+RUQeFN FNjyZXsiKM/kYnyyYGAP4oOLLq9yOnJ4Zl+l5CyblViO6X+/trEJcT3v5F/7Uu7j8HlH Cajw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b="rT/tAi1b"; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=gWEPjH0e; 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 c81-v6si7327976pfj.138.2018.06.28.12.22.27; Thu, 28 Jun 2018 12:23:12 -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="rT/tAi1b"; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=gWEPjH0e; 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 S1030317AbeF1QvS (ORCPT + 99 others); Thu, 28 Jun 2018 12:51:18 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:56922 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935747AbeF1Qs0 (ORCPT ); Thu, 28 Jun 2018 12:48: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 w5SGka5V013501; Thu, 28 Jun 2018 09:48:06 -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=NgXyUaAYyyXPp7pAZXAadjQHufX3Th3SE5gX1R08jVA=; b=rT/tAi1bGoZ6OTHowJw8nujexbIaCd3tvR1xTgVrKN7eB1Bg674LXMNhdEeD/XP0kUZX UuRWI5n/FQ54KIhNUy1D2YuYIiP8rpF+wCR/ruyS1oai3lDyW5fLL3IvhZPk0drugl25 vvn3t/wOt4XQtti760IcZ/8YZMBA5PCaoKs= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0b-00082601.pphosted.com with ESMTP id 2jw2u0074v-6 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 28 Jun 2018 09:48:06 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.26) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 28 Jun 2018 12:48:05 -0400 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=NgXyUaAYyyXPp7pAZXAadjQHufX3Th3SE5gX1R08jVA=; b=gWEPjH0e1Mkr3OJ7OQgl+vtIsWSrTBUokfA5kImAYcXuqB+baGkLtX+YphHNBYlQSbqbct5MVtP3l2jjT00UvTI2MqMHWfRrV1fV3Id8xOPFPy40LvGh4XFhficUZAAlPeG4qFwCCsoV35JPncSJn+ujQ46S9C4dLgsbue9UNrw= Received: from castle.thefacebook.com (2620:10d:c090:200::4:4716) by DM3PR15MB1081.namprd15.prod.outlook.com (2603:10b6:0:12::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.24; Thu, 28 Jun 2018 16:48:01 +0000 From: Roman Gushchin To: CC: , , , Roman Gushchin , Alexei Starovoitov , Daniel Borkmann Subject: [PATCH bpf-next 06/14] bpf/verifier: introduce BPF_PTR_TO_MAP_VALUE Date: Thu, 28 Jun 2018 09:47:11 -0700 Message-ID: <20180628164719.28215-7-guro@fb.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180628164719.28215-1-guro@fb.com> References: <20180628164719.28215-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [2620:10d:c090:200::4:4716] X-ClientProxiedBy: MW2PR16CA0046.namprd16.prod.outlook.com (2603:10b6:907:1::23) To DM3PR15MB1081.namprd15.prod.outlook.com (2603:10b6:0:12::7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bd4cce9a-5661-4c0f-89d2-08d5dd16e9e8 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652034)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600026)(711020)(2017052603328)(7153060)(7193020);SRVR:DM3PR15MB1081; X-Microsoft-Exchange-Diagnostics: 1;DM3PR15MB1081;3:aw9/UmKZS3yxH3x0NJ5MljgdBzj1Te+RVB7yG+Jy5ycbFRkDeaYBAdUKOHEFhsZLbDiY7FfEArgDKnlaY8Fow4uQwFwINOjfb3rjS+Zplssd/c5gcbJAqBsOWvvUon4XllCzOO57UgC9BhLtdyd6zLrS9A0OxO0ptdCCkaLWJc0Dz1t25Hi2YBbCM7eJabz2UGx+1EzeTajQMI57kJyjRc7IG/49UpxD4lMqzRTYbX05V2Rl3MufaTSyniVEtXSP;25:PoBdFHpR6sApz60KUwVxp3+vrWRY9IJRDBKDAzrDH05w2kzbyF8Zb4ygpNFKAo8X7lAOTYfIE0D0Crw06Z9jMUPaTLI5ngb53Uf083weqA6UfkvTN5asdKTQzFcWLwDKF62Uuh1G4VyxkYqXqlMHNWv2EYUpq7pN6qRhnmkpE6/gzH7Kf5JL6jI3FN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Iwv/NtfgDRpD6Rxp7OyiArOVnTnMOB9Tq1cfWkBks49QJ9lioZD4DRF5BzGgI/pb1WfABtL4jITNPhGm9W0XjWymAVh+0LWXZta9gDDjulpZuw0ojzLwuByHqSbYXKbUMfb2sPEmcj95Yov+k3IOH5o7rPKZ9VWii421/CjlSwWfba4DZAoJPuW0VuOIf/xl0XtpS262+fnfZK3mPeWN+O6cgr98aod 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)(3002001)(10201501046)(93006095)(93001095)(3231254)(11241501184)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:DM3PR15MB1081;BCL:0;PCL:0;RULEID:;SRVR:DM3PR15MB1081; X-Forefront-PRVS: 0717E25089 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(136003)(396003)(346002)(39860400002)(376002)(366004)(189003)(199004)(8676002)(6512007)(4326008)(81166006)(81156014)(69596002)(97736004)(52116002)(2361001)(51416003)(8936002)(76176011)(305945005)(53416004)(186003)(16526019)(6506007)(386003)(106356001)(105586002)(2906002)(25786009)(36756003)(52396003)(7736002)(68736007)(50226002)(5660300001)(6666003)(53936002)(6916009)(48376002)(50466002)(478600001)(6486002)(1076002)(47776003)(6116002)(86362001)(575784001)(14444005)(16586007)(54906003)(46003)(476003)(486006)(446003)(2351001)(11346002)(2616005)(316002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM3PR15MB1081;H:castle.thefacebook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1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D2WE7AbkLohKPxzmWoTEus4gGcBDFLV9SHM3RPCFn4HLOfIGIA4/mQ4G+GjbnnBONzB+taHqYBEHtfL/n8ZKe8PFx7H5UZoY6/g= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2018 16:48:01.8955 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bd4cce9a-5661-4c0f-89d2-08d5dd16e9e8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR15MB1081 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-28_08:,, 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 709354a0608a..aaaa6d7e0dfc 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -154,6 +154,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 de097a642c3f..cc0c7990f849 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