From patchwork Wed Feb 13 03:26:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 1040936 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="N+aSTXHu"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43zlLg6C8fz9s4Z for ; Wed, 13 Feb 2019 14:26:51 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387612AbfBMD0m (ORCPT ); Tue, 12 Feb 2019 22:26:42 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:44876 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727346AbfBMD0l (ORCPT ); Tue, 12 Feb 2019 22:26:41 -0500 Received: by mail-pl1-f194.google.com with SMTP id p4so475010plq.11; Tue, 12 Feb 2019 19:26:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Olw5XYEppRL5ksytIUvVQFmfyFQWZaUD9SuW/h8fORY=; b=N+aSTXHudrGfXNMdE8LElXLtuY5wzCoIRJXD3GMRQIAjy7q8KlZQcJslzP7Qn5P8Rs n2jpGb2vp5BRiR4A+g1p9p9YsjD8e2YITwPwd4dR+zpvojD4fRoZV0187Qui1KWL9kH9 OIuwF4G4ZrPI5kCY0+INKGXF2FbtwG/CP5pDuIwIipMDXngrrpClxBCr+8tW3tdOrNzc AMd8Fh54CU/VUJhLhc/uj0UO44A1nrrwKxjNm8q8zm89LmqUdiniC0DnPacQt3eGYXRo EeytqB61cVNb+UNbiq7csL11Ez6+LzUjAX8vymXNCnrOD8upNFYJKZ3HUabHuqomQCNN CXvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Olw5XYEppRL5ksytIUvVQFmfyFQWZaUD9SuW/h8fORY=; b=mSieL5ShHkRJrExeDaVTkZPElgXddPBs2R32LtjaNlillVjGJteiErT7ayEPFPd6uj 1gTq281lNR1YnLBM7qw19RtaQg95wAYU5JiY6GWHlXkbHhY0M2T7sn7aYWJaZzh+brlO xqkSZpFN4e/iaPwelpnAZRq7tS9OG7jqqqq5FzYEQw60olEw+cTILflw7p/23mKw8pxw nbR5vXVgTWM7Yk3bLvFYujhGUvxJC8pzX7rUTLlEhd077vCr6MtYFktBhIcMpzcdeeYp rRyyJiwG2nReiFuDRStnNah9qxQpFzocqA3pgoBemxjMkdtD5KQaz2tVV3JR3iIlINSZ HDXg== X-Gm-Message-State: AHQUAuaA+Upin8B4yfQYjcWATn9177QrS4/f1joBHmSDPlyiLAdZGKPS ciVRikHzWPsVEkEspRc/Uu8= X-Google-Smtp-Source: AHgI3IZIfGOteOT6qK5T+PlN1VjApF9XLlLmdpdHX17x7y6RjZa9sMEvgKf4lnCruj+oXHVlctQ9/Q== X-Received: by 2002:a17:902:6686:: with SMTP id e6mr7459414plk.208.1550028400633; Tue, 12 Feb 2019 19:26:40 -0800 (PST) Received: from deepa-ubuntu.lan (c-98-234-52-230.hsd1.ca.comcast.net. [98.234.52.230]) by smtp.gmail.com with ESMTPSA id q7sm17337396pgp.40.2019.02.12.19.26.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 19:26:40 -0800 (PST) From: Deepa Dinamani To: davem@davemloft.net, linux-kernel@vger.kernel.org Cc: netdev@vger.kernel.org, willemb@google.com, tglx@linutronix.de, arnd@arndb.de, y2038@lists.linaro.org Subject: [PATCH net-next 1/2] time: Add time_types.h Date: Tue, 12 Feb 2019 19:26:03 -0800 Message-Id: <20190213032604.2655-2-deepa.kernel@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190213032604.2655-1-deepa.kernel@gmail.com> References: <20190213032604.2655-1-deepa.kernel@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org sys/time.h is the mandated include for many time related defines. However, linux/time.h overlaps sys/time.h significantly and this makes including both from userspace or one from the other impossible. This also means that userspace can get away with including sys/time.h whenever it needs linux/time.h and this is what's been happening in the user world usually. But, we have new data types that we plan to use in the uapi time interfaces also defined in the linux/time.h. But, we are unable to use these types when sys/time.h is included. Hence, move the new types to a new header, time_types.h. We intend to eventually have all the uapi defines that the kernel uses defined in this header. Note that the plan is to replace uapi interfaces with timeval to use __kernel_old_timeval, timespec to use __kernel_old_timespec etc. Reported-by: Ran Rozenstein Fixes: 9718475e6908 ("socket: Add SO_TIMESTAMPING_NEW") Signed-off-by: Deepa Dinamani --- include/uapi/linux/time.h | 36 +---------------------------- include/uapi/linux/time_types.h | 40 +++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 35 deletions(-) create mode 100644 include/uapi/linux/time_types.h diff --git a/include/uapi/linux/time.h b/include/uapi/linux/time.h index b8ad1b86b942..958932effc5e 100644 --- a/include/uapi/linux/time.h +++ b/include/uapi/linux/time.h @@ -3,7 +3,7 @@ #define _UAPI_LINUX_TIME_H #include - +#include #ifndef _STRUCT_TIMESPEC #define _STRUCT_TIMESPEC @@ -23,7 +23,6 @@ struct timezone { int tz_dsttime; /* type of dst correction */ }; - /* * Names of the interval timers, and structure * defining a timer setting: @@ -42,39 +41,6 @@ struct itimerval { struct timeval it_value; /* current value */ }; -#ifndef __kernel_timespec -struct __kernel_timespec { - __kernel_time64_t tv_sec; /* seconds */ - long long tv_nsec; /* nanoseconds */ -}; -#endif - -#ifndef __kernel_itimerspec -struct __kernel_itimerspec { - struct __kernel_timespec it_interval; /* timer period */ - struct __kernel_timespec it_value; /* timer expiration */ -}; -#endif - -/* - * legacy timeval structure, only embedded in structures that - * traditionally used 'timeval' to pass time intervals (not absolute - * times). Do not add new users. If user space fails to compile - * here, this is probably because it is not y2038 safe and needs to - * be changed to use another interface. - */ -#ifndef __kernel_old_timeval -struct __kernel_old_timeval { - __kernel_long_t tv_sec; - __kernel_long_t tv_usec; -}; -#endif - -struct __kernel_sock_timeval { - __s64 tv_sec; - __s64 tv_usec; -}; - /* * The IDs of the various system clocks (for POSIX.1b interval timers): */ diff --git a/include/uapi/linux/time_types.h b/include/uapi/linux/time_types.h new file mode 100644 index 000000000000..4a51ca37305b --- /dev/null +++ b/include/uapi/linux/time_types.h @@ -0,0 +1,40 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef _UAPI_LINUX_TIME_TYPES_H +#define _UAPI_LINUX_TIME_TYPES_H + +#include + +#ifndef __kernel_timespec +struct __kernel_timespec { + __kernel_time64_t tv_sec; /* seconds */ + long long tv_nsec; /* nanoseconds */ +}; +#endif + +#ifndef __kernel_itimerspec +struct __kernel_itimerspec { + struct __kernel_timespec it_interval; /* timer period */ + struct __kernel_timespec it_value; /* timer expiration */ +}; +#endif + +/* + * legacy timeval structure, only embedded in structures that + * traditionally used 'timeval' to pass time intervals (not absolute + * times). Do not add new users. If user space fails to compile + * here, this is probably because it is not y2038 safe and needs to + * be changed to use another interface. + */ +#ifndef __kernel_old_timeval +struct __kernel_old_timeval { + __kernel_long_t tv_sec; + __kernel_long_t tv_usec; +}; +#endif + +struct __kernel_sock_timeval { + __s64 tv_sec; + __s64 tv_usec; +}; + +#endif /* _UAPI_LINUX_TIME_TYPES_H */ From patchwork Wed Feb 13 03:26:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 1040935 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hfUJBKrk"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 43zlLc3hGbz9s7T for ; Wed, 13 Feb 2019 14:26:48 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387727AbfBMD0p (ORCPT ); Tue, 12 Feb 2019 22:26:45 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:34139 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727346AbfBMD0o (ORCPT ); Tue, 12 Feb 2019 22:26:44 -0500 Received: by mail-pf1-f195.google.com with SMTP id j18so492046pfe.1; Tue, 12 Feb 2019 19:26:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TvEUuB2TrS9TqI/lJYeV+4qO4xUS0hrOrQzEkqlGCM0=; b=hfUJBKrkDYm9r2hxxmqXZxSksj5NdGAlTmuXql39gt/dS/UEmkZy1Cx5OyjWldRGqt tOXwgmFlwT4Tk1F7d31ozFBuQZs8pxBiSsdHm3V9Io3oziI5Mwp9ToTwuwwFlQGOzm4s uvHhApgwbwzut8XroOmf4nIm5KJYmPT47u7DmAkFEiwo8VBPZdjznhCva/Zcq1fOQCLZ YALelzXtI5kXE0uw26zsIl7NUx6+4xhG9w5DH5HwtaNfC8FmVeiF9ak6S78/1i7xcVOY D8FeWvPAhoIasFryu3wJlwQ9hIPZwZ32198QWbaRiW2ycScoqI8kP7gZaEfccMlHGYlb 96ew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TvEUuB2TrS9TqI/lJYeV+4qO4xUS0hrOrQzEkqlGCM0=; b=mZFCoWq/cZTS3Ym8wFNUnDyPJocV6YHiXAaqQL7G52A5vEVOKAfjD2Lv2pSETB4fnC PaZLAysYFeCFFQSZOo9h+u9+gYdcjc6xqFnwqpNhz9jXOT76KnY0J7/r7KnchP70JwK6 hwza5OdKPnEY2tTplFzznxYdx9cjS8Cbs5BdU1wmXbohztps4ePW6/XcDCERaDv+xu2y sgTOiftuPkj6mMlB77C868DxA3Xvo8tYwD/MfV9nugLvtUC1HZraMl44YZFJt0KDj1o7 Ardg1z7cbqI8WD8crYJDMsCrytQ5Ri7vkUubRCIPgSKhvlQjSA7pFSazQMnB4w85fzDF ts5w== X-Gm-Message-State: AHQUAuZLAgZAft4OAVBXsrj5XZQxHEAQgL3RMxUCVIJoGFb4U0wXAQGV ZsBOrVSuzI77WNAzMSaqo/U= X-Google-Smtp-Source: AHgI3IZ0Km2GhXlzbuZg8TWRoVJFNtWDkXa5UolrlVmn6qisAZKajqsDZsq3YdG9xT5k1/5PVYhItw== X-Received: by 2002:a65:5cc4:: with SMTP id b4mr6541230pgt.365.1550028403659; Tue, 12 Feb 2019 19:26:43 -0800 (PST) Received: from deepa-ubuntu.lan (c-98-234-52-230.hsd1.ca.comcast.net. [98.234.52.230]) by smtp.gmail.com with ESMTPSA id q7sm17337396pgp.40.2019.02.12.19.26.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Feb 2019 19:26:43 -0800 (PST) From: Deepa Dinamani To: davem@davemloft.net, linux-kernel@vger.kernel.org Cc: netdev@vger.kernel.org, willemb@google.com, tglx@linutronix.de, arnd@arndb.de, y2038@lists.linaro.org Subject: [PATCH net-next 2/2] errqueue.h: Include time_types.h Date: Tue, 12 Feb 2019 19:26:04 -0800 Message-Id: <20190213032604.2655-3-deepa.kernel@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190213032604.2655-1-deepa.kernel@gmail.com> References: <20190213032604.2655-1-deepa.kernel@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Now that we have a separate header for struct __kernel_timespec, include it directly without relying on userspace to do it. Reported-by: Ran Rozenstein Signed-off-by: Deepa Dinamani --- include/uapi/linux/errqueue.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/uapi/linux/errqueue.h b/include/uapi/linux/errqueue.h index d955b9e32288..28491dac074b 100644 --- a/include/uapi/linux/errqueue.h +++ b/include/uapi/linux/errqueue.h @@ -3,6 +3,7 @@ #define _UAPI_LINUX_ERRQUEUE_H #include +#include struct sock_extended_err { __u32 ee_errno;