Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6534509ybx; Mon, 11 Nov 2019 10:32:19 -0800 (PST) X-Google-Smtp-Source: APXvYqzsfOxMYYqrAvqGkS2Zl3AcMmEri35q5vVSCHvqalBLNBB5FeZOOBT2b0gi/3hTKjt3+W4r X-Received: by 2002:a17:906:1942:: with SMTP id b2mr24141869eje.36.1573497139014; Mon, 11 Nov 2019 10:32:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573497139; cv=none; d=google.com; s=arc-20160816; b=zwCyYaUTIkK28OeRZfJujZfLt0dQs8X1bQzEcs/0OGkpZeFPoNhKiVTyC1vbY+XpHY XwP2rrEgVuo1JmtpoFEZlieIVGxhjqB76n04dl3speSmi6WTBjFZqWVT2Lii8Ebrrosp QBdyllVbv352769nFppDEVg+q1lpEb8neuq3OjIyuClvNxDY2M2rf3PmP/Wh8yFjt2Fi 1PNGjrVSdf6rzOMRPUPqDhWuybl4IyP9SKMeKF0o/PGTHC9JRieAsrJsKaufJB7laSrn us6QI683nquGpd7k+gwuR/X9dYJk4ETbn4Wt1LD8REBwdH6jNqsfRsNALdjsbk+0pzXS PVdg== 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:dkim-signature; bh=RbCZSYiVTU101K0AA6gbWFKQ+nZynWbnU7jW8rMxKYg=; b=HY3UXrlq2tCGQx++8vZF76X4HrI6FqjWTnXZ0tjKy2avD5fEKwtJnEp23CTAHpjChV eYHkW+PaOpVdQV8jpY1XSZKvdn0WsvMPul9BQM0DK6m4i6L5fYwN0idG6WGgn1rduMh+ rNzSlI+YU/VtwfcHmQIMsdRZhQapDn+8ipXejg9ITABdVHFxYAtTnDG8t8lUKtZ5/ByN /jU+kISWsKSR+gUXIAVWIs8Hwsxco4nwpj3PBvxoUrT4RJQvxplInuQMz9+SMaf5nubc pReoupFMyB6rkaAAD4CReoT2XcsR02P13pDRsy6XNPXWKFAA+E8hBJoqRpDOsJPTAimw gZLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SRNx4uCN; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u3si13021188eda.271.2019.11.11.10.31.55; Mon, 11 Nov 2019 10:32:19 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SRNx4uCN; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726962AbfKKS2d (ORCPT + 99 others); Mon, 11 Nov 2019 13:28:33 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:33424 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726896AbfKKS2c (ORCPT ); Mon, 11 Nov 2019 13:28:32 -0500 Received: by mail-pg1-f195.google.com with SMTP id h27so9976571pgn.0; Mon, 11 Nov 2019 10:28:32 -0800 (PST) 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:user-agent; bh=RbCZSYiVTU101K0AA6gbWFKQ+nZynWbnU7jW8rMxKYg=; b=SRNx4uCNBMhfemthmSO/MfE8FdhBpN2WtxKpWHR9+pqp+iX2ymL7ktoZu6I63kKGtM b9YxNLLyJlJvhzmqbSOHokptSjB1VBLhEL0KFXsXy++WUMRAgYCqQvU87TA6IegVgLiF BARAnkjtYz0DVbvnyZmnUpCg4P7C9b6+YM3TFM90qgUo8J7tMjAUTKyKBWTUQG97KBep 62UbBPEKCS+PeF12cC8XgESL+cFtEAjDGfdCogeNEfYgKDme2P6gfkHnJJ6nBHeMDFBq qg0ax6E9lbMLh2RVEYaaS1vC1XkKmBCJm2jheviAQZqlyFAY/NoaqL+DdPWykBh9k+pi XLMA== 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:user-agent; bh=RbCZSYiVTU101K0AA6gbWFKQ+nZynWbnU7jW8rMxKYg=; b=GqU8kuRCEpESXDnBXQvzJPd7mNrjIPhFTm9/k/dhG/vp/AI6bCrHq/mvERvw0uO+KZ zk857lgWA0EElNi8EuRHM3ltoACEyc/mTn92MJZlRnT3ZSJmlmMblUjdzaqWt9kIynWn OYid7SofSa5ylgRsWfolpU+FXo6h3nSFRKNNwPZJAS99Z1sSI/YG6/emoLpeNreGzJPc uA80l4dhE93WSD1T0y2kSMGngnJRDrrP3RGbq+VzRvlc20i6ACQLr1+8EeUS7vA8HMKg /oMDioWJSJdugcw9xlCDiz7p511sVh8zb00eFoE+iywro/0qiNBn0ukLtT1SBpVjuJhP f20w== X-Gm-Message-State: APjAAAV3fplQo4hFWDVK7qWeRVt8Zm54BZqGTYAYj0F7O43rEpFave2y NaylUnuY/zrqfS4aRUStEY0= X-Received: by 2002:a63:134a:: with SMTP id 10mr30128602pgt.441.1573496910944; Mon, 11 Nov 2019 10:28:30 -0800 (PST) Received: from dtor-ws ([2620:15c:202:201:3adc:b08c:7acc:b325]) by smtp.gmail.com with ESMTPSA id 12sm144320pjm.11.2019.11.11.10.28.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 10:28:30 -0800 (PST) Date: Mon, 11 Nov 2019 10:28:28 -0800 From: Dmitry Torokhov To: Arnd Bergmann Cc: y2038@lists.linaro.org, linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org, "David S. Miller" , stable@vger.kernel.org, Deepa Dinamani , Thomas Gleixner , linux-input@vger.kernel.org Subject: Re: [PATCH 8/8] Input: input_event: fix struct padding on sparc64 Message-ID: <20191111182828.GC57214@dtor-ws> References: <20191108203435.112759-1-arnd@arndb.de> <20191108203435.112759-9-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191108203435.112759-9-arnd@arndb.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, On Fri, Nov 08, 2019 at 09:34:31PM +0100, Arnd Bergmann wrote: > Going through all uses of timeval, I noticed that we screwed up > input_event in the previous attempts to fix it: > > The time fields now match between kernel and user space, but > all following fields are in the wrong place. > > Add the required padding that is implied by the glibc timeval > definition to fix the layout, and add explicit initialization > to avoid leaking kernel stack data. > > Cc: sparclinux@vger.kernel.org > Cc: "David S. Miller" > Cc: stable@vger.kernel.org > Fixes: 141e5dcaa735 ("Input: input_event - fix the CONFIG_SPARC64 mixup") > Fixes: 2e746942ebac ("Input: input_event - provide override for sparc64") > Signed-off-by: Arnd Bergmann > --- > drivers/input/evdev.c | 3 +++ > drivers/input/misc/uinput.c | 3 +++ > include/uapi/linux/input.h | 1 + > 3 files changed, 7 insertions(+) > > diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c > index d7dd6fcf2db0..24a90793caf0 100644 > --- a/drivers/input/evdev.c > +++ b/drivers/input/evdev.c > @@ -228,6 +228,9 @@ static void __pass_event(struct evdev_client *client, > event->input_event_sec; > client->buffer[client->tail].input_event_usec = > event->input_event_usec; > +#ifdef CONFIG_SPARC64 > + client->buffer[client->tail].__pad = 0; > +#endif > client->buffer[client->tail].type = EV_SYN; > client->buffer[client->tail].code = SYN_DROPPED; > client->buffer[client->tail].value = 0; I do not like ifdefs here, do you think we could write: client->buffer[client->tail] = (struct input_event) { .input_event_sec = event->input_event_sec, .input_event_usec = event->input_event_usec, .type = EV_SYN, .code = SYN_DROPPED, }; to ensure all padded fields are initialized? This is not hot path as we do not expect queue to overfill too often. Thanks. -- Dmitry