Received: by 10.192.165.148 with SMTP id m20csp167607imm; Thu, 3 May 2018 17:17:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoDY19uJlRAPKf1Ke22l7KNCeKHQP1kbTPtfPELM5N0NFVlHhS+DySFB9jp+4GOP7dyWzeH X-Received: by 2002:a63:a80d:: with SMTP id o13-v6mr20415146pgf.198.1525393038209; Thu, 03 May 2018 17:17:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525393038; cv=none; d=google.com; s=arc-20160816; b=F8lxY2pnaViqx93WCiriOmRHL+kA3nWOiTv15/XWzjXO0qawZtGqUmh5QkzLLbS1kU mnAAlg9WBHQ0QRm7uIPJRT/JiGr9SMyuA6OnMDnfZ2WdjhoPpWoJ5zKVnjHAbvu00/5A jBeYv8MTJlIwnBpAcVu+zvOIQU7osVncyzTS8HXBZYSecg75Vp4LyA6Q4bBtWcID9TKj M1HHYJdDiht7SR3ZZF+CanNllNSyHI1ObWidEZcLrdvrrRZI5WxWUvQ3aUu65QpRvY6c G8D6EzecH6DAl0zb0k4IwOzw/0GZ+cFeJ1B9NrgKM9OrePudWjMzXfnMmJYT9Xt6wzUG 0S6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=IM72KPGIVRtV/JUUcldo5/M4P1HnHrenB1WtZO/Slx8=; b=co2PY3z3vHKxISgeCwOqoJRpbtzYpCWK7/6BQBT8M68Xy1HKARSYLBjwAMwYosg9xC eRgbdsM/4c6S9+Cf86SZIhYk8lCdoD3/F8qmZVKddhZ0Z2TQeAdxht1z1G4XEXTAFk8w PgqFsFbUl/Qda6pNjvCD99fvoyO+rbwZpiqyh7onriXXZ9FZbVzgLNcTQvQkXqrIV2dT jv7nkAhqF2DYvVVhTsz3jnIVL0Igpz8EO793yM4iMiCYWUF22j2JWOY+HdXOWTZu8njB iRNksMJ7Z+Ptp7hrPKcLKNHkSMhQcoM2nVHaR4tL4nJkXuzKGoR6F+NQ0yrh2ILoL/fr ZLgQ== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 65-v6si14709686plb.301.2018.05.03.17.17.03; Thu, 03 May 2018 17:17: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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751613AbeEDAQj (ORCPT + 99 others); Thu, 3 May 2018 20:16:39 -0400 Received: from www62.your-server.de ([213.133.104.62]:58247 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751445AbeEDAQe (ORCPT ); Thu, 3 May 2018 20:16:34 -0400 Received: from [62.202.221.10] (helo=linux.home) by www62.your-server.de with esmtpsa (TLSv1.2:DHE-RSA-AES256-SHA:256) (Exim 4.85_2) (envelope-from ) id 1fEOOm-0006Rw-8R; Fri, 04 May 2018 02:16:32 +0200 Subject: Re: [PATCH] bpf: fix possible spectre-v1 in find_and_alloc_map() To: Mark Rutland , linux-kernel@vger.kernel.org Cc: Alexei Starovoitov , Dan Carpenter , Peter Zijlstra , netdev@vger.kernel.org References: <20180503160459.4111-1-mark.rutland@arm.com> From: Daniel Borkmann Message-ID: <28363c0d-0b78-681c-d9ea-908671b0067e@iogearbox.net> Date: Fri, 4 May 2018 02:16:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20180503160459.4111-1-mark.rutland@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.99.3/24537/Thu May 3 22:35:07 2018) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/03/2018 06:04 PM, Mark Rutland wrote: > It's possible for userspace to control attr->map_type. Sanitize it when > using it as an array index to prevent an out-of-bounds value being used > under speculation. > > Found by smatch. > > Signed-off-by: Mark Rutland > Cc: Alexei Starovoitov > Cc: Dan Carpenter > Cc: Daniel Borkmann > Cc: Peter Zijlstra > Cc: netdev@vger.kernel.org Applied to bpf tree, thanks Mark! I've also just submitted one for BPF progs (http://patchwork.ozlabs.org/patch/908385/) which is same situation.