Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp6045283ybg; Tue, 22 Oct 2019 12:13:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqwPrGzSZbsE2jkDmwK2/XTFgiS/TePu75Yj1nawX6VHgiaFGiWkVaXSfH+B2EFUd6yBm1tI X-Received: by 2002:a05:6402:1252:: with SMTP id l18mr32892122edw.64.1571771606029; Tue, 22 Oct 2019 12:13:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571771606; cv=none; d=google.com; s=arc-20160816; b=lCFXbQVIu43gsJ7PFe882NHYw1Cc4WHNaYBvJ9rhQfK8duZc6wTKqBA01BZv825/1a r85d8UCx4VN3VUzPfxAMxFn//TNlkrCRGO7i71uTkDhwxT1litxPm6KbB/kWAHnHXbh1 JZPaW88gph1pZp4PxSitw5/061if75MNe5BoXE4wjznN3Aq8VzeLVUtV2I6BSVbWmZFk Q6nWWCR7hPFKNibh4P62PddsK23jcChMCcon744ht3TXQG/XB3n4wjegzidOGOKq9Tsb S4XeiSVsP6qR5yXq6D/kmfj5w5AJdfNg9QvW+YNF+m4g4KuUmk0JNBuiBwitFRSuNu5S e7PA== 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; bh=nysxb4NxOzc34BLE8aYpf5+rztCogoNfw8sxbZXLVf0=; b=s6oPSzdFL2C02yPw56FV/o146wEcgMz8Obe1QMkwbf6FUNMUntfkNihqtaDwM6Cj/R OnjoQR29D5wgFE40Vp8EhoyccvFkRuyql+U9eKv2CUBAxlOoLYPFC3ULw3HrF8ZEmvHR 19dfq7/L5DlCBOjgaVoEcUw7Bpva5tK+ypaELPFFio+pZHeBFVF1wlJoWtSFtWy9fV79 WZsXhTV8kzjokG1r35iX65WMUXh5DsAqdmV9LMTtpNum0uLNWAtykmcpm9ROeVArg2rK bAHg6tL1mjkbaGtaED++qWMTLzyulMS5hawOWzGhPHbY2gsM/+qaE0KpwMb6gmIUjf/H bRmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=c+ZppCOc; 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 gg26si82880ejb.142.2019.10.22.12.13.01; Tue, 22 Oct 2019 12:13:26 -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=pass header.i=@ziepe.ca header.s=google header.b=c+ZppCOc; 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 S1732830AbfJVTMT (ORCPT + 99 others); Tue, 22 Oct 2019 15:12:19 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:39899 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729696AbfJVTMT (ORCPT ); Tue, 22 Oct 2019 15:12:19 -0400 Received: by mail-qk1-f193.google.com with SMTP id 4so17349121qki.6 for ; Tue, 22 Oct 2019 12:12:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=nysxb4NxOzc34BLE8aYpf5+rztCogoNfw8sxbZXLVf0=; b=c+ZppCOcCXkLqnSt1Af5JzQ/n2eRfVp476u86d5pkFQCcdqA5AJTSyjOedcMFbtjt5 yrdUfYJ+mBAjWwiglQglsyMFst/wIy24oQ3kgFVsHYDk6tMsQy389iTzKZYzVr97jt96 JEOJxXnyF4cUogJdBTXGTpWtkJTju+EFkaGLvKa6nhI5AS0YrQQyVJxlaywjd6nYtww6 tECDcqYYfoqOeT+c3hoxOnYsSE9528TjKYBYRpjKjbER5Q2icHA0OwItQED1sZIUOb+v EM0btFnLkJfkq/0SFiqtll1lCisBvD8i44XtEJdIC+L9Vp9VFUk1Jr94fFL1cN7JWEk/ C68Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=nysxb4NxOzc34BLE8aYpf5+rztCogoNfw8sxbZXLVf0=; b=deK1p59z6y67MbEfpltc+rdz5nZaoYfVzrMA5VVqSLlj/wJ6C/ZqYO/KRCiG5dCx4o pYDEj2jpIbvra5fMbRD1jvCnuScz6ryBDpw1agKE+E+/yRMKFLwc9PWRCRg9QpDiN9Iq gh+qMQTV1hG06dEjDYzCZt31SRoQDm8uvGj2B4pSHoTGWFzh40pD0kuwzPsdLxbZti8K j5GgKlLaUPQuh1TiBvUSOyapxUUNTz7ziJz4unHMK6Zt3cBJHAIXZTewCADPPiIqqxSJ 9jllCWOTXfD7o5/kXqzNyez5FDNeES7YDwXxfuqT+aeMrBPeQ40Y8kJRzriBlSbXuDMt 7pAg== X-Gm-Message-State: APjAAAXQhXpqq8cChDhG64xwxVhHgo6tHkaNP1ieo5JiGBHfaUozsqmV IYO2ZFC8e73ca1ibZOvkS0r4J/9tOWo= X-Received: by 2002:a37:a709:: with SMTP id q9mr4552281qke.57.1571771537157; Tue, 22 Oct 2019 12:12:17 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-162-113-180.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.113.180]) by smtp.gmail.com with ESMTPSA id f10sm8527753qth.40.2019.10.22.12.12.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 22 Oct 2019 12:12:16 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1iMzZo-0002n5-7w; Tue, 22 Oct 2019 16:12:16 -0300 Date: Tue, 22 Oct 2019 16:12:16 -0300 From: Jason Gunthorpe To: Chuhong Yuan Cc: Doug Ledford , linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] IB/uverbs: Add a check for uverbs_attr_get Message-ID: <20191022191216.GE23952@ziepe.ca> References: <20191018081533.8544-1-hslester96@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191018081533.8544-1-hslester96@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 18, 2019 at 04:15:34PM +0800, Chuhong Yuan wrote: > Only uverbs_copy_to_struct_or_zero in uverbs_ioctl.c does not have a > check for uverbs_attr_get. > Although its usage in uverbs_response has a check for attr's validity, > UVERBS_HANDLER does not. > Therefore, it is better to add a check like other functions in > uverbs_ioctl.c. > > Signed-off-by: Chuhong Yuan > --- > drivers/infiniband/core/uverbs_ioctl.c | 3 +++ > 1 file changed, 3 insertions(+) The call in uverbs_ioctl.c is safe as well, that code path checks that the attribute exists. Still, it make sense that this check should be present, so applied to for-next with a clearer commit message Thanks, Jason