Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp335489ybh; Sun, 12 Jul 2020 07:55:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyknr9Xm3nUzwKi20WOjiMjbBvzII0rPRToNEz5ncZ4sAbhRO9mkp1FJk9KfSi7BhwpNC7O X-Received: by 2002:a17:906:a84d:: with SMTP id dx13mr61799177ejb.246.1594565705081; Sun, 12 Jul 2020 07:55:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594565705; cv=none; d=google.com; s=arc-20160816; b=BXjrIgtrqERgOo9mRYPGwtQ2GVJAVoI/TLlWEpYSpNZaLyFRFMzc6kvkAvK8XCrPRI 0hEUGYYjpqqRF+41gkly6PPfDEbicLl2K6JerR0k52twQyObBqxzNCJY+Duijg/TzlMM FIf2VcNRcN1q3ZRCuJ403zoe5yQbvhHUWkGEF8zWGIQrgQt7qq1raamRKX/ZU5Gon6z2 2abOdXsWPX2LVoHlMYE++uNftZNHcG6XXa+o6yHTi9Hl3EC2mNV+2jzRHnPo8CoZ78bF OrRrZLsshFAhoKazStEmQMfYAWwRl1cpnh+M+nIrPqFpJZ2DG66VYBTaCdYwxIAhW9lH kRwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=XPXkvub6jYBBBPAyd6pzdUrw1T3+QKSiI+YpVc2oq0E=; b=1HYUf4SLer6SW6JN22nZOTf8+EfMKd6esBwthdKA2GTpmKlsg/Aj9cFe/oRDDoa6OQ Ik6ghsOkzw6KPCSvStyrfTJDG/68jXYgddGurXMVTYwXFETMRRzeyQSJBJNtNrW90loO 8UdHhP+XE7o1oU4dtqCHlWtnHdq2qMufJq99hD3xdm0KB9nsnQs7U21TYBD/xTA4PxNK DYKWdGSneM3fHTCYZBBu74A7khxIRprp4Ia1CD3qiFpvEFiyu0nGyryGMC7LU41cAuDF WKhVG6qmukQo1SCFqceDVCQlhqJ7jFWOJ0GnQw1hX30IX+Kaad5689cLbP3QpVFt8I4+ kQrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=IUO7qseV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b6si7454864edr.578.2020.07.12.07.54.40; Sun, 12 Jul 2020 07:55:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=IUO7qseV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728854AbgGLOxt (ORCPT + 99 others); Sun, 12 Jul 2020 10:53:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728786AbgGLOxt (ORCPT ); Sun, 12 Jul 2020 10:53:49 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B798CC061794 for ; Sun, 12 Jul 2020 07:53:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description; bh=XPXkvub6jYBBBPAyd6pzdUrw1T3+QKSiI+YpVc2oq0E=; b=IUO7qseVzERi5xQYWx5eTdTOAo UHEMFNirvgCkhALH2FhJJU2wGrQkXAvcjKiJ9xC8NNOEprl2oBe+dXJmzxiUeGiNiph4WddkJROJW KrV38pxRPUbIuCPJZlVjoIX54Yh2U4bkmRmSMX9zfUUnBFchkpQfyUqSP2KV4atTj4GExFh+HJQUO BsBB9IxpWse93Wo2cxtyb3MlEWhdLQLTX+l0LWbAjCPvpzbSG4LwXKnFOP1vUdj0u0bNw3HG6XECe 2NIeGYVK9pR0W7LUARqFYoGNjqBZWYsJzH3naaIOcsPvWRSEUMhU/KV78q+PYfmyCplBBuA8cgFjA ii2QQ+wQ==; Received: from [2601:1c0:6280:3f0:897c:6038:c71d:ecac] by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1judMO-0004bo-Eo; Sun, 12 Jul 2020 14:53:44 +0000 Subject: Re: [PATCH 04/20] dlb2: add device ioctl layer and first 4 ioctls To: Gage Eads , linux-kernel@vger.kernel.org, arnd@arndb.de, gregkh@linuxfoundation.org Cc: magnus.karlsson@intel.com, bjorn.topel@intel.com References: <20200712134331.8169-1-gage.eads@intel.com> <20200712134331.8169-5-gage.eads@intel.com> From: Randy Dunlap Message-ID: Date: Sun, 12 Jul 2020 07:53:41 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20200712134331.8169-5-gage.eads@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/12/20 6:43 AM, Gage Eads wrote: > +int dlb2_ioctl_dispatcher(struct dlb2_dev *dev, > + unsigned int cmd, > + unsigned long arg) > +{ > + u16 sz = _IOC_SIZE(cmd); > + > + if (_IOC_NR(cmd) >= NUM_DLB2_CMD) { Does this bounds check need to use array_index_nospec() from ? > + dev_err(dev->dlb2_device, > + "[%s()] Unexpected DLB command %d\n", > + __func__, _IOC_NR(cmd)); > + return -1; > + } > + > + return dlb2_ioctl_callback_fns[_IOC_NR(cmd)](dev, arg, sz); > +} I don't know if it needs to or not. I just want to make sure that you or someone has thought about it. -- ~Randy