Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4297036pxj; Mon, 21 Jun 2021 19:08:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynlCIEM5zFQlFiwNuE4ThTJWSfZ7HNPE6ul6pgRfOX5O4bs1xZ7+N+kmF3Sko1miVLPRwG X-Received: by 2002:a5d:9916:: with SMTP id x22mr842929iol.160.1624327716682; Mon, 21 Jun 2021 19:08:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624327716; cv=none; d=google.com; s=arc-20160816; b=zdEOUBw0tmnOmXVr3rh4Fy1Xi2xkkCIIYZcpCS4Mki+BKbXCs8Fd2ch8VUDNofsiQI hMZWYa+gir95BuCR0Q+IBdJ/0+jtfqMCsZxptwu1JJqbNrjh3zwStUnf0XFQxskPEIf0 j71EeMpAPiek1vLQEsyQrDbUjvb8j5M+75XVCoawZnLk7o/ddfhsfSLnpNY0H1fjHc4K 4IPVtDRCuVuHKL0zeuj3d0TzYn32rB1ytw7xJnVdUzAET3B1/wyVdS0UgBzBSYghBv5E dz4JtGw4AbzFbe2g/Y/ob7tdvie1Gfx2Y2IAErK4Rwu3wQ99gujUJw+aJyT2J/15zcyx fmjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=+eNaqCSw1GzSakghPgObAofSfAD7TV7alaYIjcbBA2A=; b=x7JskJmeyaXa9zeT8gOHqQWgJOBPjNHYdvqQ2XsUlfT7190NgAbs77hBKLy6/Vjyyc QNT7lAAWciHLSWK8cWYFXIGvdszgPlkss8k7ikMvBJkbkpdCpJ3Y7KqrN1n5OYKBQ1hR NuG7lC9cib5jyJo0E3JiL7aOyqUjCjVmnMkIRPjtmTV1qcVH6H/Gtb+UlXtVaJ8Hxtmg yNnI6AJSaikA/iR8QccCplpzl/28BCEVRGc4YtmqCSWx+keXNsibnWyKnlzQN1HCLPoc VC+YwTb+WNrAFRGd7/1sXdeoamOuXBIzuMC1R5exV/k/KNP9uhVKm/ylki/lBv2Y8f0k TY5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KxDCCUv7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u12si6688394iln.143.2021.06.21.19.08.24; Mon, 21 Jun 2021 19:08:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KxDCCUv7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230338AbhFVCJS (ORCPT + 99 others); Mon, 21 Jun 2021 22:09:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230006AbhFVCJR (ORCPT ); Mon, 21 Jun 2021 22:09:17 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59E45C061574; Mon, 21 Jun 2021 19:07:02 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id 21so230344pfp.3; Mon, 21 Jun 2021 19:07:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=+eNaqCSw1GzSakghPgObAofSfAD7TV7alaYIjcbBA2A=; b=KxDCCUv7Vj7vpHfKF27pYRTONtQTFyirFW2wO3NDnloHcIxMUL1P/jY+APL679aP4w tHWWoXymUFayTyjA5Hsyo8P8LUhaJugSA68VMfYOggVwKaDAKxW7iUbv+nGeG7GwPtYU e5AnOXcPPmHAXV6PuYvx+Gl7fO00EXk9KmhCs0NMYrbmmlqnYuxsiuvhnfj5KnW/ZTC3 JDpS6Aa7wQbaHZnAhNMg/Ff33RPT83K/SLyz8kGUnnWeiQSeiW9DeYSFpZmgl4sz4wFK A8Xhd1+aQ0tqOpROyHtXhN3lfiq4LvAu3r0s0w59qan/bKcCVcLMyF6073kDMy632Xo9 HClg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=+eNaqCSw1GzSakghPgObAofSfAD7TV7alaYIjcbBA2A=; b=ZlKlH+nOfOgsFAw683zhDIOVf+eIZtyh4mI8hZtrkcpCjuwV35Y8tnD9r+EMm52kYd VYpZ/Ljc8X26RSKmAnkK7aUZhUWonzhkaq9nhs1BWXOdaIDw5raIRtJ7DDw3wIh4PxmW pTgnKevPz4iEwapZwLgMMFdOmTeIspg+ZqY2cwbVbCXkWLX8DYSc5gzbFm0MDKUQzqim NZz3A2ILRHoZkCqubFTL1/Uo7ypgjD2ktkhzBRRpDxgEYIxXdcfSQvjEJeoXztTeJg5x q43MhoEeMIQLLvmQ2z/a2jPG4ZQK2w8KMcMEPS/uxQPITlzF7BaAU0l8pkz+dY4h9KZe w73w== X-Gm-Message-State: AOAM530ykOWY+yoXxHVHV/6pgtHZQFXUJ2Zg9WUc8mvPO8fgcHehDUIz 0pLzvjLf3RI44UIPipHQ99EP42+DYTb6JA== X-Received: by 2002:a63:1453:: with SMTP id 19mr1413031pgu.270.1624327621789; Mon, 21 Jun 2021 19:07:01 -0700 (PDT) Received: from sol (106-69-169-160.dyn.iinet.net.au. [106.69.169.160]) by smtp.gmail.com with ESMTPSA id b1sm425924pjk.51.2021.06.21.19.06.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Jun 2021 19:07:01 -0700 (PDT) Date: Tue, 22 Jun 2021 10:06:55 +0800 From: Kent Gibson To: Gabriel Knezek , bgolaszewski@baylibre.com Cc: linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linus.walleij@linaro.org, andy.shevchenko@gmail.com Subject: Re: [PATCH v3] gpiolib: cdev: zero padding during conversion to gpioline_info_changed Message-ID: <20210622020655.GA8794@sol> References: <1624314539-17396-1-git-send-email-gabeknez@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1624314539-17396-1-git-send-email-gabeknez@linux.microsoft.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 21, 2021 at 03:28:59PM -0700, Gabriel Knezek wrote: > When userspace requests a GPIO v1 line info changed event, > lineinfo_watch_read() populates and returns the gpioline_info_changed > structure. It contains 5 words of padding at the end which are not > initialized before being returned to userspace. > > Zero the structure in gpio_v2_line_info_change_to_v1() before populating > its contents. > > Fixes: aad955842d1c ("gpiolib: cdev: support GPIO_V2_GET_LINEINFO_IOCTL and > GPIO_V2_GET_LINEINFO_WATCH_IOCTL") > Signed-off-by: Gabriel Knezek > --- > Changes in v3: > - Include the Fixes tag referencing the code being fixed and properly > version the patch. > > Changes in v2: > - Update commit message and subject with suggestions about clarity. > - Patch series at https://www.spinics.net/lists/linux-gpio/msg62163.html > > v1: > - Initial patch > - Patch series at https://www.spinics.net/lists/linux-gpio/msg62084.html > > drivers/gpio/gpiolib-cdev.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c > index ee5903aac497..af68532835fe 100644 > --- a/drivers/gpio/gpiolib-cdev.c > +++ b/drivers/gpio/gpiolib-cdev.c > @@ -1865,6 +1865,7 @@ static void gpio_v2_line_info_changed_to_v1( > struct gpio_v2_line_info_changed *lic_v2, > struct gpioline_info_changed *lic_v1) > { > + memset(lic_v1, 0, sizeof(*lic_v1)); > gpio_v2_line_info_to_v1(&lic_v2->info, &lic_v1->info); > lic_v1->timestamp = lic_v2->timestamp_ns; > lic_v1->event_type = lic_v2->event_type; > -- > 2.25.1 > The joe.reviewer@hotmail.com in the git send-email example that I provided off list was just that - an example that you were supposed to replace with the actual reviewers :|. I wouldn't generally bother with the links to the previous patch versions, though it might be helpful given the rename and version issues of the previous patches in this case. If you are going to provide links, use reference style with all the links at the bottom of the mail. Other than that, the only problem I have is that the Fixes tag line shouldn't wrap - it is an exception to the rule. Bart, are you ok with fixing that on the way in - assuming there are no other objections? Cheers, Kent.