Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp29623imm; Tue, 12 Jun 2018 17:50:41 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLbOEmzv8BHDIC4NmHC3E3HSEbfWYZflfpNWmAWKYsfDllDmXFgjGEljjYIZbiRPss+gTyR X-Received: by 2002:a63:6741:: with SMTP id b62-v6mr2202146pgc.5.1528851041246; Tue, 12 Jun 2018 17:50:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528851041; cv=none; d=google.com; s=arc-20160816; b=q/x7MeG5Ox7qajwhNTcIAou6xTpglMYV46owPvJd0CQqW7+ivFnaRFRsKLhbsbXaNy 5I/Y0wHdzyzY6CgE0yhgtHkmeOYM+RzTi4gUbyzoVctezPE7NKbzb238dWlcGxpVlhnt o37XMZ4OfWVfh36fJPmteNcr1wrCvTKF/tfJz4qi7o87nTzhtIbiSvmqcBsIe7V0/qbV wIIw237DqK0ShH7t00F8twD/8sB7zbfDS5a/ekB272B/1FLt5u4hTdsyYIdjnNQ9Uzjy 0XcNHIl5fVbRC+55cgtBproxJERg95+HOb6s7IX1aZDu7lVnlDdogyhgRLSkHIK7GWRF MYdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=jOGiE5gLGr45WSSzNB6x5TllWxTzvXbQGS2jaFn2//A=; b=frzzhUqb0ox75fNEsIivqiWRx+fyp45RoAUI6zmq4Be1pfe09qLbFAKSgdDy+jIJ/H WukqJ5qLxAoMn+lU5cVyTRQM7Am6+G9uWDIhz+u9qV8d6yYu7K7l+/MZqLrFmAS2Q2dC 3SRStJuFIFxyon0DNWIIM5uiMZp2ywcOltwY0Td+qMCBN8QqfNwfw4NkYxgO7OPxrGRb +CF+jimw0dFUL2rVVFqK4N5679Led+suoAx3FYv+5qoxNZ53C6URTZc9DdECHYa0L9jT 0+/qqMvn872vU+9TPUpwXljWDZIfMpL1x6aO6HFhVD3FNtKzMWyK0Z4iENj6oYEIHHpn 3B3A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l9-v6si1421061pfa.368.2018.06.12.17.50.27; Tue, 12 Jun 2018 17:50:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935009AbeFMAtw (ORCPT + 99 others); Tue, 12 Jun 2018 20:49:52 -0400 Received: from mslow2.mail.gandi.net ([217.70.178.242]:59176 "EHLO slow1-d.mail.gandi.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934873AbeFMAtv (ORCPT ); Tue, 12 Jun 2018 20:49:51 -0400 Received: from relay11.mail.gandi.net (unknown [217.70.178.231]) by slow1-d.mail.gandi.net (Postfix) with ESMTP id F37A43A13AF for ; Wed, 13 Jun 2018 02:37:09 +0200 (CEST) Received: from localhost (modemcable008.172-80-70.mc.videotron.ca [70.80.172.8]) (Authenticated sender: hle@owl.eu.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 181B5100003; Wed, 13 Jun 2018 00:36:48 +0000 (UTC) Date: Tue, 12 Jun 2018 20:36:17 -0400 From: Hugo Lefeuvre To: Dan Carpenter Cc: devel@driverdev.osuosl.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, kernelnewbies@kernelnewbies.org Subject: Re: [PATCH] staging: pi433: add mutex fixing race condition when accessing tx_cfg Message-ID: <20180613003617.GA2265@hle-laptop.local> References: <20180612011200.GB1794@hle-laptop.local> <20180612110230.dvqmcyisdwaynixj@mwanda> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="AhhlLboLdkugWU4S" Content-Disposition: inline In-Reply-To: <20180612110230.dvqmcyisdwaynixj@mwanda> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Level: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --AhhlLboLdkugWU4S Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > We read the data from the user here and then we write it to the fifo > in pi433_write(). We should be using the device->tx_fifo_lock so that > we don't copy over the data at the same time we're writing it to the > fifo. Oh right, that makes the bug even worse. In this case we don't even need to introduce a new lock, using device->tx_fifo_lock should be fine. I'll update the patch. --=20 Hugo Lefeuvre (hle) | www.owl.eu.com 4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA --AhhlLboLdkugWU4S Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEE5LpPtQuYJzvmooL3LVy48vb3khkFAlsgZvkACgkQLVy48vb3 khnTcgf/TQQQCNinka6VClKLUfIebQJ385tfDxD4ggUyB+gt+llBOVaPqHUHVzo7 xKey2McFoLEQaRaYwSdj5uuBI4getT0oYCf2jQn+sHSLJhxf7OdJdzezUlA9dgcd LRydvUhYauqRaQGKYuqpkgBLIqPy9GULMzPGTasS60nt3P3jiJCoNJcG8CRbZTxR 3xctA1UJnCtCBpL03Fl8Spr7Avw6J/doy+ITqEhS6Bt0IvqHNAJS6ol85whWPqfP p13RWo17LPsAyFAXWDWMkHCtsi7x0lhh1DxuNHGYWsFAeAkri5bvkxImpcp9VzJo a/eqVhxKY3EX0fD+2U4PSKMjGwNyVg== =xsIr -----END PGP SIGNATURE----- --AhhlLboLdkugWU4S--