Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4576387pxb; Sun, 14 Feb 2021 16:01:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJyfgYqqzQ/bu3cZC4M6EQzENxCRXfO66qcie79RJhR2N4z9p0o0ZyBmjoe0v43qQT1QUtOU X-Received: by 2002:a17:906:8890:: with SMTP id ak16mr7416138ejc.398.1613347299078; Sun, 14 Feb 2021 16:01:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613347299; cv=none; d=google.com; s=arc-20160816; b=iy84yzgrHzCPGZ3ovoCkZoBI22RD+fJPEFBQbJGUjUfI0+9qygrVEGoCngsRN9VXWR wdBsTTjiqQogz4SIOKoo3cqny6yl6NlETa51mgCPDmbw/ndISiQ12/NsSDwfuR4NBya6 RZ2pSqtNzAf+G6DCJztVJduXub4/ksLcowNNshWNEHkSBw6fgUEvAyT/mZsE3Gp2Jyyj CDlIlHzGBQ5Wm/WzeoEmb9omyVhu+xjXQkxyK6qrTF3wy+vWRVVfojYCdBL25klC/IDe Tm4BjKSCLRWYX+cxggBia44uAcdOjC2LHUEPZsxA4RJF02mPO5TIwoVJxJFqpuxGJmOf gj7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=JERNMYEvPezEGYzXsliQ8cRU+obWrBky4V2Y6+C+j1M=; b=O4wXBNGnA5z03YWJzsaRS1SpWfppvpP7hPo/p/P3unIMtuS3wXcN+WYUvOJHgfzmNX lXu8Y99n5oGyl0QC+EYnjczUWn95IvngIlz2vNLb42rf4hl9YvlKfGq9MGGk9A/vPNRK SOu/mk2Ih9SOuLOan3fNJanymyJUm5TsX/imjcWaJDSQ1evCtkp3iKjLc6pBC0SsVVhA 9XpeUBfwGpLLJbhmkCblw++Xr9Xiapx/162fmRbr3fKdIwqcyN8FaIh8ePiZk8Pab+Jm eS8p5Iead1cyro6h5guRqxCp6J+8CebO9g5iG8OEVtLuJb6rEknCtfYvb54a8et4Ri9m I5vQ== ARC-Authentication-Results: i=1; mx.google.com; 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 k27si11290587eje.568.2021.02.14.16.01.14; Sun, 14 Feb 2021 16:01:39 -0800 (PST) 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; 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 S230019AbhBNX6l (ORCPT + 99 others); Sun, 14 Feb 2021 18:58:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229981AbhBNX6k (ORCPT ); Sun, 14 Feb 2021 18:58:40 -0500 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8E4BC061574; Sun, 14 Feb 2021 15:58:00 -0800 (PST) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94 #2 (Red Hat Linux)) id 1lBRH4-00E3lo-QQ; Sun, 14 Feb 2021 23:57:58 +0000 Date: Sun, 14 Feb 2021 23:57:58 +0000 From: Al Viro To: Ben Widawsky Cc: linux-cxl@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvdimm@lists.01.org, linux-pci@vger.kernel.org, Bjorn Helgaas , Chris Browy , Christoph Hellwig , Dan Williams , David Hildenbrand , David Rientjes , Ira Weiny , Jon Masters , Jonathan Cameron , Rafael Wysocki , Randy Dunlap , Vishal Verma , "John Groves (jgroves)" , "Kelley, Sean V" , kernel test robot , Dan Williams Subject: Re: [PATCH v2 4/8] cxl/mem: Add basic IOCTL interface Message-ID: References: <20210210000259.635748-1-ben.widawsky@intel.com> <20210210000259.635748-5-ben.widawsky@intel.com> <20210214231456.xnwitliczv6qwmjv@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Feb 14, 2021 at 11:50:12PM +0000, Al Viro wrote: > check that len is reasonable > p = kmalloc(offsetof(struct foo, string[len]), GFP_KERNEL); > copy_from_user(p, user_object, len); offsetof(struct foo, string[len]), that is