Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp51207imm; Tue, 12 Jun 2018 18:16:37 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJncunysoRXCT4akQjJtqp6ISQXSxK12jgTzcWf+7UkDI8A7suMIUr1cTOYkuLOPYhetVod X-Received: by 2002:a62:1fd6:: with SMTP id l83-v6mr2757647pfj.182.1528852597534; Tue, 12 Jun 2018 18:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528852597; cv=none; d=google.com; s=arc-20160816; b=0KUbylcAPOnZ8dScvqQAMevLo3L/r0eBVyPc3vJKcChotipLWsdb+SK0DJnhcpcrya 2arr7UWsidbRTfRqRfo+ST7T8S8lhnUUrCsRfim4IaVCea6uthuFRQ+VfOt91uvaWLET S+WoZMMRumM2s+SXN0CtRQ0DaaLeVaL1xAlqk//Ehk0JGt+s/apde71Yyxn+LlQzG3EI l7Gl3Nq+LqrvWyMMWIpmqmMD6mc7Se5+2DKzMxbW1oIUlBQQ7HR4OhYXnmVTtlyGSu3l VVntif/SEzwMbtKQvmKwZRmlVnD8E0nxFv+nnjm6evNGUu/XvSfq8BmLQTe75+jzki0T RrDg== 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=DEpxzpWn5O7EhbyBDa1Hq6en5CZQ/lUCpQVWVQgf/q4=; b=k9NA1/PIQba1f5ZpmJWtpp/pgSrvzww9TKGIg6zLOSKMRY9P8R5iJqEwy1DuUImY00 QBP3q74b1lcN851AseyxtMC3MYdMqqly9LwZK2O7wlRFclkXpymgiCnV6gyR1aGp2OP/ WHFgY5VHwvaXomeyrwnG1uYWMnz5BSAuq9FES0fHsSioE9K5eyiFuWfkXOV1PuEy3MmT sXOVRnSAEVWrXdokVwuau/HVNQOFC/9Hr+BLt1WHm5IjwdOJhVNh3lHjcoRYnNCm0+ax sqdPVcJt8uBrk9KuaRc4wuXRplt7HvuLc19qSlrek07WDJuW7YZ5mOz/hsClwE6Hc7zI J/Rw== 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 o128-v6si1473301pfg.5.2018.06.12.18.16.23; Tue, 12 Jun 2018 18:16:37 -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 S935043AbeFMBPm (ORCPT + 99 others); Tue, 12 Jun 2018 21:15:42 -0400 Received: from mslow2.mail.gandi.net ([217.70.178.242]:49040 "EHLO slow1-d.mail.gandi.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933125AbeFMBPl (ORCPT ); Tue, 12 Jun 2018 21:15:41 -0400 Received: from relay6-d.mail.gandi.net (unknown [217.70.183.198]) by slow1-d.mail.gandi.net (Postfix) with ESMTP id 057F53A313B for ; Wed, 13 Jun 2018 02:58:14 +0200 (CEST) X-Originating-IP: 70.80.172.8 Received: from localhost (modemcable008.172-80-70.mc.videotron.ca [70.80.172.8]) (Authenticated sender: hle@owl.eu.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id EE8C9C0003; Wed, 13 Jun 2018 00:58:13 +0000 (UTC) Date: Tue, 12 Jun 2018 20:58:07 -0400 From: Hugo Lefeuvre To: Dan Carpenter Cc: devel@driverdev.osuosl.org, Greg Kroah-Hartman , kernelnewbies@kernelnewbies.org, linux-kernel@vger.kernel.org, Valentin Vidic Subject: Re: [PATCH v2] staging: pi433: add mutex fixing concurrency issues. Message-ID: <20180613005807.GB2265@hle-laptop.local> References: <20180602175649.GA2816@hle-laptop.local> <20180607124216.GA2329@hle-laptop.local> <20180609081244.GP14048@gavran.carpriv.carnet.hr> <20180609154842.GB1826@hle-laptop.local> <20180612121107.xgxdqda5bzhqeizr@mwanda> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2B/JsCI69OhZNC5r" Content-Disposition: inline In-Reply-To: <20180612121107.xgxdqda5bzhqeizr@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 --2B/JsCI69OhZNC5r Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable > > case PI433_IOC_WR_TX_CFG: > > if (copy_from_user(&instance->tx_cfg, argp, > > sizeof(struct pi433_tx_cfg))) > > return -EFAULT; > > break; >=20 > Btw, it looks so wrong to me that we copy partial data to > &instance->tx_cfg... I'd really prefer copying it to a tmp buffer and > then verifying it's corrent then memcpy()ing it to &instance->tx_cfg. AFAIK this piece of code is not supposed to check passed tx config. These checks are realised later by rf69_set_tx_cfg (called by pi433_tx_thread) after the config has been written to the fifo by pi433_write. What kind of checks do you want to perform exactly ? But, right, I prefer the idea of the temporary buffer too, and seeing the rest of kernel code it seems to be the usual way to go. Regards, Hugo --=20 Hugo Lefeuvre (hle) | www.owl.eu.com 4096/ 9C4F C8BF A4B0 8FC5 48EB 56B8 1962 765B B9A8 BACA --2B/JsCI69OhZNC5r Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEE5LpPtQuYJzvmooL3LVy48vb3khkFAlsgbBkACgkQLVy48vb3 khm69Af+LdHLS+TMk1DD4IyFMv4UX1sRwEDnX9GRhSEMmg2xOg5SS48yGBQKPJ7y O79AWowM1bEkP+BfnTPPe+5+UgJ9+KXp1+ULtLlLMexRvD2TtvchR1gh0dw9B1Jm 3Rr/2CqQmwZEuMtW4o9tFqRjeCAb9BxLwGpAGNpwZypOb+Furvi9ou51qd9axBWQ jhelFp7Lx5C6AwHi0N8CYce5LbsaCd8j6Bt8uEfhmDoxEhYEsY9LX+aOjahu5AOK iyQwMbw/5qfHGD1ggzB5W+SY7Iamao+XXOncwc+gdZGz3qR5r9ttao/Y+ZsNhii0 Y76P1WGw9Ppkml44On59acliGWC30A== =1PGh -----END PGP SIGNATURE----- --2B/JsCI69OhZNC5r--