Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp5500780imm; Tue, 16 Oct 2018 11:10:58 -0700 (PDT) X-Google-Smtp-Source: ACcGV62Gs8rZSSqxpqo+cfK/3HZFKqGN8Uh64ncK/X7ss6dkKttu9FSSy0UHTR9ag028ITIRqmZC X-Received: by 2002:a17:902:bb96:: with SMTP id m22-v6mr22418649pls.117.1539713458395; Tue, 16 Oct 2018 11:10:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539713458; cv=none; d=google.com; s=arc-20160816; b=kOQPfjmT7uXGPnFGBzIGjVe3RvlBkI+xZN+XQBj9NhqDJLz2XNkrHbDnge35AgslWQ 7D3Yzq8SgQd5cgkrWPqwj+Pl40DH2uctk4PUP2Na4RLhYrgMgKhF9KXy2/lD7dY3nFHF 4KRbKD1axHGp4vvwMPl2hoI3nuz0BMob/d/bOBHqi4xhJvjwAisQ0j2k/yrw9kX5Gg0M Hn6nr6ux+/QUNnxNBnp5EH7GoD4npPHxWqMnovCBeVwL9A0k6HoQyI4Mid+2mpSyuhk1 FWZQwYM0HZWmbO9NHBozmKD3aFd5Z+3rm/Ah3U2Kz/7FzAP6DIku4GMWyNgkwJ1hgVC1 aPnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:from:cc:to:subject :content-transfer-encoding:mime-version:references:in-reply-to :user-agent:date:dkim-signature; bh=3w6CyTv8A3LV2uwlWQcQZ/oGfCNBUgmBmFsDZ0MJOm4=; b=Zco4O8gKVGzAgz5B/gEu2+405lkCXLFG2FLKh8YGx+HkUmH+q3ZW4dSU8GY3M+1zPO QWeE60CD9enPGzqQYrEQ3KXxv+HOk2aea2I5CI6qJ+jCB/SN4ZAlSW1Wq5/aBlCK4zCH jkbaHxYEvPPtWxQgeIGApGMv+r/HhBc5cP9inC/XB2ybC3VaVrfUWwG/yEmlEFotZoh1 NFnzC7fiSx1XZIeas1Z+qZ0NBBN/E1wSYosIb4xMbpU0e+ZvHTbraBJX5U3pt0JmRNfM o8lFGve4wC6IbGANBkJ/YjIzGDTIxhZJe8mDjSN3guxJPb72zkRen+SbuL31F6HYlHq0 /NdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=oXkBZrU3; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y136-v6si16929566pfg.52.2018.10.16.11.10.42; Tue, 16 Oct 2018 11:10:58 -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=fail header.i=@gmail.com header.s=20161025 header.b=oXkBZrU3; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727186AbeJQCBm (ORCPT + 99 others); Tue, 16 Oct 2018 22:01:42 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:33383 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727006AbeJQCBm (ORCPT ); Tue, 16 Oct 2018 22:01:42 -0400 Received: by mail-pf1-f195.google.com with SMTP id 78-v6so9470176pfq.0; Tue, 16 Oct 2018 11:10:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:user-agent:in-reply-to:references:mime-version :content-transfer-encoding:subject:to:cc:from:message-id; bh=3w6CyTv8A3LV2uwlWQcQZ/oGfCNBUgmBmFsDZ0MJOm4=; b=oXkBZrU3zv++Atg6T1jsM/MOUIjRvViZYieFEu/hmwUTxWGwN1ucdt9uYKRtkY8MrF +w21khC9jErGiwOPQlpgdw0rZniS24kYnoW9sUoPWPBnkWDs9V8AynTy1MFj0SJvt+Cd cLoRlSYZSKy+LltMQwsq8K8LTzu9eBa1cLyM0cEP7TbtACo/OfSEyb20SSMiNrXG5Dlq IJCvPUpo8S2CzCaAjuaGU/0htz3VfCwkwlJIB7C87tI1ZJ71OywiyiRi+zoGji7flT4l 3YGdIVDcBC9H3kuyU7GYs0CJIPI5bmjzlMqLINP39CPfwAAEAIyrY8XxzFMMx/e65Au6 8ycw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:subject:to:cc:from :message-id; bh=3w6CyTv8A3LV2uwlWQcQZ/oGfCNBUgmBmFsDZ0MJOm4=; b=NvHJER5ZAFKfQ86SndGmYZ3iQaO13iwZQrYegrP78HJkmeWfh/sEd1jeV9QUrHHpS+ MPvj2+g6IVqiEcLVXMhtFk2Sdqn1pdob31zixIFmzBbV+EPACIEMPqKvYyfjWV4VJhCp nVNQRF9L8E+SE3fWEare9LIgPxhV5jaGD0ku/isXwDYA7o0YnGxocJh9Wpl9/H4ZlMrY edZsfubPM5d9sbyA9YgWQgu91Ib/vwjPUHvELfNCrQapP1pNHWY6T0UNgG62Txa3GGFI XIOa/a2GK6s/5soXLxGtohum4isB5SdEOM5+zvse1tA5ydCAILNjHbBuMDziwOz195Ct D7aQ== X-Gm-Message-State: ABuFfoiXWZxVuAamZ1cbvHBO5pirOAQQu9MMDOrVm54FVDQIGYPWiTZG ZHZ5oJ6EqpwXbLnHWvrt9Vs= X-Received: by 2002:a63:cc:: with SMTP id 195-v6mr20838138pga.44.1539713403160; Tue, 16 Oct 2018 11:10:03 -0700 (PDT) Received: from ?IPv6:2607:fb90:284c:957e:e0c3:4055:73a1:30a2? ([2607:fb90:284c:957e:e0c3:4055:73a1:30a2]) by smtp.gmail.com with ESMTPSA id v38-v6sm23762112pgn.57.2018.10.16.11.10.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Oct 2018 11:10:02 -0700 (PDT) Date: Tue, 16 Oct 2018 11:09:56 -0700 User-Agent: K-9 Mail for Android In-Reply-To: References: <20181016111313.GA28307@embeddedor.com> <20181016172107.GA230131@dtor-ws> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PATCH] Input: uinput - fix Spectre v1 vulnerability To: "Gustavo A. R. Silva" CC: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org From: Dmitry Torokhov Message-ID: <26EEA6BC-43B0-42F7-A237-572D32EB2309@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On October 16, 2018 10:52:58 AM PDT, "Gustavo A=2E R=2E Silva" wrote: >Hi Dmitry, > >On 10/16/18 7:21 PM, Dmitry Torokhov wrote: >> Hi Gustavo, >>=20 >> On Tue, Oct 16, 2018 at 01:13:13PM +0200, Gustavo A=2E R=2E Silva wrote= : >>> setup=2Ecode can be indirectly controlled by user-space, hence leading >to >>> a potential exploitation of the Spectre variant 1 vulnerability=2E >>> >>> This issue was detected with the help of Smatch: >>> >>> drivers/input/misc/uinput=2Ec:512 uinput_abs_setup() warn: potential >>> spectre issue 'dev->absinfo' [w] (local cap) >>> >>> Fix this by sanitizing setup=2Ecode before using it to index >dev->absinfo=2E >>=20 >> So we are saying that attacker, by repeatedly calling ioctl(=2E=2E=2E, >> UI_ABS_SETUP, =2E=2E=2E) will be able to poison branch predictor and >discover >> another program or kernel secrets? But uinput is a privileged >interface >> open to root only, as it allows injecting arbitrary keystrokes into >the >> kernel=2E And since only root can use uinput, meh? >>=20 > >Oh I see=2E=2E=2E in that case this is a false positive=2E > >Although, I wonder if all these operations are only accessible to root: > >static const struct file_operations uinput_fops =3D { > =2Eowner =3D THIS_MODULE, > =2Eopen =3D uinput_open, > =2Erelease =3D uinput_release, > =2Eread =3D uinput_read, > =2Ewrite =3D uinput_write, > =2Epoll =3D uinput_poll, > =2Eunlocked_ioctl =3D uinput_ioctl, >#ifdef CONFIG_COMPAT > =2Ecompat_ioctl =3D uinput_compat_ioctl, >#endif > =2Ellseek =3D no_llseek, >}; /dev/uinput must be 0600, or accessible to equally privileged user, or you= 'll be opening your system to much mischief=2E Thanks=2E --=20 Dmitry