From patchwork Mon Jun 12 10:45:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 106515 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2519956vqr; Mon, 12 Jun 2023 04:37:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7XQR7/o0aFynZGHGAexeVN+KLuxcBiW49xU3bZ3114yeEFnecESM+KkNEGvT4YoATTSMIZ X-Received: by 2002:a2e:b04e:0:b0:2b1:d19a:f190 with SMTP id d14-20020a2eb04e000000b002b1d19af190mr2383668ljl.49.1686569837239; Mon, 12 Jun 2023 04:37:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686569837; cv=none; d=google.com; s=arc-20160816; b=D4EWu2+74yfkL4Ao4SJXzBXqmoc7dJnmpeohv2TwU6FHqopWQOPQoo9bjQHsshtipd 2qRaxcy6Bxtluf4ocwm3U9mse5yF3GURUPDSVxittxB9EutYnDl09vTYSMfllxjEsKKL HopBrFWgtDdQtUY7HHoSQKEVY0S0MDG5TKTDcd/cc0HfGxDdrywYjCxrH/hdb7ZrpK4X 86vlaRgA4lVqBzR4emKJgXwngLdHosx8fed5AD96yMKHXGFFpqvFJiX7Pfzkl0LQ1I08 knsoDFDOFTaQziY9xKlFLPKHdQqAWKZmebWbmCJ7/WzSKzkyskEXcVatQvybf93nLZy/ 1suw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=WoPFaVrUyLtvDUYrmLRbP00rLsfd8L8iM4ueLeVPS5c=; b=dloDOwNisXA2RTKeZ+U7LuoIxQoOo25rOCbPEw3kI7v5joNtu94yu1FsX7JU+uZHja 02kIUSvqCV7lMRK7avOtccAnjBgx7H5lZlU+4w0FD8L7jd4h5TqI7lFFteXoxXqQex88 sNGw9afBD6I5K2/swmGSCbEsNZPmyxKMIaVOANdrt4nuR9NcVAkIBIzsHGS/H7SU0YFW UPxzCgtNFR+vL/RZw7w4CztXIRmh//+bsOZvevxUpmG7/jTrH9I2TPRtsXMqlyxkuFMq RcmRNleb4mN6J+gTu/8UzwIisGV8ISI69zY7Hed2FVfDn7bBn2BTJydzWVFoWo0tV8oq Y7WA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XNPqT5xC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o10-20020a17090611ca00b0096f560fb6absi1758581eja.822.2023.06.12.04.36.52; Mon, 12 Jun 2023 04:37:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XNPqT5xC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236989AbjFLK6P (ORCPT + 99 others); Mon, 12 Jun 2023 06:58:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236960AbjFLK5g (ORCPT ); Mon, 12 Jun 2023 06:57:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 26DB8E572; Mon, 12 Jun 2023 03:45:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A2DD162450; Mon, 12 Jun 2023 10:45:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AB4FC433D2; Mon, 12 Jun 2023 10:45:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686566735; bh=f+sv9c83YeZdEFyBLfaVXVS9uGARTf71K6hxZfrcSr4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XNPqT5xCR/WjIlqL84s4wlNFJCgGYAqKwg9zWLKMlluT43pgIvq6UYpc7QjKUhuWL nVIrZgjKf9Le2yKWvchiJV4LBbC0ljP1qKKTZdnKa3LICWwFNHz7sMCYSAO1yPGWJc ixIaxMQwn51TByDyIFIJ4whm3OajAgo0a8S2bf51eFvXRyczHtk84FQpWxkDHAGszp 9PgkQIWwHJTlHW8C02GLU7kZQHk3jA/g7J+XX7rjLsmWIk6SAhbZ3n7MsZXHbQi8fq 1BN620+hBAnd5L8CGYKibFXxe0Hxle4OVCsDLjX9mMgrdf+RzkMkt3m7jsKCrQeUGe l++bREhCo36qQ== From: Jeff Layton To: Christian Brauner , Al Viro , Brad Warrum , Ritu Agarwal , Arnd Bergmann , Greg Kroah-Hartman , Ian Kent , "Tigran A. Aivazian" , Jeremy Kerr , Ard Biesheuvel , Namjae Jeon , Sungjong Seo , Steve French , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , John Johansen , Paul Moore , James Morris , "Serge E. Hallyn" , Ruihan Li , Sebastian Reichel , Alan Stern , Suren Baghdasaryan , Wolfram Sang , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, autofs@vger.kernel.org, linux-efi@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, apparmor@lists.ubuntu.com, linux-security-module@vger.kernel.org Subject: [PATCH v2 2/8] usb: update the ctime as well when updating mtime after an ioctl Date: Mon, 12 Jun 2023 06:45:18 -0400 Message-Id: <20230612104524.17058-3-jlayton@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230612104524.17058-1-jlayton@kernel.org> References: <20230612104524.17058-1-jlayton@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768496653507923392?= X-GMAIL-MSGID: =?utf-8?q?1768496653507923392?= In general, POSIX requires that when the mtime is updated that the ctime be updated as well. Add the missing timestamp updates to the usb ioctls. Signed-off-by: Jeff Layton --- drivers/usb/core/devio.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index fcf68818e999..1268d313a8df 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -2640,21 +2640,21 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, snoop(&dev->dev, "%s: CONTROL\n", __func__); ret = proc_control(ps, p); if (ret >= 0) - inode->i_mtime = current_time(inode); + inode->i_mtime = inode->i_ctime = current_time(inode); break; case USBDEVFS_BULK: snoop(&dev->dev, "%s: BULK\n", __func__); ret = proc_bulk(ps, p); if (ret >= 0) - inode->i_mtime = current_time(inode); + inode->i_mtime = inode->i_ctime = current_time(inode); break; case USBDEVFS_RESETEP: snoop(&dev->dev, "%s: RESETEP\n", __func__); ret = proc_resetep(ps, p); if (ret >= 0) - inode->i_mtime = current_time(inode); + inode->i_mtime = inode->i_ctime = current_time(inode); break; case USBDEVFS_RESET: @@ -2666,7 +2666,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, snoop(&dev->dev, "%s: CLEAR_HALT\n", __func__); ret = proc_clearhalt(ps, p); if (ret >= 0) - inode->i_mtime = current_time(inode); + inode->i_mtime = inode->i_ctime = current_time(inode); break; case USBDEVFS_GETDRIVER: @@ -2693,7 +2693,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, snoop(&dev->dev, "%s: SUBMITURB\n", __func__); ret = proc_submiturb(ps, p); if (ret >= 0) - inode->i_mtime = current_time(inode); + inode->i_mtime = inode->i_ctime = current_time(inode); break; #ifdef CONFIG_COMPAT @@ -2701,14 +2701,14 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, snoop(&dev->dev, "%s: CONTROL32\n", __func__); ret = proc_control_compat(ps, p); if (ret >= 0) - inode->i_mtime = current_time(inode); + inode->i_mtime = inode->i_ctime = current_time(inode); break; case USBDEVFS_BULK32: snoop(&dev->dev, "%s: BULK32\n", __func__); ret = proc_bulk_compat(ps, p); if (ret >= 0) - inode->i_mtime = current_time(inode); + inode->i_mtime = inode->i_ctime = current_time(inode); break; case USBDEVFS_DISCSIGNAL32: @@ -2720,7 +2720,7 @@ static long usbdev_do_ioctl(struct file *file, unsigned int cmd, snoop(&dev->dev, "%s: SUBMITURB32\n", __func__); ret = proc_submiturb_compat(ps, p); if (ret >= 0) - inode->i_mtime = current_time(inode); + inode->i_mtime = inode->i_ctime = current_time(inode); break; case USBDEVFS_IOCTL32: