Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp4118731pxp; Wed, 23 Mar 2022 11:35:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHm9KgPLni/YdoBS6l87JWW1+Qbx0ywueKrrjlssNsJk2KrfB0g0fWnjtA5rc/5K9uAdP4 X-Received: by 2002:a05:6a00:21c8:b0:4c4:4bd:dc17 with SMTP id t8-20020a056a0021c800b004c404bddc17mr855749pfj.57.1648060533494; Wed, 23 Mar 2022 11:35:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648060533; cv=none; d=google.com; s=arc-20160816; b=zhY1NOVVtAEm94fjclkVjOsx463nqIY3E6va6pVSl4KCzLh9AhibUCdC0w1cfZimRC Rca/vDjLC4CLWqxUlRsBULK469Dq3aQALn2mrRbnDcelVINPsn+8s94OKPiv6u7fmVJZ SC31D+ykKDx/R7zO9VYepwWbmBwJK3kJmCUG/E1wKQldUXMstGuy6Lvnbo3FR02SX666 XNQqWrjvLMXvLazgb2KDqFIsqBK09LPPtH0zGs3f/GN6BA6O9v5hJCDGT72bkX60fpyb dHw/Z0PY9K0wK8VVPysbBjWEDdoz/hUAMj2eUOgJ1k8znJUC5uHBxJaO8S6kiRT19QX7 M/UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ahyjgVXNU7WwI2RT/4sT8oFcXWCVlvTP5OLdgtpfzrU=; b=lYlJJnGF3qtF47MjJ94RBQVsIKacWZ9uE/RgGuI4KWqb+sXqdrzXUIFVeaHEbQX0bf 4lzsfEUQWYToNaimzzprxPtV6aQ3uGAWW/Pezr9M3jKnUu3/hHDEDovCkYvZ28RlEY0+ LE8phFbxxDebDNAXRpWq+x3ONvVdRyczEIc0eN0sHJmb+bYkI3ApdKqXfPeMoWVdSIpK Mo96jEWM5j0BF+pnGlRK4gXsMlCJ+KLMonnRaxI+wa7lxoFP92+wsCtazddYzBXSAD7O xy1PcQpn5qUh9dTlF8lDj9/gEuSG2Eh4uy1aKcxxdP3oIJzbq6wLz5lPkjv21k21Oe+E qEww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 31-20020a63195f000000b00382044ef7afsi19230304pgz.779.2022.03.23.11.35.10; Wed, 23 Mar 2022 11:35:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236102AbiCWPtP (ORCPT + 99 others); Wed, 23 Mar 2022 11:49:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230243AbiCWPtO (ORCPT ); Wed, 23 Mar 2022 11:49:14 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8468F70F70; Wed, 23 Mar 2022 08:47:44 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id AA6B868B05; Wed, 23 Mar 2022 16:47:39 +0100 (CET) Date: Wed, 23 Mar 2022 16:47:39 +0100 From: Christoph Hellwig To: Kees Cook Cc: Christoph Hellwig , kernel test robot , "Martin K. Petersen" , Bart Van Assche , John Garry , LKML , lkp@lists.01.org, lkp@intel.com, "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-hardening@vger.kernel.org Subject: Re: [scsi] 6aded12b10: kernel_BUG_at_mm/usercopy.c Message-ID: <20220323154739.GA816@lst.de> References: <20220320143453.GD6208@xsang-OptiPlex-9020> <20220323071409.GA25480@lst.de> <202203230809.D63BF9511@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202203230809.D63BF9511@keescook> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 23, 2022 at 08:40:30AM -0700, Kees Cook wrote: > Regardless, I'm concerned that disabling PAGESPAN will just uncover > further checks, though. Where is allocation happening? The check is here: blk_mq_alloc_rqs, using alloc_pages_node. This hasn't actually changed with this comment. Just the size of the allocation shrunk, probably leading to the span of pages. > I *think* the allocation is happening in scsi_ioctl_reset()? But that's > a plain kmalloc(), so I'm not sure why PAGESPAN would have tripped... > are there other allocation paths? scsi_ioctl_reset is the odd one out and does also allocate a request, but that request is never used for user copies (and that whole hacky side path needs to go away, there is a huge series that needs to be finished to sort this out).