Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp414942lqz; Sat, 30 Mar 2024 02:09:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUQi00kcpPl40EO2SBG/68duPF3T/b1E38DP2/hL5KgkFYKWI7yP7Hh/ejjshqjEdqvw41qrQevczXU0G29p7Amu92q3dlpJYnpu0nrCA== X-Google-Smtp-Source: AGHT+IFTcV7jr5PQdqQ1Q3roGwWV/3HCyuISeVtL5rrhETXtqhbElpK9mTLQzuM8mg8ieeS08wma X-Received: by 2002:a50:9f69:0:b0:568:c2e5:ae9a with SMTP id b96-20020a509f69000000b00568c2e5ae9amr2550333edf.5.1711789782737; Sat, 30 Mar 2024 02:09:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711789782; cv=pass; d=google.com; s=arc-20160816; b=0FBzyvNPlMQHlRaMr6oGRFCpA0bs1b4+uhnj4JIlbYFzW5hekp1YkYWpilNpbCYKbW aqty4tpKxEcfMXttH0W0UePecUgmsUytGn29ZJAe3IxQORXCMI5OkqfcAVZ6pgacwTTV pB+GV6m1wbwbq54/zYQGuLohAPM2UQx1tGvgV3XKZbSP4JYQ9gTGV5TzknA0dfiCn5lB fsrcI+aScGgFcTE89Fni5lb6IQJsg0w4F8oKuT0js842NRTryjrxlyEaur/sQ1HiF63N zEE4uIk5rUD3Cti8pbN/WLfVMBKcbdvN8aevG+rCG89QH/C2MQ3cUHvn5Nv7mfyB1n8K 0Xaw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Ic5iwmsAN9nXvUd6zgKPhgNt/HMCsyuYzKBoPcBJdKo=; fh=VDA1z90HxoziazMqgQENSi/xWFhi/M5u2X5QwY61QRY=; b=vclaZPuOvZeVNj/2Aw8sTr9mbXiRg6mQpsjRiJ5V2c9XKin5dZ40+E/a7d0F+xE7YA eWNZnC1X4+0+TCRiHXBvXso6XPwp86QE/lv2LHkyC780ldvr5W+LgAzzc+716PolwgKB 4mKDOytNVTA/HcplgfaFbhtKaaC5pcWJMZkFZTDgqLmp3doOacJNwlPjFuxwhagOJRIs IkD4RTIb1/AlmpE161jmdpnjdgMmnV5z8OLiQnsHGv7CzFk3C79cbN2+nAjIuvt3Or0M FUVw+V2SUIE6NqozoUSuraYiYf65gBDAnNIASIGF5TiyyNh5bh4EVz8/dDDImtg7UnZP aKfA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=k8l97VZ7; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-125636-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125636-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id v19-20020a056402349300b005687fdb435fsi2657587edc.411.2024.03.30.02.09.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Mar 2024 02:09:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-125636-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=k8l97VZ7; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-125636-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-125636-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 6B2ED1F21FE8 for ; Sat, 30 Mar 2024 09:09:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A98672919; Sat, 30 Mar 2024 09:09:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="k8l97VZ7" 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 9C0F8BA57; Sat, 30 Mar 2024 09:09:34 +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=1711789774; cv=none; b=sGA47sKGRz1NCfjOGXb0QhL9POJUuAQ/iGabufH7PwRdiFmh1ehL9J1a3QR+VAOHwYkzKxYPsr9DcMWLJGu+9YhB2ecIGfD86v+GLUu4onRajW8fAZw+BYHs11Nk7H6xQHGNXeuDOo265RbAcB2HYFPf+V3xHqBK+hUhpjRMJPU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711789774; c=relaxed/simple; bh=xreq82aGzQ3JmBuEJlKHp0cTF0bfinus9BUKu+7kd5E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qdwES2SuZv2Wu7XpjMA/SVgOq1o3URhep4H+Wxyr6iHgn+pi0h0pPNbKviwaysafFUqwvgYmej+CE1X6LSViNzMszK5BtRF0nCO5phYoO/35HKgtTDD1iHQByeojriUYXOzhIt1TAMWI5/3m7Jv3XJxcUtf13MUAUlCbheiab54= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=k8l97VZ7; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2315C433F1; Sat, 30 Mar 2024 09:09:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1711789774; bh=xreq82aGzQ3JmBuEJlKHp0cTF0bfinus9BUKu+7kd5E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k8l97VZ7gFFFSU5qXSw2gg04x+YsKwGS8ISNYB0XDiQDA2bDDdB8HUzjNEGJ0YKe5 5BHQB5gh9DqojaFlUMDDh3ecGqEUGKG0Oz6pzjdZMR+esZ+FMbXTUV7KR8848dTK3R 3vL7zzkKx5Ex3Ru6rNpWT92PGZu5M8JD4hg12StY= Date: Sat, 30 Mar 2024 10:09:31 +0100 From: Greg Kroah-Hartman To: "GONG, Ruiqi" Cc: Jiri Slaby , Hugo Villeneuve , stable@vger.kernel.org, Jon Ringle , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Wang Weiyang Subject: Re: [PATCH stable 5.10 5.15 v2] serial: sc16is7xx: convert from _raw_ to _noinc_ regmap functions for FIFO Message-ID: <2024033023-scorch-volley-7265@gregkh> References: <20240330012520.1904970-1-gongruiqi1@huawei.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240330012520.1904970-1-gongruiqi1@huawei.com> On Sat, Mar 30, 2024 at 09:25:20AM +0800, GONG, Ruiqi wrote: > From: Hugo Villeneuve > > commit dbf4ab821804df071c8b566d9813083125e6d97b upstream. > > The SC16IS7XX IC supports a burst mode to access the FIFOs where the > initial register address is sent ($00), followed by all the FIFO data > without having to resend the register address each time. In this mode, the > IC doesn't increment the register address for each R/W byte. > > The regmap_raw_read() and regmap_raw_write() are functions which can > perform IO over multiple registers. They are currently used to read/write > from/to the FIFO, and although they operate correctly in this burst mode on > the SPI bus, they would corrupt the regmap cache if it was not disabled > manually. The reason is that when the R/W size is more than 1 byte, these > functions assume that the register address is incremented and handle the > cache accordingly. > > Convert FIFO R/W functions to use the regmap _noinc_ versions in order to > remove the manual cache control which was a workaround when using the > _raw_ versions. FIFO registers are properly declared as volatile so > cache will not be used/updated for FIFO accesses. > > Fixes: dfeae619d781 ("serial: sc16is7xx") > Cc: # 5.10 5.15 > Signed-off-by: Hugo Villeneuve > Link: https://lore.kernel.org/r/20231211171353.2901416-6-hugo@hugovil.com > Signed-off-by: Greg Kroah-Hartman > Cc: Hugo Villeneuve > Signed-off-by: GONG, Ruiqi > --- > > v2: Backport to both 5.15 and 5.10 > > The mainline commit dbf4ab821804 ("serial: sc16is7xx: convert from _raw_ > to _noinc_ regmap functions for FIFO") by Hugo has been assigned to be > CVE-2023-52488, but for stable branches lower than 6.1 there's no > official backport. > > I made up this backport patch for 5.10, and its correctness has been > confirmed in previous communication with Hugo. Let's publicize it and > merge it into upstream. Now queued up, thanks. greg k-h