Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp90849imm; Tue, 31 Jul 2018 14:25:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcJwjNsjVfYWGXDmlPzMr+gbKkOHN4LyxPUlruK9fextQh44YFENV8wXai3WSD2gPv0yN2t X-Received: by 2002:a17:902:143:: with SMTP id 61-v6mr21731378plb.171.1533072320190; Tue, 31 Jul 2018 14:25:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533072320; cv=none; d=google.com; s=arc-20160816; b=vJ0ndR31xLWGcDY/Pq/lHZd95YGveLvPigNH+FAz8s3pzAPFPytzdjrIqyVXewAcRR zGoRwxIS4DBt3UrssYRP+P7AIHIn7un1LYkHPapQQwoMr8pFFBUvnejAK2YE6wz7ahJG 5M99x/Fo7cPL9pElrHpidneB64e9xL9pwi9MIW0cU4+N1AWnELx0T//3tEEiSG2qrIQr x3Bjrwpj+ZK4nqFpH4GfyUaakxoRP3paqpSWrZiOO2dKGwAKTAwOwooHmUM/44e0VbxF 98mUoqF1jmo75NTRjMZkQny11mJw/VeLYNNn6oITnViOZsvthLEgra3ttz4eGsDgR3k9 icHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=PRhUZXzg6cSK+79Oyun2pZ9MPWLHKcbKw48AyYO/6XI=; b=vlhfsn2HWeU02bGHyrnJb17r3eb1DGC/JW7QnXRrsXjG03fYeg5myrcJ1cqGNCfx01 JZPnoJv/M/TlnV7RcmgFAnBBVtGaQORzdMQ2CXVxsTnhRxjNLIWULt9aaswZczNkn/2q +hza3HPnVtdwx7xHR6PykZnblAGtTUBvh635LSR65uccwbQz3DAoTWEqq5m8cNoxtJWX y8amDxzQxovovgEdmtj3/hYzBy8gXwvijvkWLYADUEOyAQxKKikHNbJVe/anM1BtqxFQ 4BMcrvDckPLTu66YW/S22/g+g8+OYciL8SHHFm3AOlPmYNx6QVLnSB3V1sD0vz00/07X iVJQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p2-v6si5502073plo.163.2018.07.31.14.25.00; Tue, 31 Jul 2018 14:25:20 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732504AbeGaXGL (ORCPT + 99 others); Tue, 31 Jul 2018 19:06:11 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:38910 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727076AbeGaXGL (ORCPT ); Tue, 31 Jul 2018 19:06:11 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2AC108790A; Tue, 31 Jul 2018 21:23:55 +0000 (UTC) Received: from treble (ovpn-120-73.rdu2.redhat.com [10.10.120.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CA3651102E2A; Tue, 31 Jul 2018 21:23:54 +0000 (UTC) Date: Tue, 31 Jul 2018 16:23:53 -0500 From: Josh Poimboeuf To: Jeremy Cline Cc: "David S . Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] netlink: Fix spectre v1 gadget in netlink_create() Message-ID: <20180731212353.kydep424ncpoht75@treble> References: <20180731211316.12971-1-jcline@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180731211316.12971-1-jcline@redhat.com> User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 31 Jul 2018 21:23:55 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 31 Jul 2018 21:23:55 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'jpoimboe@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 31, 2018 at 09:13:16PM +0000, Jeremy Cline wrote: > 'protocol' is a user-controlled value, so sanitize it after the bounds > check to avoid using it for speculative out-of-bounds access to arrays > indexed by it. > > This addresses the following accesses detected with the help of smatch: > > * net/netlink/af_netlink.c:654 __netlink_create() warn: potential > spectre issue 'nlk_cb_mutex_keys' [w] > > * net/netlink/af_netlink.c:654 __netlink_create() warn: potential > spectre issue 'nlk_cb_mutex_key_strings' [w] > > * net/netlink/af_netlink.c:685 netlink_create() warn: potential spectre > issue 'nl_table' [w] (local cap) > > Cc: Josh Poimboeuf > Signed-off-by: Jeremy Cline Reviewed-by: Josh Poimboeuf -- Josh