Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1409911imm; Wed, 1 Aug 2018 15:41:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdDG+eniw786y+Pm8830HgX9KFT3YJlpCb2nsVWYtaKHFW1lJUI7WJTjfoTs8WwWMBpwRNx X-Received: by 2002:a17:902:6907:: with SMTP id j7-v6mr173031plk.323.1533163315777; Wed, 01 Aug 2018 15:41:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533163315; cv=none; d=google.com; s=arc-20160816; b=OLJoxQ3kuGbnzEMzg3G5yPLPFsjzzo+UmJYqDhSEbAa1qcwyQIT/1E9wSII/C93moL x5Qo+yTd8OJXOsi/ZD8jZNg9kBIQdH923U5VXB1Uk6/3G51eG7J2unqPeg5mCtPOOLsL pZQTiU/UIAUbdUhV8jxL48TlkshCL6wFXVfry6Li+5BWscauIVWqZiTl5hIkigtVuA3Z DcZM6v+Ud1tXuv3F2T0dZ7AzbdnO1rSnALjOL1rEp4agEtB0M5xSI/J3SObYPrCUt3KE 3ZnRvH5R3tWUV2nM93UijrTRncn7vwEOb6BuR/DtySdwcW9EbhOJErBwjZG8pEWsolAL MveA== 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=F4gwZSNv6dZrjKzRJA1LjuzNbVhE93bDM4y+fmHZ2jEFT9MWwv2YfwQLh7nxkeSuT9 P4ZNUGR5LoisakayNz8ocN0ilqtulRTBuFHtJYqrLw6VgSexHS22BECVZD3z8d39DzhX V9mCRsxStrXWOfEZlUwuFDP7oj5gfDYLnBkCdTOlaCgQvaGAFcbm6Lt3vBpJg9D9sCyO y+ls/DCutFr4PR0X/Gkc5nF/7glldr5jCACKAc7QZ8Zc4I/Fnd4Mwj5OxbOPoKhO2DwN nytAAKxU/3IHerANipccbpKbRtskLRM85bXEfo9A3cm/6lbme1HAjjvp+MGr5zdFy7Il t8Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=JjD8JYsI; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=JL7h0zr0; 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 d65-v6si166518pgc.524.2018.08.01.15.41.41; Wed, 01 Aug 2018 15:41:55 -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=JjD8JYsI; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=JL7h0zr0; 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 S2387578AbeHBA0v (ORCPT + 99 others); Wed, 1 Aug 2018 20:26:51 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:47196 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732419AbeHBA0u (ORCPT ); Wed, 1 Aug 2018 20:26:50 -0400 Received: from pps.filterd (m0044008.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w71MXgZH023937; Wed, 1 Aug 2018 15:38:25 -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=JjD8JYsI/338pY7Pd22JggF1LYDryAnYheiKRCTGtk4P9KDg+RbgOsA55lVokXDWzNTC Y991daLiB+SJ0IHclwd81RWoTivxtNBMkn26xwq2LW45pDrq1PAv1KWEMaLiG3jcyoAC H1jKWVUki93vDP1KV31dFRPzXPeCQaTPi2A= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2kkkjercbh-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 01 Aug 2018 15:38:24 -0700 Received: from PRN-CHUB02.TheFacebook.com (2620:10d:c081:35::11) by PRN-CHUB10.TheFacebook.com (2620:10d:c081:35::19) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 1 Aug 2018 15:38:23 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (192.168.54.28) by o365-in.thefacebook.com (192.168.16.12) with Microsoft SMTP Server (TLS) id 14.3.361.1; Wed, 1 Aug 2018 15:38:22 -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=JL7h0zr0hPlW7w/nrNGrpT4g8VKsYuUqFtVMyIM0YZB9logzmdpI59+SQi8OlvztBjs5U3ZIFcoxYitr1nZivQVNggI6uk2euFxcd2fS8gGD0a9Cdf9Qh9VuVo6ri61GIiAthPWaDt1Kk9IauT1eACa7tQkWt1NxhloKqXakV38= Received: from castle.thefacebook.com (2620:10d:c090:200::5:7cca) by SN1PR15MB0176.namprd15.prod.outlook.com (2a01:111:e400:58cf::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.19; Wed, 1 Aug 2018 22:38:19 +0000 From: Roman Gushchin To: CC: , , Roman Gushchin , Alexei Starovoitov , Daniel Borkmann Subject: [PATCH v6 bpf-next 06/14] bpf/verifier: introduce BPF_PTR_TO_MAP_VALUE Date: Wed, 1 Aug 2018 15:37:32 -0700 Message-ID: <20180801223740.11252-7-guro@fb.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180801223740.11252-1-guro@fb.com> References: <20180801223740.11252-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [2620:10d:c090:200::5:7cca] X-ClientProxiedBy: MWHPR1601CA0016.namprd16.prod.outlook.com (2603:10b6:300:da::26) To SN1PR15MB0176.namprd15.prod.outlook.com (2a01:111:e400:58cf::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 008168dc-882c-4671-282e-08d5f7ff7ba8 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:SN1PR15MB0176; X-Microsoft-Exchange-Diagnostics: 1;SN1PR15MB0176;3:hvd2ZEk0OAOuEHfPRM5DENM9zJeMHUvvlc3DINiWtDB1ygnf8YpC4SBMNg/lfmh6wgM6htwrG6W38fws+u9FFgFLFNRwfnHmYKadpYtOdbGP5EC4H8fb92OdLoxfaDrWfxoJLp5m3I3+f/lHkDAlDIA4UZLEBXIiq0rRutjDQd/L2W1+UfZ6+bFa+12iOqb+pixVf+xdXtnqiEWW6lWWA+A7QMCPU+h6iMtUVgz3f0rBJ75rsGj9ffSegrRWw+jV;25:UnHE2TbHcSKWS12f1ARw+fWf/Takxs2shWQApFHYeSuqfWv+ueHiZCUSBy2908jTJLQgGam4n+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d5+TqDEoI;4:zmauyTW2jMFRHtz+5nzV3KGyKeFhND9xRhfj+eECXHVXAFYdcvc/nLyYPjb82s27BJKAkSZOGC5WiDWGZCYYXKW/DLeOnU2nPblLQYfgrQhzDnw4tBk6+DdtVR3pklwaCFPfvrKTaZU9tDcPIZDRWhCsRvsXO5XZv5eNuVjeQfo6aKdjtkMecutcbmeBxieskl1XWe12RSWZIRP9eNjJxWnHu/Zo/EnJDjd5zGbrAeot2jx1Ka8QNY/srPO99Pchcr7AS4bsklNRg9vAxbI5I24BMDdviIcrjuqaMdaq0fT0oRMf1KczANm2x7pVQOVM 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)(5005006)(8121501046)(10201501046)(3231311)(11241501184)(944501410)(52105095)(3002001)(93006095)(93001095)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:SN1PR15MB0176;BCL:0;PCL:0;RULEID:;SRVR:SN1PR15MB0176; X-Forefront-PRVS: 0751474A44 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(366004)(376002)(39860400002)(346002)(396003)(136003)(199004)(189003)(11346002)(6486002)(6512007)(50226002)(6916009)(2361001)(5660300001)(53416004)(68736007)(6666003)(386003)(106356001)(6506007)(76176011)(105586002)(52116002)(51416003)(86362001)(36756003)(486006)(2616005)(8936002)(81166006)(16586007)(54906003)(478600001)(50466002)(316002)(81156014)(6116002)(2351001)(69596002)(7736002)(1076002)(52396003)(14444005)(16526019)(46003)(8676002)(4326008)(476003)(97736004)(47776003)(305945005)(446003)(186003)(2906002)(48376002)(25786009)(53936002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR15MB0176;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?Q?1;SN1PR15MB0176;23:WHcVYQfaa+qzY4iH7R8c/gKNGcBd8QAlyi35pa250?= =?us-ascii?Q?h7sC0W1rBssenq+cMpCG4p3CbA56UljlAUSKuniqnBBoAEn2SpgXlL7UEE/n?= =?us-ascii?Q?C2+YDemOLx+PYcAd6JwWvmKn34aKLHNm5dWN7mk3SEmQhuR4PkDSPfzwGHA8?= =?us-ascii?Q?+AIsT6hwStQV65WWDeVfEtVnOBbhKFDpW5QImSkyazgDLNxE5cMa7n/6jWHE?= =?us-ascii?Q?LlcpJnzWPoTmzzuuAUkSFSnwS+UARAep3IynqMdBa2sN14ZBNmwftChXoDsE?= =?us-ascii?Q?dBMdw3GG7YreKtwovDbhfnrBRBo3gi3lYJ/KZcAhfKw/bpIIgurAfV8Cu0my?= =?us-ascii?Q?lTVU9KMWLQ8oJ54vefI7zw7Eh8ZGJDgY3YGxZCsoZRAK6Rn1wiTrWkdIgX3g?= =?us-ascii?Q?Bfh/sWgwK9U7zUz5/aYGBU+JOrhFjwef/ZNh+oE3ikrax5oC5+JWkOOneTsh?= =?us-ascii?Q?JZD4eA3tPJabF6XlouxGiOdw7VO9Rt/5lcyIc1lKQsFkWqFPMJY12YYK9RCj?= =?us-ascii?Q?QABGtyD1SylTVpkJa8GtjHEtkQ4S7sjcCGDO4heu0OAWDa67PYLNmJkr2W17?= =?us-ascii?Q?SEfUqFmavdYhIoDkZkcZqCkDjzx+k3tPOb5Hy95/LM8tz1+Q89/JvzjYJhJj?= =?us-ascii?Q?desOZgEfE7/CR/LLKe4G8t3AIsPbP+KWUDdvYX5heQrTpjSb5NLJut2s/AmS?= =?us-ascii?Q?E6Y/q6+ndSG7eW2nVnXIniU6K7GmAtc+3jk9Up1bf18Cl4ls30ummX03wV/c?= =?us-ascii?Q?6369NyYqUBoSyf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fRD4NMFpnc8Pe5Fm5LNn/y0j0tLJlaXjEmLwd3JHiTJ07oGnKfFFY6vc3T/KVWzPKHBasDjBmjM8KOBok= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2018 22:38:19.8725 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 008168dc-882c-4671-282e-08d5f7ff7ba8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR15MB0176 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-01_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 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