Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp726333rwb; Thu, 1 Dec 2022 07:40:22 -0800 (PST) X-Google-Smtp-Source: AA0mqf4GK56Kw0dVDlGMcFT8C78/nznu+aftGb/jZ3CziRqv1K3vDYkr2eQhUE0TW3srgiwW+iQo X-Received: by 2002:a63:1055:0:b0:46e:f011:9548 with SMTP id 21-20020a631055000000b0046ef0119548mr40866820pgq.553.1669909222386; Thu, 01 Dec 2022 07:40:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669909222; cv=none; d=google.com; s=arc-20160816; b=at7ue3Z84ruYQJT1of55zpXehTsWEV6dnKOka4LZNhgOrqmx187cOsGtJi9bzRyZii ckqWkBJPh9DxdQOA6yTwXu1uqZIhsvcgaYpkdDR22DxLP3Ngw2T/LTgvRfcBpYIm5QSE /WyiUsKovWT+yv5bKsNzde+oUCLwtFNUpEzaEX8L5gsdOi7JtDD+YZGh/gkq/SlJ6HLs tpQ+B+8Go3oVApLQ0JNKqU0JAqF66uCaB7290lIAiU9feQAQ5/dbxSQJ8Xa/ZBPb5ULy 7/5zgZcKBCCkQkYJ5JHFBjRL7BgKM6EgeA84a92OEzt6VVZ509RIv3JrQJlmXe66nwhh UnAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=SrY7hzYfEOK2q/hdFn3ec4v1Q9N6ZIdTKpdo+YTUPKo=; b=gWJsScrH1IXlIE8Ta/D5vrJo0TCtQcFFzZxZ7a/3fz0sRIdYZsc0bHXRSIw+2Akj2c 0kZtjZENeNhscRjB57Vb27w+4vxJeqdq5S7PVZsINjeyTGP5eHdruzmSzsdGpUyPoiWM zoIZTiTZDT068EjAyYDr4GfrLr4JtIle+uFw+VEnMBSqX3eyxAk2zALfe227XKEUZg5K oe1mC5dtaCsoZj3nhvbrFqR0Oej3LkxR4yfIr/kftbty17/oMtRtySWLcaCeWefFrQVb hm3gLsqF3i7hZOOTnHnonI2PILg/bKTzh9X4VA4GrVdIHVuhXZuP6s4prIcB2jDX9gNK F5ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=RbknPhJB; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l135-20020a633e8d000000b0046ebb90e5bdsi4616831pga.337.2022.12.01.07.40.10; Thu, 01 Dec 2022 07:40:22 -0800 (PST) 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=@linutronix.de header.s=2020 header.b=RbknPhJB; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231376AbiLAPSa (ORCPT + 83 others); Thu, 1 Dec 2022 10:18:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230143AbiLAPS3 (ORCPT ); Thu, 1 Dec 2022 10:18:29 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD959A47E4 for ; Thu, 1 Dec 2022 07:18:28 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669907907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SrY7hzYfEOK2q/hdFn3ec4v1Q9N6ZIdTKpdo+YTUPKo=; b=RbknPhJBPVpMo1//GiCZjwdQyCkwD0stL5GKaoffCL8JRnSH5hht8sb0rsMvY0VeBd9Mld YIQ8vsB5XUfR6eViBeq9W+7+TfW6j5gN7Ry7WiOzl2bqxXLVIgtQBzTjpTuc2K4ExKc6wL C+bLyiGLoBmHf56QZWMjSZlha0aFPQu6mMCE7c0V6OOD31t+AHgI+MC/aNSviKQDkJCtKN f9EAysLK6DFEXt8inuXRRHui+7K5EQG1Z/eO+epyjy6sBuT3LiugmM9IaAtZJAB4PwJP16 QzauIN+7dJjgeGHLxTVvmS7a1ITTCOUlzxjdo1nSXIo6bv6GSuV8a3QCCcycug== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669907907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=SrY7hzYfEOK2q/hdFn3ec4v1Q9N6ZIdTKpdo+YTUPKo=; b=CQKEg9q1ssDtf5cTVF2u8o281141q5m9o2muF6ytphftb3OzXscPMnTD+XGbAIj6zycKXS uMxy06J1nsP4XBBQ== To: Jake Macneal Cc: linux-kernel@vger.kernel.org, John Stultz , Stephen Boyd , arnd@arndb.de Subject: Re: [PATCH] time: copy tai value (International Atomic Time, in seconds) to output __user struct in get_old_timex32(). In-Reply-To: References: <20221121055345.111567-1-jake.macneal@gmail.com> <877czbs0al.ffs@tglx> Date: Thu, 01 Dec 2022 16:18:26 +0100 Message-ID: <87y1rrqhj1.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS 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 Jake, On Thu, Dec 01 2022 at 10:00, Jake Macneal wrote: >>> This is despite all other fields of the corresponding __kernel_timex >>> struct being copied to the old_timex32 __user struct in this function. > >> This is completely backwards. get_old_timex32() copies from the user >> supplied old_timex32 struct to the __kernel_timex struct, no? > > You're totally right, I managed to mix up the order right off the bat. > >> I'm not against this change per se, but the justification for it really >> boils down to: > >> Make it consistent with the regular syscall > > I agree, that's a better summary. There isn't any effect in the kernel > now due to get_old_timex32() ignoring the tai value from userspace. So > this patch would be purely aesthetic, although one might argue that > copying the userspace tai value into txc is also less likely to lead > to a bug in the future, were any of the functions do_adjtimex(), > __do_adjtimex(), or process_adjtimex_modes() to be changed in a way so > that the userspace tai value became used (I realize this is unlikely). Right. Unlikely or not, consistency is always a good thing. > I apologize for any confusion I caused. No problem. Been there, done that :) Thanks, tglx