Received: by 10.223.176.5 with SMTP id f5csp941938wra; Fri, 2 Feb 2018 08:35:36 -0800 (PST) X-Google-Smtp-Source: AH8x227uRzdi0Jz2noK4OSBU/qrfuN6QSG1e3eTTQhntsj+i3b4+aVaJKkYW6LTXBuzTZGQ8OQV7 X-Received: by 2002:a17:902:2c01:: with SMTP id m1-v6mr34603082plb.15.1517589336120; Fri, 02 Feb 2018 08:35:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517589336; cv=none; d=google.com; s=arc-20160816; b=xVeRNQFFQkXKAXvE1JCG3RxNqLdqsfqistZMGjMk+5m5p6Tx6Qbx5R/h8dUfv/R+2n o9fHMSVre59k6RblJ8uzU3Q688ciq0SjPPD7Avs456IQ3VZyKIdNvAJXJgBYUsQdp5LS bEjFmiCAPwtq8/p9n1EhFXIQxejcwAQPM5qiq0h7p41kV8vg4C66D6OEwAIDWTZQKjwA 1gVgF9P1lZRwIjDPc0sKpbB44Ae7kfy5OAAHLv66KzddnLd3o60T+7uV67pRpdAL5YwQ GFFt/suu/Q1pK0JBqQHXRmv4NQ+nbuLguJKT2g0NiunKztZrGcXc52sjjpCZcjqEC5Vf 5Kcw== 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:dkim-signature:arc-authentication-results; bh=FjPxhGbQKrGHngSs86Wey8XOr61LW2mu/i3LFG1GCKA=; b=dH3y7DazjLA5mcaqa7L6AG8jdc8/onYlHpjI5vuswe0oJVd+Y4RIc99Qs+e5z9l8za pURdj/fMeUjW04OaTDk5gRBGP5LzsM4EyC+tFzKQgfXt+ZseKOUh+cCsvJV1LXvsOYqw dpFGRbtDWMC9dVraCEoN2w6XxjQ6dfnR2Y4/DErI0iixgpG7INM4lhPOM36Qei8thxpH xda5rvhKsGduoCKxi830PDQhHnisy9AX4lOf0USBD39Edjens2YdE+f0ryCnb7TJWctx xThlhR+kE9XPR0+ZhQW3dv+rEqFb5GUSp+pRuo+lofVWtqWTgRDJUlqSlXYafwbi0Wdp CnHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=oECZk/uO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o1-v6si2026079plk.621.2018.02.02.08.35.21; Fri, 02 Feb 2018 08:35:36 -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=@oracle.com header.s=corp-2017-10-26 header.b=oECZk/uO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752019AbeBBQei (ORCPT + 99 others); Fri, 2 Feb 2018 11:34:38 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:41328 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751708AbeBBQec (ORCPT ); Fri, 2 Feb 2018 11:34:32 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w12GWSed099872; Fri, 2 Feb 2018 16:34:24 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2017-10-26; bh=FjPxhGbQKrGHngSs86Wey8XOr61LW2mu/i3LFG1GCKA=; b=oECZk/uOqtw4PXXO2g8POXYrf/GcNWhj04n/AwwyEZhCv3uXDc85MGwlIFLiEVReHS9L /hMi/TQYoI261C7rdi0/Aao5QgJliLrXq64StL9BvM7J4p2THWxZIRrX3A+er+dj7q2V c7VtIz0x4DWIG7PCxLz+P3BpOiTQDCp5xSNnpVj9H0EN/C+AgvYGcNnFSweFKWz0sMhW +1hdjk2aC5CZSLUv7kzIRocZsBnl3K0JhuQTFcJJaQ7W74OTpye0K87rxOYfMJ7HBZR9 0bxUjy1rlbHa6DvecgArmmxicIxL5JIEEUzivvtYwX6Wgdqojzs0xQ3ZJu7j+JkM/wAU Dg== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2fvt5pgkmn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 02 Feb 2018 16:34:23 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w12GYNMh024232 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 2 Feb 2018 16:34:23 GMT Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w12GYMhR021398; Fri, 2 Feb 2018 16:34:22 GMT Received: from mwanda (/197.157.0.32) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 02 Feb 2018 08:34:20 -0800 Date: Fri, 2 Feb 2018 19:34:01 +0300 From: Dan Carpenter To: Arnd Bergmann Cc: Boris Ostrovsky , Juergen Gross , Nicolas Pitre , Andi Kleen , Jan Beulich , xen-devel , Linux Kernel Mailing List Subject: Re: [PATCH] xen: hypercall: fix out-of-bounds memcpy Message-ID: <20180202163401.zkshusaktxwrs6uj@mwanda> References: <20180202153240.1190361-1-arnd@arndb.de> <20180202155309.2xg2gjcp7wb7bbpe@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170609 (1.8.3) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8793 signatures=668661 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=695 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802020202 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 02, 2018 at 05:11:02PM +0100, Arnd Bergmann wrote: > On Fri, Feb 2, 2018 at 4:53 PM, Dan Carpenter wrote: > > On Fri, Feb 02, 2018 at 04:32:31PM +0100, Arnd Bergmann wrote: > >> switch (cmd) { > >> + case EVTCHNOP_bind_interdomain: > >> + len = sizeof(struct evtchn_bind_interdomain); > >> + break; > > > > This was in the original code, but I'm slightly surpprised that we're > > using a switch statement here instead of a table. I would have thought > > this is a fast path but I don't know xen at all. > > I thought about using a table, but figured the switch statement > had a lower risk of getting something slightly wrong during the > conversion. > > I would expect gcc to turn this into a table lookup, since all the > constants are consecutive, but it should not really matter since > this is only the fallback path for ancient Xen releases. When Xen > guest support was first merged in 2007, it was already > deprecated. > Ah. Ok. That makes sense. regards, dan carpenter