Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5659823rwb; Wed, 9 Aug 2023 07:30:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEIZuIP3f7fqDF+8Oz5JhywuQUkXwurvy3eHAMVgH9/Ar5Crua8HP7XMWQSMk/H8Nvgv967 X-Received: by 2002:a17:90a:6c23:b0:262:e598:6046 with SMTP id x32-20020a17090a6c2300b00262e5986046mr2572998pjj.28.1691591424843; Wed, 09 Aug 2023 07:30:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691591424; cv=none; d=google.com; s=arc-20160816; b=PX/O9CD8p1+YBSq4HsmMeMK0hMuYrFwxgsRMhx7kS8VQ8D+7qUs/WFml0405ayqFrS PSh382ObiEdSP7NkX433Gbeixo38e8ex51WWrIsEYT6QgzK82cI1biwbx4XAYBbdk26k kVnSC+I74CEWVN8Kz4TTBVZAUKzyod6JK093mrgC6Ya0o7/rWorafXJTJ/ResiBNAj8P 1WnS2U908MFsAfCsMV9t3Ahbk9d7/MnUkwn4CLYH+EDxTiJMT6HIf/8FZu59X8Na224m VPdA5K5gb8Dxib+rehtpSsl6zOM5FxJzQNomACNbH56X5HQwff7NareKdizkT/SW+Kqb dt+w== 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=GL2JyvETZKl9jYIgct5t8FsWBTawFbSQQSiIO1uvJEA=; fh=yXoz25JHXtE+zUDGuu0hfLyrtw/G1K5bvuUzTsqtQfg=; b=nLbl618AjBr2upWnV4jzJllg12SbI5nZQk8gt8+IujDmgoDe0zI4GTC1/yx4zbHk8Q d8hiHcHY5ZeK5w+ONCorfX1WrMCPq+3E2r6XhKlm2uFkPNJwAFqaUmUBTWbrBcDsDcfh cIypgxVqkrRiEyOW+EZPY6yGDrmG8Uy7mHWKS4E0v7AibbBM2LmoYE5E+83AhbAjKt3i Cuip6HrGncN2YvOoPvGAQgySw0h+GgQpUW/8fbBCVE4LK8G/NEGw7MBjJIio+qyRtKTD 0QSI31GjSVt826HzXujiN94YAes9EvebkSiIv3SjWT2KarwyDYOUZtW4zl0taoeytFFX TMfA== 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 kk13-20020a17090b4a0d00b00256a04ff7cbsi1705361pjb.119.2023.08.09.07.29.55; Wed, 09 Aug 2023 07:30:24 -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 S233197AbjHIOPt (ORCPT + 99 others); Wed, 9 Aug 2023 10:15:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233208AbjHIOPr (ORCPT ); Wed, 9 Aug 2023 10:15:47 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACE571FCC; Wed, 9 Aug 2023 07:15:46 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 822116732D; Wed, 9 Aug 2023 16:15:42 +0200 (CEST) Date: Wed, 9 Aug 2023 16:15:42 +0200 From: hch To: Stephan Wurm Cc: hch , Richard Weinberger , linux-block , Miquel Raynal , Vignesh Raghavendra , linux-mtd , linux-kernel , Johannes Eigner Subject: Re: ubiblock: null pointer dereference using scatterlist in work_queue Message-ID: <20230809141542.GA32614@lst.de> References: <1293911429.1782934.1691445776353.JavaMail.zimbra@nod.at> <20230809135308.GA32214@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 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, Aug 09, 2023 at 04:10:59PM +0200, Stephan Wurm wrote: > Am 09. Aug 15:53 hat hch geschrieben: > > Well, a scatterlist culd contain a highmem page, in which case sg_virt > > isn't going to cut it and you need to kmap. Is this a 32-bit system > > with highmem enabled? > I can confirm it is a 32-bit system with highmem enabled. Yes. So the code needs to stop using sg_virt to work on highmem setups and do the equivalent of scsi_kmap_atomic_sg. Best way forward is probably to move scsi_kmap_atomic_sg to lib/scatterlist.c (and also convert it to kmap_local instead of kmap_atomic while you're at it) and then use that in ubiblock