Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2165953pxb; Fri, 25 Mar 2022 12:15:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySwwgBcI5MsUOkkKa4O2k4xRtFg51rwX7tfW3G69E9bT9Id3n3nrt5VeAuH0JbqLpC7fH1 X-Received: by 2002:a63:f418:0:b0:382:b4f6:5f95 with SMTP id g24-20020a63f418000000b00382b4f65f95mr801326pgi.619.1648235751612; Fri, 25 Mar 2022 12:15:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648235751; cv=none; d=google.com; s=arc-20160816; b=URerM9Bam6y1ZYN4QUQDm/gJqahbsJp3r1Nk1bkM/DaQPc9UBCg2GY36ovjFLHcwM1 2PRxXPcBrpmp2kMR9VbtHtlrbliWlxat6oZjYwNuAMGsrFkHaB4elOmE4Vn8DAMDifpK ghoNXUt2A9/rNKrWvHHyslLpW922zqGUlrfkjC6AHWEipDNdO6ULsJ3PTh4+8CTT/aKp lP+X8ejSmTNhijhWqN4J82UJ8GQxitMQzC2cetLu5bzYtoi/o7KgqYXj2FzcHb4XbH0n AcAeFrnYHVZk63zqqRevBzqYKfy1wX9gYHzx5157x8cNK8lqtTOuKlQVbdDkURS99X3q NdXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=kuegp+jO55Es2fDo8uYnNCcqkv5SBF2sv4c9HycY6CM=; b=YWzvzTwbbqqv5P7uZJrI1wrBZqQvTbx7NM3OPTwZJf65krOXEctkgNwXQGh45XWYZe 72WtbuR6iI8hEWoaCmYRPGC1XPj9gWyic0c5Z5aleHsstuNDApsZhEkc3nvNqn/+MDNa x2xYK5AeYP3nic+EIkyyZqT0ufwpOMC9D80VTaN10G/T6GKbabPVpTUJRTBBkFezJDRU eGCLqNFGo6/jZnBn0Xcuma5rAYR7yUiR62gJUojtl4ITn4vc3CUp3xnDQXbNVj1XrVJn rsJcm8EKUG2MtyicfUhc9IbxKcGDZwzW1JLcTVYx2MEEAdfQ6CKTkN87VvLEkjsx7WFb VW8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HYy8RfEc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p26-20020a634f5a000000b003816043f15esi3039116pgl.851.2022.03.25.12.15.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 12:15:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HYy8RfEc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 47FEF22A29F; Fri, 25 Mar 2022 11:20:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345231AbiCWWcR (ORCPT + 99 others); Wed, 23 Mar 2022 18:32:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345196AbiCWWcQ (ORCPT ); Wed, 23 Mar 2022 18:32:16 -0400 Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EC378F9B6 for ; Wed, 23 Mar 2022 15:30:46 -0700 (PDT) Received: by mail-pg1-x532.google.com with SMTP id t13so1110690pgn.8 for ; Wed, 23 Mar 2022 15:30:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=kuegp+jO55Es2fDo8uYnNCcqkv5SBF2sv4c9HycY6CM=; b=HYy8RfEcJn0cdTzqwpS2rlZi7xnKmbeG+psgdpchzqU/5y+CTsFtVX4rVeEtsVb83D hAFNA1M1MtQL9GFDKHiGNlyncPlwKh5GVNrn8g9edkO55gj6nqwVPQ504xJOVnaEYKtq 8AGKluaPKOdzHMuFDynqtxL9szrRkudj9R+Zc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=kuegp+jO55Es2fDo8uYnNCcqkv5SBF2sv4c9HycY6CM=; b=BxbCux5yyMSS01XEC/+3XAYI4kdeHipz+9WuuDJ0iU7tSmQukgJ/BSPemd0U3+5ed+ S7NmzonQOI2DQpZzK/1rhUXjgZmZCsW9kjDSMVXV6ndx2b53CDatg1GsZiaVjR8Er47b zOfePuPvlin1KcqoHVwDaadsfDjLqWovmeV7svyRrjau/9Aw0woSEXHFTmpRg4v34d3J F8iCyKVuRgJmDaUyWyApXqXuY5V5oT85hcwJhvjFCVZcyBc8A4uO/JGXyikc319V266H HhGwyME3LxmW0PdLB4KmL+CRFLV6twpaYQ18JFV+j0XCndCXqRfOXkoMDQM847MDQ9sT oH6w== X-Gm-Message-State: AOAM531RXIQPKLQMLRA7FxUE1jej76SFgoHrCg9czh2TphgNX2BH+BZv n9Tr9MzZlWGCzPwd8s6Cx5J7hw== X-Received: by 2002:a05:6a02:101:b0:386:865:44a0 with SMTP id bg1-20020a056a02010100b00386086544a0mr1585953pgb.475.1648074645645; Wed, 23 Mar 2022 15:30:45 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id u15-20020a056a00098f00b004faa58d44eesm839224pfg.145.2022.03.23.15.30.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Mar 2022 15:30:45 -0700 (PDT) Date: Wed, 23 Mar 2022 15:30:44 -0700 From: Kees Cook To: Matthew Wilcox Cc: Christoph Hellwig , kernel test robot , "Martin K. Petersen" , Bart Van Assche , John Garry , LKML , lkp@lists.01.org, lkp@intel.com, linux-mm@kvack.org, linux-hardening@vger.kernel.org Subject: Re: [scsi] 6aded12b10: kernel_BUG_at_mm/usercopy.c Message-ID: <202203231529.0CB76344@keescook> 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: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 03:42:34PM +0000, Matthew Wilcox wrote: > On Wed, Mar 23, 2022 at 08:40:30AM -0700, Kees Cook wrote: > > On Wed, Mar 23, 2022 at 08:14:10AM +0100, Christoph Hellwig wrote: > > > The actual warning is; > > > > > > [ 34.496096][ T331] usercopy: Kernel memory overwrite attempt detected to spans multiple pages (off set 0, size 6)! > > > > > > This is for the cmnd field in struct scsi_cmnd, which is allocated by > > > the block layer as part of the request allocator. So with a specific > > > packing it can legitimately span pages. > > > > > > Kees: how can we annotate that this is ok? > > > > The main problem is that CONFIG_HARDENED_USERCOPY_PAGESPAN=y is broken > > (and nothing should be setting it). > > > > This series removes it: > > https://lore.kernel.org/linux-hardening/20220110231530.665970-1-willy@infradead.org/ > > > > Matthew, what's the status of that series? Will it make the current > > merge window? > > I thought you were going to merge it! I haven't put it in any of my > public trees. LOL. Okay, you'd mentioned another check, so I wasn't sure. I can go ahead and snag it, but I'll likely wait until the next window and let it live in -next for a while, unless you think it should get YOLOed in. :) -Kees -- Kees Cook