Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp793392lqb; Wed, 29 May 2024 10:35:41 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWw9lQJ+bF1Mq8Eg7bw0J88FlMwtRFkS62TDujfZZu+pp/gRpFoqpdLnZYrcs6/X9OMe+hllbBV0q80z/wsTn8SPrseYhAW+y92j4RuyQ== X-Google-Smtp-Source: AGHT+IHH4fDPsVKYh/IXRPuQzaTZ6/TQDzCyR6g+pwXcbxraBLicbfJesIh8bvPVYsJWSLGCPbRk X-Received: by 2002:a05:6358:795:b0:199:4d2d:6183 with SMTP id e5c5f4694b2df-1994d2d658fmr160616355d.12.1717004140747; Wed, 29 May 2024 10:35:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717004140; cv=pass; d=google.com; s=arc-20160816; b=uWE0fOXc4KzwWZ1TkqSmtwjOSF1MUDItl3+pj2b1egLLoD91q/RNYsbyjLv6kHQHOK ThBx0FbgimjNboiFrKdWyigsNHL9WezRuvtKwjW0/PNkEJ5QhHdvHjzsna52t/SXbtQX bpGhGjJMFhE1JPOVda23u1hp7aijeFSBbRo+sQgaNy87FvsMMNoGhvl9UMHYv7IITZ0L d55hotemhbjhvFUA4AMAhYEH++IbbvF/TH6byhgICHKGiyS0NDidCLSIgWKWsq/1pCoy G0PD5XlRTT5k7FXjM9XZEfD2aRkxQS09EkvQyT4wyxqtoTapICS+6OYQ/rJ15Bmp0OYH YndQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:subject :references:in-reply-to:cc:to:from:dkim-signature; bh=doYN5gkhm7Vn5VX7dt3y5EQ9R+R889BROUeM7KbCwfk=; fh=2vVckNDNw2rdorEoOvQuGtj5IUIEmqNoMrZZN9rOpV0=; b=Ppn0xTgs24QUnyL8DpdMF0E/n+b3vSkPhODAZFpyViV+nN9iSQagu6bZ8wfDcTOgsi SVVqUbqmdbtiqaM/jPsjDwFPIrCEVkOCz64dG85Ltfcx3Yjr6dWFMt3/VkcgIarUksmj fr3+H6ANoeLDxxfEOb9qZccPK6HRC94Ml/tUCQFaoD0VT+HCWLF2w3T152cWhq7apsAA g2xXi2qi1ezQmgF5xyVo4VpdfkMA2nUENX62WdVPp/Q10j2lKd1f9QLZw2ok9OX/ZhE9 +ZX3yXEucDtDL19j+1kt+y4gpXLwRrXmE/z+PxwdqAfICsXUihAMdydyfokik0oN+6bg yWjA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SPqDu8wy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-194517-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194517-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6bce380e8c4si925013a12.897.2024.05.29.10.35.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 10:35:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194517-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SPqDu8wy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-194517-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194517-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 04D8FB24CA7 for ; Wed, 29 May 2024 17:35:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8646C15CD6E; Wed, 29 May 2024 17:35:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SPqDu8wy" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF8FB33C0; Wed, 29 May 2024 17:35:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717004128; cv=none; b=Kj2YkXJwZQLh/b1989b2S3VejwZsB5/ZikzmQgsyBt5jyjxi1YSsn6FzeB+vTl+7ojR7hi45vywngkXu8NYKVqD1ZiPXpO0EAi2w2mq1MFz5HOKD4e/KZOC6ZFG/KJLmoT00qJ77RA7Rkg8+vHx41CiW2+rfZsb+dZ38AUEDgO8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717004128; c=relaxed/simple; bh=MjJHXUdhLb1is7lbuoclhiAcsAwXgz+ipfJlkWfGOVs=; h=From:To:Cc:In-Reply-To:References:Subject:Message-Id:Date: MIME-Version:Content-Type; b=Q8NpPfizlfHhBwghETFZGYMuUvzKK0EDGpBYe9in9JIrMzmrAFLMemnBUrBt77CV/wP7BnmJ61y9DZxV/4zdC3FIY42yfmcnpoOa+ToQpAFg5qM4PjQCmFibqQfq+86ipwvEr7D+2Ga4ON+LcNC9te7nY8lqmuABfdYcXLswO4E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SPqDu8wy; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B4F8C113CC; Wed, 29 May 2024 17:35:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717004128; bh=MjJHXUdhLb1is7lbuoclhiAcsAwXgz+ipfJlkWfGOVs=; h=From:To:Cc:In-Reply-To:References:Subject:Date:From; b=SPqDu8wy/H+/KKNUeznJ6k6xP+tDmTEOOpvsK3VpcO/pJXfA/5xdIOtL+4b6WgyIo APmEeiFzCcGrnp/SiEt6P39AFuDR8DYHBgiFLCikpETTwNTL4Mhkb7Lyzdv0EFa/1h Yq80UJbx2l88rOhGt6+Ulfxs+R158wgpDDM/CHlZmILw/4lMDYSGzm/soWGdJwGATK 67oP+fQBeyOjaU5LN1PpR8eIeyLE6A1LPFifQ5Rx52oIgB90dfPOh/RBgaXP3NFY7H Oqu68q0mi1q6cZ6d2uoToxVRqgkFYE9guz719OswnmewHfGLsrNMi0H9SPDfzi459j XfPVeFB6d4r9Q== From: Mark Brown To: =?utf-8?q?N=C3=ADcolas_F=2E_R=2E_A=2E_Prado?= Cc: Andy Shevchenko , Neil Armstrong , kernel@collabora.com, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20240529-dma-oops-dummy-v1-1-bb43aacfb11b@collabora.com> References: <20240529-dma-oops-dummy-v1-1-bb43aacfb11b@collabora.com> Subject: Re: [PATCH] spi: Assign dummy scatterlist to unidirectional transfers Message-Id: <171700412683.151137.4555669167122921489.b4-ty@kernel.org> Date: Wed, 29 May 2024 18:35:26 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailer: b4 0.14-dev-2ee9f On Wed, 29 May 2024 11:42:35 -0400, NĂ­colas F. R. A. Prado wrote: > Commit 8cc3bad9d9d6 ("spi: Remove unneded check for orig_nents") > introduced a regression: unmapped data could now be passed to the DMA > APIs, resulting in null pointer dereferences. Commit 9f788ba457b4 ("spi: > Don't mark message DMA mapped when no transfer in it is") and commit > da560097c056 ("spi: Check if transfer is mapped before calling DMA sync > APIs") addressed the problem, but only partially. Unidirectional > transactions will still result in null pointer dereference. To prevent > that from happening, assign a dummy scatterlist when no data is mapped, > so that the DMA API can be called and not result in a null pointer > dereference. > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next Thanks! [1/1] spi: Assign dummy scatterlist to unidirectional transfers commit: 9dedabe95b49ec9b0d16ce8f0ed1f9a12dd4a040 All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark