Received: by 10.223.176.5 with SMTP id f5csp2665270wra; Mon, 5 Feb 2018 07:53:21 -0800 (PST) X-Google-Smtp-Source: AH8x226H4/6oVbk7rHcRFB8WvjLJYLklMV0980sffHbE8cXZoEAciqZkm+ep6l7Y8r9TDIasyQtS X-Received: by 10.98.231.17 with SMTP id s17mr2651718pfh.71.1517846001001; Mon, 05 Feb 2018 07:53:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517846000; cv=none; d=google.com; s=arc-20160816; b=nm+HOcxjcSpAN8Ugho7VVInWqGc/z2pc87R8Ogdy1j1KGpBoTBc2NWOgiCD6644VgY vv8oUrIYO+my5M35X35p5KbAqzgva89ZwG3vWxubFoDPiER7NRkaxPWFXKLB3xHpnB9U dNMhmPJwrvbgSxQHWxWCvli07HM30byrnhMo3bdx6gS/hrUi078e6qV8h/sO0pg4ZAee pwkJBXdgYjODsLkG69dQlPcm/ZPGJgEfCN0XG3IshA2E/auuSieWOkfjdVF0nxDZ6u4t LYJoVKfXB1upkouxkiTxt7GGXhY4e35j4bvai13BLZgq4/rGogmDeSNJinfM3e8r5FdF BQHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :dkim-signature:arc-authentication-results; bh=jtnBv3yg+HZZ07U7FRx7G4p5d4cfLZkSOzbbeZHQtYI=; b=e7gLAI625vrPqYyRYCnoBSUuH24Xtf4/fFut3dPSjmxQZdRNerTqGmOdDYlKJDwqKw ki1ug8/Rlry187QFRA6pHynraHk6NRdFYWdKjKHyFX/+uxyTMNDKprYW2WnVqG6Fwv38 IFpXkJ4CH48v6WIhgSW20/AT6HNVU5+e2DtlmVlMeX4TCaj7m+8NEbsVs4q3m4J7UxAZ CcnhaPiQH8p7wp5SKrZ/kDZTd/hByH1JUcq0RDMkTXLZwY6uk2+j50Pe2uzDaWVjxlfs blzH3qqWi8VrxPM8GyUXJcEHtFxwmLflAzA7u3ipSAZaFk3jOHK6fGmWUxtyHxYsqPDM Wsmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pobox.com header.s=sasl header.b=OKsNzpcc; dkim=temperror (no key for signature) header.i=@fluxnic.net header.s=2016-12.pbsmtp header.b=hzL2MFCc; 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 f34-v6si40218ple.102.2018.02.05.07.53.06; Mon, 05 Feb 2018 07:53:20 -0800 (PST) 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=pass header.i=@pobox.com header.s=sasl header.b=OKsNzpcc; dkim=temperror (no key for signature) header.i=@fluxnic.net header.s=2016-12.pbsmtp header.b=hzL2MFCc; 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 S1753339AbeBEPvR (ORCPT + 99 others); Mon, 5 Feb 2018 10:51:17 -0500 Received: from pb-smtp1.pobox.com ([64.147.108.70]:64234 "EHLO pb-smtp1.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752767AbeBEPvN (ORCPT ); Mon, 5 Feb 2018 10:51:13 -0500 Received: from pb-smtp1.pobox.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 905D7C6519; Mon, 5 Feb 2018 10:51:12 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=date:from:to :cc:subject:in-reply-to:message-id:references:mime-version :content-type; s=sasl; bh=7t+C2bYRZeui6xBdv6Myz4+v/z0=; b=OKsNzp ccuYUE6iCtW53OgpLcb7gSyRIzc1/Yg9RHcERbO+IAOk2OiDI+4/M4uiZzScFOM5 qU4AveZ4U5UhvTYbEbVPMpHctdqTGqrbJZV7oOf+xVbOKjtTjw5+qLY8jaPsBt3h 0uW66jCuU+vzXjYzUheJbEaEE1fca1EMR5Ts4= Received: from pb-smtp1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp1.pobox.com (Postfix) with ESMTP id 86F8FC6518; Mon, 5 Feb 2018 10:51:12 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=fluxnic.net; h=date:from:to:cc:subject:in-reply-to:message-id:references:mime-version:content-type; s=2016-12.pbsmtp; bh=kB+sO3oufq+7RjA5ot9tiymEGvY/TOtXlmkrYuddii8=; b=hzL2MFCc2Gi9JsYE1P3kvTufrRUkXQpL5PNKq2e5+Sr89NdmHAf8kyWsPgQHKuBjwSVgn1iZ69cr6ewI9MNE9MdYi/Xkm9u6MicsK8A8eruts1l9vkyqFzzT+dCTvloyCYMu9fLruqTg690c7NR7jWBdlmUtCcAyber/m2oc9v0= Received: from yoda.home (unknown [70.82.104.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp1.pobox.com (Postfix) with ESMTPSA id 0C95DC6517; Mon, 5 Feb 2018 10:51:12 -0500 (EST) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTPSA id 0CCDA2DA020B; Mon, 5 Feb 2018 10:51:11 -0500 (EST) Date: Mon, 5 Feb 2018 10:51:10 -0500 (EST) From: Nicolas Pitre To: Arnd Bergmann cc: Boris Ostrovsky , Juergen Gross , David Laight , Dan Carpenter , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [v2] xen: hypercall: fix out-of-bounds memcpy In-Reply-To: <20180205150340.328921-1-arnd@arndb.de> Message-ID: References: <20180205150340.328921-1-arnd@arndb.de> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Pobox-Relay-ID: 63CA88AA-0A8C-11E8-B6D3-692D1A68708C-78420484!pb-smtp1.pobox.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 5 Feb 2018, Arnd Bergmann wrote: > + if (cmd > ARRAY_SIZE(evtchnop_len)) > + return -ENOSYS; > + len = evtchnop_len[cmd]; What if cmd == ARRAY_SIZE(evtchnop_len) ? Nicolas