Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3139356imm; Fri, 20 Jul 2018 10:48:40 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcN1f2HIc4Z4qBnKDwurek1/y+P0wwQ0V4IlrGCXkbwTY4SxJmxihRulN4bCETVirKOsITh X-Received: by 2002:a65:41c6:: with SMTP id b6-v6mr2928120pgq.174.1532108920033; Fri, 20 Jul 2018 10:48:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532108920; cv=none; d=google.com; s=arc-20160816; b=b2aHdorGXBL/NapGls9kA5A7p1KsBzz5zwpQ87ftYnwaHRkGJxAOXs1eERZdqhYtu3 TP8uHEUy+y/mZQ56T8x3Wsz4djONH8puDLmocUJAEmtuzB/+iBM8lx3+XsCXKIR1s0ZW FcdfCL3jiZC2kzCiqhO3yYDnUTdftCmos2LJ/AI1MFD7T2NEjcUBN83dvWBFd/K+EiDu NHSt8Xh/mJa6xR0KN5bkHf9LdnjGqQmirOT0ZKPvKzOLkOX7aPpgchjpRf9vEgobHNvB WeP9nSvcM5svl35YmlJTAZlJrfnLIzFVzydUBI/M7eGWpaVqgAdihHfLIbWPJGUalxKX F66A== 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=DX7rdIOZ5zSldQg76TLlywvYRw69nJiAZA6/AZroUuQ=; b=YhFVVL6xn+BftnvCc2jYbJNSDF9inr/lszYNZhSuvTlWUjJk3qTDIgOb0liDSLBaYV fR5UVhPwAY/z0X56w2Nfnnkg/gNWJRw+15xm23OgvaeppsilDrYcAcUc6NbMarV5gykk rXhnvuk2vOhA5Pfj0r7WExclSOHZCVwDbO2QPcDEyeLr/AopWQHbrpEwDk802aJTfPb4 paGbBicdqfHFsIC7q+JKJHpQp3aXdpx+rbRbFjSD3/cpQXVCzrtOvobS7E8ojhhRCoPS +r8PbBjZxT2fOtg3pej0ePcrm1y8SkZCFkkUmShVRLtRAE2GbS9VQU4Mg2T0XNXVF773 xNdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=O70eYm7W; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=aKl00G2a; 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 b1-v6si2183709pld.323.2018.07.20.10.48.25; Fri, 20 Jul 2018 10:48:40 -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=O70eYm7W; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=aKl00G2a; 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 S2388424AbeGTSgH (ORCPT + 99 others); Fri, 20 Jul 2018 14:36:07 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:38276 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387881AbeGTSgF (ORCPT ); Fri, 20 Jul 2018 14:36:05 -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 w6KHhh0r025812; Fri, 20 Jul 2018 10:46:26 -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=DX7rdIOZ5zSldQg76TLlywvYRw69nJiAZA6/AZroUuQ=; b=O70eYm7Wje/CJWtlMdAYw+QzeCzIzJTymwlop3xzEn1AnCbdBIeKfwpH2zc0sC4Xt1ZN rPOFVui1Yo2K09SUPhPuilQ2G6NR07eaxGLn5LyxsoYEUV0GaMcoRAj33HtkUf2uKH8B A0Nb75ZN8umBQ8Ik2unuRPdXkGiY9tc4Kag= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2kbmbv80dv-3 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 20 Jul 2018 10:46:26 -0700 Received: from NAM03-BY2-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.31) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 20 Jul 2018 13:46:24 -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=DX7rdIOZ5zSldQg76TLlywvYRw69nJiAZA6/AZroUuQ=; b=aKl00G2ayHxzcC6FemNlJ8Kt3KJJgepPZDkGT4viQlPXI25XdTPRmRBfjlvispkO4qCttwxUVQ867GsYpakuZFePJ/9ADvEDZsLRXpuGDXK7mblsjqqLJ0ztIuNa5KGfWz+6H8OmsYX4GeVZ+LcqryANw0ESKCp58AUG8H2hNE4= Received: from castle.thefacebook.com (2620:10d:c090:200::6:ca05) by SN1PR15MB0175.namprd15.prod.outlook.com (2a01:111:e400:58cf::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Fri, 20 Jul 2018 17:46:19 +0000 From: Roman Gushchin To: CC: , , Roman Gushchin , Alexei Starovoitov , Daniel Borkmann Subject: [PATCH v3 bpf-next 06/14] bpf/verifier: introduce BPF_PTR_TO_MAP_VALUE Date: Fri, 20 Jul 2018 10:45:50 -0700 Message-ID: <20180720174558.5829-7-guro@fb.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180720174558.5829-1-guro@fb.com> References: <20180720174558.5829-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [2620:10d:c090:200::6:ca05] X-ClientProxiedBy: MWHPR17CA0096.namprd17.prod.outlook.com (2603:10b6:300:c2::34) To SN1PR15MB0175.namprd15.prod.outlook.com (2a01:111:e400:58cf::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d7970b75-d6e4-48cc-6090-08d5ee68b3f9 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600067)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:SN1PR15MB0175; X-Microsoft-Exchange-Diagnostics: 1;SN1PR15MB0175;3:NXhEo+V3zlodAfD3flS5jhfWh5zKmU+WwcxHAK/HaBRL4eOsm3+eS5GEiR35+jhcwWtJ4roKkwicnduQ9nFeq//hcnpr/2nZPx0ZuhSya70Bu7qAVMUIyClBG4zmN6f9PpLsYttUrnE1VG3Vp3R017o45Sx+bz5CZtgZ5cvoLpa3B4gdqA71HhuENoyXAFYuV46HtIa4naCUe8XWMMZffAI2H+P8tnq3fhiUuEmwCe1hFFKJ0bY/gTRsiUqRO6Hp;25:qZh9ftg1dDatF+Ght2ebrPncxpNwC7qJPsvqyIXqS5ZHO5b2RzLUr4lLP/2wH7Q78cBVarkkHkl41FNbc2bLxA0jcp2C4za1q/aRwRDiskYOFvYr4QeSqT2Lo5lZQWJpBZs2X6+7IZIj4bLPjVNwGa9opKr8Vkf3+cHqf58HM1YKOYhWvq3h4u2LHNATXIB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5eOmX6H85IX+iyRCcUUsPuDlAUT+fZAZuA0yn9pI8nHkWtdkrZAavcaxR6oXIrr1xXL7gdyrJ3Lx8I8Y4owUSalkp8fXw57aDRs1ckWd6+W4ZQ9S6kVaL0b3W3dUmmxGu0a374JmvbugU9fDRUYwJsNLGwNygffcpmHPQqSkp8iklWEFU8QNh3D4Dlt+WSHKBKfV+8QYn3sLYtNArgL38TQ3/ 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)(93006095)(93001095)(3231311)(11241501184)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:SN1PR15MB0175;BCL:0;PCL:0;RULEID:;SRVR:SN1PR15MB0175; X-Forefront-PRVS: 073966E86B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(346002)(39860400002)(366004)(136003)(376002)(396003)(189003)(199004)(2906002)(6666003)(50466002)(81166006)(53416004)(8676002)(48376002)(2351001)(68736007)(81156014)(106356001)(8936002)(25786009)(105586002)(1076002)(5660300001)(6512007)(6486002)(36756003)(478600001)(86362001)(69596002)(7736002)(6116002)(305945005)(97736004)(2361001)(16586007)(316002)(52116002)(51416003)(52396003)(446003)(50226002)(46003)(54906003)(14444005)(47776003)(2616005)(476003)(486006)(6916009)(11346002)(386003)(76176011)(16526019)(53936002)(6506007)(186003)(4326008)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR15MB0175;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;SN1PR15MB0175;23:+cJFglssASWnT9M3DMLcQ52MtUneFztlFYQKpjZba?= =?us-ascii?Q?BOZkj/8e0r1dprFqgsmyEYy5CG6SLF7Ay2LROcwzL+FeqbipMXFFOzc+fBSC?= =?us-ascii?Q?z6mzxck0W8loTPv1dW/76PyQamctNjfDqyg9NaeEFNa8BlapDjtA1fa6oZFD?= =?us-ascii?Q?hTNBoSunUSnvGy8Ys4eK7hnlq84O7BwodnW25OM0HfZNtZ9ohUqqJYEvJVWa?= =?us-ascii?Q?4RVhD/Ea2/q69Ye6DARdb8jr6LNsQp6PKitQhrWdy64dSdN4kmUiyV1xxW9g?= =?us-ascii?Q?l+yNm2AdJzl55ZKQ/QXerR74m4E25WApWQ/7xxeT3q4ZIgK+bJW0wfIF36Pd?= =?us-ascii?Q?IPq6QYpFg6DRu06WTR0BplMBGztETGAbzxCgqbTVrqYgTait7+uifctOmIaM?= =?us-ascii?Q?wpV5CtoPcc4Ei13bDuBa3f5rF5egxmKbG/JP7PyDK0CZG4Axmq1QRjVFTuja?= =?us-ascii?Q?g9y8bfC8KcPZCSX5uwj56b0PnqlRqBSTsZTy9Xuv3w2LkfsKjPRvBngw387B?= =?us-ascii?Q?Nms4UxrdMvz+QHvbbEA3I2A3KHHOq+2x8MhknLhICGWMEe8cO16hBgYMwFlv?= =?us-ascii?Q?KU8ZJu/vy4YTr2Z913B3yL1cdGNwW5OrqOeoTFPG84JS5sYw7pJBMQ3kQv5n?= =?us-ascii?Q?/N5pompI+ASZZrD8zibVOVIlunTbtabjCMCjTdpuRrlwKl2WGgvCueRmDDue?= =?us-ascii?Q?agTbgGtpgK2G2vOmK752lzRNSTAy0R6MrWqmC8xygYeEA6jonZKpRUJUnwbS?= =?us-ascii?Q?qqiJjMjj7ClKkuPiNL49lHB8tWhaHIka+yymyi0PiAZ4du9Ncy7rj3yVSatp?= =?us-ascii?Q?P22Fs3y5azpciII9mFISB7ND6Pr6y0mexBLZcORhkJaWpnsYBL+dNuWLfItB?= =?us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IwnwD/TBTpRAMFQ8Mzowx4rxAtk1iWsmkstME5g4hUt9BQDY+0rLyLERNG9NT+qpJAvSzfVCfYM9x/P9/RXiccepM4eB9eGWPkEOoqDwpocoLI2Ss6rNtRMz8su+vGBHT8cBwhMACPE0nq4ijkRj74VaNpIJ4PESyzg8/11nXHdIu3PWZ70NL7lHTapaEciRqVw7S0ZNtjmye772ifuvVzEORgqKQHvM9rzfxEEMtYOps0McyrA5OzM+Mqv0taULtmBvoNalO+04OlAI26R6ZD9tAEZkwbrEIlnWtAITKLLQcQSFq7HW1rgGi3+PvLyy6QAJksRqvPPTz/l0rHpmIoXx8Z2VEHKXZ3eicA==;5:GCoPr0S8uQD99Ye4Rqnmynqrss9neyUHZCr5rWmOdNv7bGC5CI5f+GURW6uTDQAaSGaITca+7/WxIv+osSEghqaLIftVDMfepS3r377j4xFwwtHPKB2rK7fjQmZiqLTYnAHvOEfcJwMkiWsKMSIyBltg/jb5Jd7cUFTOakfaxGY=;7:AlIg5JTWM+5wN8Z40ZRZPTOV4A1sP5Bqg0xDewcwDot+QQEgUOECBOukXvfiw046ptd7CBM7rytqyoFMiymF+nAEwFkDVyg6ILV1fJFIXBF8MOITrXbvdL37Z09+OBtSNu01cGVyytCbVxYZ74nPc17BUm8MHkfYzhoCEOzI4WQUYReHsdG/N1KV6BhjeUXGE5RU6KEOjLQkURhjzAyQX6Bw3dDoVxqjeJY8qO9TTLQuoiGtt3Dryeo+0j++9LxN SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;SN1PR15MB0175;20:cF3hnpyvk0C+dAS3tG87CQ58mqUOeRRLHOUX2UpNQ2DvkJZyar0r5gVqJZqiXn7jHeZ0yWENYP5OvylGqzeXuAt1rwR/NgXRvF0Fe91KPJYbeluDLs/8JV0iLLe1VzpjBsy6Xog2v3AdeBDQnnUql4ixeESGR3quA9sYTsWOMFg= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jul 2018 17:46:19.9221 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d7970b75-d6e4-48cc-6090-08d5ee68b3f9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR15MB0175 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-20_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 0b089ba4595d..8098e39f825e 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