Received: by 10.192.165.148 with SMTP id m20csp2066079imm; Thu, 3 May 2018 09:49:24 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp/z96VEXggoyJViV+2YRP8XLJ6XIINRfyxqAwGxK4XZhkdbmyOvb//MmOwo4TDHPLse5dE X-Received: by 10.98.62.194 with SMTP id y63mr23895879pfj.102.1525366164738; Thu, 03 May 2018 09:49:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525366164; cv=none; d=google.com; s=arc-20160816; b=QseF9iv3RyZPfRACl4iJl8JOk32fBhKEOQV2YqPDEWJOSFKe5UBHxR5IFA2e5H0iKJ hIf4nuu47PvnatQNUxNnKv9qve0+LwS5NNqdJO1EiLkD8Zooq7Md8U9gTuBtxQUnBP1H ANNpQVas3abjY++L/gp3stpt8P5lkE3TdGA3kANgN/tlLQ6+SWf4Py16sCSP65GAxG/K +z4XXA307j7xLiNIGLVDS017d9ehtFnuCrn7mG3or0YqIX42YJE5o7e5oIkXMBwPsDfZ oa1oC7EQ+llVKphzkg5C8CAvbsc68IdeuyqLjz0c1Dj2DH+8YLYyLB4atOvNq+7ndkfR WIEg== 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:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date :arc-authentication-results; bh=9atQ/+dheraFRklrjCMJFwQQzABStWc/lq+is2yPM38=; b=VRpN09uR/nD0iYHmBbzHC0vFzokRFA22feU4ef4B8dcVCrZwA4xv7uZWQhBqf0LE+W mUDH2TeP/KSgqrAuAIpGj9XViXvwzX2aUZTxC8SGQlrtay/QHUPaUgQjtDp/jE/JTvnP sqwRCLzT2lyDVDkVqT/UGFqCbz88w8NWMlpL/PS6jMgbWrUDJn2YqnlbEdol3y18h3te RqcaqacBifBtbDw2ny3GCAEdSpglYGkY3+EyW+BMVJQy3wWKUCD1P0/McmeJ4G3XiGLO k9tnqfGrM5Py5FqojUkd2Lw54mLD/N2ZH46Ut7it/nIKbJmWV5per0Oc5Rj6VhZMnXh1 wwwg== 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 89-v6si14139019plc.444.2018.05.03.09.49.10; Thu, 03 May 2018 09:49:24 -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 S1751359AbeECQsz (ORCPT + 99 others); Thu, 3 May 2018 12:48:55 -0400 Received: from shards.monkeyblade.net ([184.105.139.130]:49276 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751115AbeECQsw (ORCPT ); Thu, 3 May 2018 12:48:52 -0400 Received: from localhost (67.110.78.66.ptr.us.xo.net [67.110.78.66]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id E112613416BA8; Thu, 3 May 2018 09:48:50 -0700 (PDT) Date: Thu, 03 May 2018 12:48:47 -0400 (EDT) Message-Id: <20180503.124847.1815876480542537219.davem@davemloft.net> To: mark.rutland@arm.com Cc: linux-kernel@vger.kernel.org, ast@kernel.org, dan.carpenter@oracle.com, daniel@iogearbox.net, peterz@infradead.org, netdev@vger.kernel.org Subject: Re: [PATCH] bpf: fix possible spectre-v1 in find_and_alloc_map() From: David Miller In-Reply-To: <20180503160459.4111-1-mark.rutland@arm.com> References: <20180503160459.4111-1-mark.rutland@arm.com> X-Mailer: Mew version 6.7 on Emacs 25.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 03 May 2018 09:48:51 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mark Rutland Date: Thu, 3 May 2018 17:04:59 +0100 > 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 Acked-by: David S. Miller