Received: by 2002:a05:7208:13ca:b0:7f:395a:35b6 with SMTP id r10csp33832rbe; Wed, 28 Feb 2024 09:43:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUj5Oqgy6bS/KeNjwt7trkS9aF+kDxC4sMmmjltoL5mepmu9GfetlweNXxTViRG36AYxCBjudJi4K7xIk0BoHzTx7RkcmOjKWAF042xuw== X-Google-Smtp-Source: AGHT+IEZAAjw+YnRVSSyRmVij8CfNqvLdMHwOD4I8As5MpgNo/Tojr/k84W6MknuuF6ABXyUEZ4z X-Received: by 2002:a17:906:b790:b0:a43:292c:208e with SMTP id dt16-20020a170906b79000b00a43292c208emr295449ejb.60.1709142198934; Wed, 28 Feb 2024 09:43:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709142198; cv=pass; d=google.com; s=arc-20160816; b=Ox4O38U1wa1z4Zv922OjahApKgefOJZX577ko44oAAtVWcU6fwRLfV/MoCx+lvelAH zqftkDy5yBWnAxdArOlXbILoiH4xFBKc+xEpoXk3MKsz+GqCRJBeNNAWk6tGnNN9BLg3 XbCXmaeGTmwLlIKO+3dLv5a2vqAFfTQNNf0ZA4MtRjI5uAgcdVr5HqOwSGRHMDI3raJa jqBXXiRKECU2aORWvWl5hHRCZxFXPTLipiLgDCr9UDWw+2kGSx2qzvaktFLUnwbu3Tgn bm7Eai0Q9AVNb0Ufdkl4k7U+PcwE1RW6qIyjBOy2uEMbnarTo/hbbtZAJwptH/FaJJ3Z yqpw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5XTL7Wi5fSoGtPT9aaYhGYa7xeX5imrSZZwRbhwuwVM=; fh=9UfFnYIe4I/ox+5BCu6FbSttotiuMInLxHViHTqBCpQ=; b=kXVoGqyqKfGV4Uc4LShPFK/bT+ZvQHGbmjD5Xh6a4sWSU0AaFldbXppibFCGCbLVis 4UmqnVss1fHruX1iEcVSeAbfFZKxWzD/CqN1xYndt2+B0yu9NyEzo8SnMZaX4/IEAye2 r0HvRC+f8nyaegScwtNPrNLenS3clEXv+tgm+QqPzDnSxpHM54tDMMfRt4VlOp/ffg7P U7fIAQAnJlbi6oEHPcEgz05dAUKJq3uSx+3ANTEpFs7SfrjnquPtnb+Cl4MWsFthOPV6 5tgWwRSl5/ZrWZdsboYnb3Lj/ICLnpo/hSjs31nRMEkIwrRwudybiD2Nk4LFFDb9l6TH mocw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HB3WysVT; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-85457-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85457-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id p17-20020a17090628d100b00a4428bdc65esi101653ejd.699.2024.02.28.09.43.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 09:43:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-85457-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HB3WysVT; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-85457-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-85457-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id A97091F2929B for ; Wed, 28 Feb 2024 17:43:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D99B015CD6A; Wed, 28 Feb 2024 17:43:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="HB3WysVT" Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5928115DBC3 for ; Wed, 28 Feb 2024 17:42:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709142181; cv=none; b=E85GtRIYCthmH+8fg3hgbkyBlXAy/ylp6aSl5gZLWnYbj25g8TDfTkaDywr7FsiuEN1JVt1WZY5323WbbJihW+sYFOSrQFdwHn3OrPQi6ugcXgg6IpoF5VzBXoCqLIyM0+fi2qs6jMrP8/UlmcwBHRef5aPDK+SEdzxRfOQB4Ug= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709142181; c=relaxed/simple; bh=OnTfdMWKLwh8ThOMjY8rRqP+fXnwlTEZOKp8/UdqfZs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=pybd/bTzDQikUa2dRU2a8GxrAO8s2D/gE+XL0w9njNSiCQGcLVBAnVspARViaTMqwxQhHktOYobsNK/5uKMMIWg670945vEvnHsLqM4CFkGuVlDUaPDzcnrIyyrTID80v0hOA2G4ofGoCrHNzPhKCr/Od3ceT3VHwt5lwXs2rjk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=HB3WysVT; arc=none smtp.client-ip=209.85.128.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-412b243926aso9397095e9.2 for ; Wed, 28 Feb 2024 09:42:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709142177; x=1709746977; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=5XTL7Wi5fSoGtPT9aaYhGYa7xeX5imrSZZwRbhwuwVM=; b=HB3WysVTsoXuAk6qBgsO1dAToEe0AoD0mUK32iptO8rvhe33gL0+nKv/2tryZrxNkX ot/LrAEsqqF+PFt6Rt+BbNkRR+IE0AM6S98LXm2rWu4e/uG8hMReatmoDebdsFDhpl7K knR1FD0tgH3HyGGWzFTO8eTNUaYEdtRV3npePly4vlxNhVjP9FuhzoHljDuJtMwrpCRk wLdSkeU23YwOCVcALZiu0Lltz4wkI2aSx1i/63U/Zukdm3jmKtrpAe+fgqFftAbJXgnz a4RAOs+T8tgvXMJnUrYuwVZfT+Xb58k+Mn3sVksiXbRLjk58GIlpxyuc60yuRL32dWHC F2Aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709142177; x=1709746977; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5XTL7Wi5fSoGtPT9aaYhGYa7xeX5imrSZZwRbhwuwVM=; b=h98lM0FXv1g+ze2U4VezKjTtb54PumCg63SZFYEMy88s+sEj8Ix1n/va3GMhWE0bfq /e9vEeTA95MtC48cd5YNum0jKkXM0RoO7dAcUyQr6Rm0MTuWUcsCKvMqMmLz+4NbqgR/ TVHnHkYOrEg2dTKx3UHRwtX6nLcu1nFDBqCA5QiGQJSuskLa9DsBuUYW4XoLy5pkpdV5 KJwQw3q9h1b50nW0Ukj/vN/oGQy1wILH2TrwneWgJp6whQgCvUP3oJ542PJq2eNDlbJK s+YV3UasubDW+qDPiR1uHGPJ0By8MVXxRi0z6YWZiIGAE/kZGq7nTXsdGl5O/DHHpke5 zjJQ== X-Forwarded-Encrypted: i=1; AJvYcCXD7kU6Wol/QbSrAexaqJbK+vstxeFShfL9PViVHR6tr0+fbTj2UywwQpVHZTpbjNMPEsCIhZqkanA2kbTeaJ4WNOBHI0xELVh1FSpr X-Gm-Message-State: AOJu0Yz783wqg6QzQxfcrhMBbr0Pma/nF5y2OdestwNbiBi8QyFRyKcA rCPey8CRRNoQkm8wrZEIMieHYykCvclinfMC0vrQBYamYJJoxcFaTxNuuvcSdgY= X-Received: by 2002:adf:f049:0:b0:33d:3099:e67b with SMTP id t9-20020adff049000000b0033d3099e67bmr157217wro.63.1709142176705; Wed, 28 Feb 2024 09:42:56 -0800 (PST) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id bw11-20020a0560001f8b00b0033da4b06632sm15535993wrb.6.2024.02.28.09.42.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 09:42:55 -0800 (PST) Date: Wed, 28 Feb 2024 20:42:52 +0300 From: Dan Carpenter To: "Michael S. Tsirkin" Cc: Cindy Lu , Jason Wang , Xuan Zhuo , Xie Yongji , Maxime Coquelin , Christian Brauner , Greg Kroah-Hartman , virtualization@lists.linux.dev, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH] vduse: Fix off by one in vduse_dev_mmap() Message-ID: <81e2238e-3ed8-44dc-82fe-256155c271ba@moroto.mountain> References: <20240227104743-mutt-send-email-mst@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240227104743-mutt-send-email-mst@kernel.org> On Tue, Feb 27, 2024 at 10:48:49AM -0500, Michael S. Tsirkin wrote: > On Tue, Feb 27, 2024 at 06:21:46PM +0300, Dan Carpenter wrote: > > The dev->vqs[] array has "dev->vq_num" elements. It's allocated in > > vduse_dev_init_vqs(). Thus, this > comparison needs to be >= to avoid > > reading one element beyond the end of the array. > > > > Fixes: 316ecd1346b0 ("vduse: Add file operation for mmap") > > Signed-off-by: Dan Carpenter > > > Oh wow and does this not come from userspace? If yes we > need the speculation magic macro when using the index, do we not? > Yes, it does come from userspace. To be honest, I'm not sure about speculation. The similar places in this file protect against speculation so, probably? I'll resend the patch. regards, dan carpenter