netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/12] net: assorted y2038 changes
@ 2015-09-30 11:26 Arnd Bergmann
  2015-09-30 11:26 ` [PATCH 08/12] nfnetlink: use y2038 safe timestamp Arnd Bergmann
       [not found] ` <1443612402-3000775-1-git-send-email-arnd-r2nGTMty4D4@public.gmane.org>
  0 siblings, 2 replies; 5+ messages in thread
From: Arnd Bergmann @ 2015-09-30 11:26 UTC (permalink / raw)
  To: netdev
  Cc: Arnd Bergmann, y2038, linux-api, linux-atm-general,
	linux-wireless, linux-kernel, linux-can, linux-sctp, coreteam,
	intel-wired-lan, netfilter-devel, David S. Miller

Hi everyone,

This is a set of changes for network drivers and core code to
get rid of the use of time_t and derived data structures.

I have a longer set of patches that enables me to build kernels
with the time_t definition removed completely as a help to find
y2038 overflow issues. This is the subset for networking that
contains all code that has a reasonable way of fixing at the
moment and that is either commonly used (in one of the defconfigs)
or that blocks building a whole subsystem.

Most of the patches in this series should be noncontroversial,
but the last two that I marked [RFC] are a bit tricky and
need input from people that are more familiar with the code than
I am. All 12 patches are independent of one another and can
be applied in any order, so feel free to pick all that look
good.

Patches that are not included here are:

 - disabling less common device drivers that I don't have a fix
   for yet, this includes
	drivers/net/ethernet/brocade/bna/bfa_ioc.c
	drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c
	drivers/net/ethernet/tile/tilegx.c
	drivers/net/hamradio/baycom_ser_fdx.c
	drivers/net/wireless/ath/ath10k/core.h
	drivers/net/wireless/ath/ath9k/
	drivers/net/wireless/ath/ath9k/
	drivers/net/wireless/atmel.c
	drivers/net/wireless/prism54/isl_38xx.c
	drivers/net/wireless/rt2x00/rt2x00debug.c
	drivers/net/wireless/rtlwifi/
	drivers/net/wireless/ti/wlcore/
	drivers/staging/ozwpan/
	net/atm/mpoa_caches.c
	net/atm/mpoa_proc.c
	net/dccp/probe.c
	net/ipv4/tcp_probe.c
	net/netfilter/nfnetlink_queue_core.c
	net/netfilter/nfnetlink_queue_core.c
	net/netfilter/xt_time.c
	net/openvswitch/flow.c
	net/sctp/probe.c
	net/sunrpc/auth_gss/
	net/sunrpc/svcauth_unix.c
	net/vmw_vsock/af_vsock.c
   We'll get there eventually, or we an add a dependency to ensure
   they are not built on 32-bit kernels that need to survive
   beyond 2038. Most of these should be really easy to fix.

 - recvmmsg/sendmmsg system calls: patches have been sent out
   as part of the syscall series, need a little more work and
   review

 - SIOCGSTAMP/SIOCGSTAMPNS/ ioctl calls: tricky, need to discuss
   with some folks at kernel summit

 - SO_RCVTIMEO/SO_SNDTIMEO/SO_TIMESTAMP/SO_TIMESTAMPNS socket
   opt: similar and related to the ioctl

 - mmapped packet socket: need to create v4 of the API, nontrivial

 - pktgen: sends 32-bit timestamps over network, need to find out
   if using unsigned stamps is good enough

 - af_rxpc: similar to pktgen, uses 32-bit times for deadlines

 - ppp ioctl: patch is being worked on, nontrivial but doable

	Arnd

Arnd Bergmann (12):
  net: fec: avoid timespec use
  net: stmmac: avoid using timespec
  net: igb: avoid using timespec
  mwifiex: use ktime_get_real for timestamping
  mwifiex: avoid gettimeofday in ba_threshold setting
  mac80211: use ktime_get_seconds
  atm: hide 'struct zatm_t_hist'
  nfnetlink: use y2038 safe timestamp
  ipv6: use ktime_t for internal timestamps
  net: sctp: avoid incorrect time_t use
  [RFC] ipv4: avoid timespec in timestamp computation
  [RFC] can: avoid using timeval for uapi

 drivers/net/ethernet/freescale/fec_ptp.c          |  6 ++--
 drivers/net/ethernet/intel/igb/igb.h              |  4 +--
 drivers/net/ethernet/intel/igb/igb_main.c         | 15 +++++-----
 drivers/net/ethernet/intel/igb/igb_ptp.c          |  8 +++---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c |  8 ++++--
 drivers/net/wireless/mwifiex/11n_aggr.c           |  4 +--
 drivers/net/wireless/mwifiex/wmm.c                | 15 +++-------
 include/linux/timekeeping.h                       |  2 ++
 include/uapi/linux/atm_zatm.h                     |  3 +-
 include/uapi/linux/can/bcm.h                      |  7 ++++-
 kernel/time/timekeeping.c                         | 34 +++++++++++++++++++++++
 net/can/bcm.c                                     | 15 ++++++----
 net/ipv4/icmp.c                                   |  8 ++----
 net/ipv4/ip_options.c                             |  9 ++----
 net/ipv6/mip6.c                                   | 16 +++++------
 net/mac80211/sta_info.c                           |  8 ++----
 net/netfilter/nfnetlink_log.c                     |  6 ++--
 net/sctp/sm_make_chunk.c                          |  2 +-
 net/sctp/sm_statefuns.c                           |  2 +-
 19 files changed, 99 insertions(+), 73 deletions(-)

Cc: coreteam@netfilter.org
Cc: intel-wired-lan@lists.osuosl.org
Cc: linux-api@vger.kernel.org
Cc: linux-atm-general@lists.sourceforge.net
Cc: linux-can@vger.kernel.org
Cc: linux-sctp@vger.kernel.org
Cc: linux-wireless@vger.kernel.org
Cc: netfilter-devel@vger.kernel.org


-- 
2.1.0.rc2

_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 08/12] nfnetlink: use y2038 safe timestamp
  2015-09-30 11:26 [PATCH 00/12] net: assorted y2038 changes Arnd Bergmann
@ 2015-09-30 11:26 ` Arnd Bergmann
  2015-10-02 12:53   ` Pablo Neira Ayuso
       [not found] ` <1443612402-3000775-1-git-send-email-arnd-r2nGTMty4D4@public.gmane.org>
  1 sibling, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2015-09-30 11:26 UTC (permalink / raw)
  To: netdev
  Cc: y2038, linux-kernel, David S. Miller, Arnd Bergmann,
	Pablo Neira Ayuso, Patrick McHardy, Jozsef Kadlecsik,
	netfilter-devel, coreteam

The __build_packet_message function fills a nfulnl_msg_packet_timestamp
structure that uses 64-bit seconds and is therefore y2038 safe, but
it uses an intermediate 'struct timespec' which is not.

This trivially changes the code to use 'struct timespec64' instead,
to correct the result on 32-bit architectures.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
Cc: netfilter-devel@vger.kernel.org
Cc: coreteam@netfilter.org
---
 net/netfilter/nfnetlink_log.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c
index 4670821b569d..cc2300f4e177 100644
--- a/net/netfilter/nfnetlink_log.c
+++ b/net/netfilter/nfnetlink_log.c
@@ -538,9 +538,9 @@ __build_packet_message(struct nfnl_log_net *log,
 
 	if (skb->tstamp.tv64) {
 		struct nfulnl_msg_packet_timestamp ts;
-		struct timeval tv = ktime_to_timeval(skb->tstamp);
-		ts.sec = cpu_to_be64(tv.tv_sec);
-		ts.usec = cpu_to_be64(tv.tv_usec);
+		struct timespec64 kts = ktime_to_timespec64(skb->tstamp);
+		ts.sec = cpu_to_be64(kts.tv_sec);
+		ts.usec = cpu_to_be64(kts.tv_nsec / NSEC_PER_USEC);
 
 		if (nla_put(inst->skb, NFULA_TIMESTAMP, sizeof(ts), &ts))
 			goto nla_put_failure;
-- 
2.1.0.rc2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 08/12] nfnetlink: use y2038 safe timestamp
  2015-09-30 11:26 ` [PATCH 08/12] nfnetlink: use y2038 safe timestamp Arnd Bergmann
@ 2015-10-02 12:53   ` Pablo Neira Ayuso
  2015-10-02 21:23     ` Arnd Bergmann
  0 siblings, 1 reply; 5+ messages in thread
From: Pablo Neira Ayuso @ 2015-10-02 12:53 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: netdev, y2038, linux-kernel, David S. Miller, Patrick McHardy,
	Jozsef Kadlecsik, netfilter-devel, coreteam

On Wed, Sep 30, 2015 at 01:26:38PM +0200, Arnd Bergmann wrote:
> The __build_packet_message function fills a nfulnl_msg_packet_timestamp
> structure that uses 64-bit seconds and is therefore y2038 safe, but
> it uses an intermediate 'struct timespec' which is not.
> 
> This trivially changes the code to use 'struct timespec64' instead,
> to correct the result on 32-bit architectures.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Cc: Pablo Neira Ayuso <pablo@netfilter.org>
> Cc: Patrick McHardy <kaber@trash.net>
> Cc: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
> Cc: netfilter-devel@vger.kernel.org
> Cc: coreteam@netfilter.org

Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>

BTW, I don't see the patch for nfnetlink_queue and I think I have seen
it in the diffstat from your cover letter.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 08/12] nfnetlink: use y2038 safe timestamp
  2015-10-02 12:53   ` Pablo Neira Ayuso
@ 2015-10-02 21:23     ` Arnd Bergmann
  0 siblings, 0 replies; 5+ messages in thread
From: Arnd Bergmann @ 2015-10-02 21:23 UTC (permalink / raw)
  To: Pablo Neira Ayuso
  Cc: y2038, netdev, linux-kernel, David S. Miller, coreteam,
	netfilter-devel, Jozsef Kadlecsik, Patrick McHardy

On Friday 02 October 2015 14:53:55 Pablo Neira Ayuso wrote:
> On Wed, Sep 30, 2015 at 01:26:38PM +0200, Arnd Bergmann wrote:
> > The __build_packet_message function fills a nfulnl_msg_packet_timestamp
> > structure that uses 64-bit seconds and is therefore y2038 safe, but
> > it uses an intermediate 'struct timespec' which is not.
> > 
> > This trivially changes the code to use 'struct timespec64' instead,
> > to correct the result on 32-bit architectures.
> >
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > Cc: Pablo Neira Ayuso <pablo@netfilter.org>
> > Cc: Patrick McHardy <kaber@trash.net>
> > Cc: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
> > Cc: netfilter-devel@vger.kernel.org
> > Cc: coreteam@netfilter.org
> 
> Acked-by: Pablo Neira Ayuso <pablo@netfilter.org>

Thanks

> BTW, I don't see the patch for nfnetlink_queue and I think I have seen
> it in the diffstat from your cover letter.

My text must have been unclear. What I meant is that I have identified
that file as needing a patch (among 120 other files) but have not
written one.

This one is trivial, it just needs replacing this code

        if (entskb->tstamp.tv64) {
                struct nfqnl_msg_packet_timestamp ts;
                struct timeval tv = ktime_to_timeval(entskb->tstamp);
                ts.sec = cpu_to_be64(tv.tv_sec);
                ts.usec = cpu_to_be64(tv.tv_usec);

                if (nla_put(skb, NFQA_TIMESTAMP, sizeof(ts), &ts))
                        goto nla_put_failure;
        }

with a version using ktime_to_timespec64. If you or someone else does
this, that makes one less file for me to track.

	Arnd
_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 00/12] net: assorted y2038 changes
       [not found] ` <1443612402-3000775-1-git-send-email-arnd-r2nGTMty4D4@public.gmane.org>
@ 2015-10-05 10:17   ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2015-10-05 10:17 UTC (permalink / raw)
  To: arnd-r2nGTMty4D4
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA, y2038-cunTk1MwBs8s++Sfvej+rw,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	coreteam-Cap9r6Oaw4JrovVCs/uTlw,
	intel-wired-lan-qjLDD68F18P21nG7glBr7A,
	linux-api-u79uwXL29TY76Z2rM5mHXA,
	linux-atm-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
	linux-can-u79uwXL29TY76Z2rM5mHXA,
	linux-sctp-u79uwXL29TY76Z2rM5mHXA,
	linux-wireless-u79uwXL29TY76Z2rM5mHXA,
	netfilter-devel-u79uwXL29TY76Z2rM5mHXA

From: Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>
Date: Wed, 30 Sep 2015 13:26:30 +0200

> This is a set of changes for network drivers and core code to
> get rid of the use of time_t and derived data structures.

Applied patches #1-#10 to net-next, using the updated v2 version of
the zatm change.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-10-05 10:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-30 11:26 [PATCH 00/12] net: assorted y2038 changes Arnd Bergmann
2015-09-30 11:26 ` [PATCH 08/12] nfnetlink: use y2038 safe timestamp Arnd Bergmann
2015-10-02 12:53   ` Pablo Neira Ayuso
2015-10-02 21:23     ` Arnd Bergmann
     [not found] ` <1443612402-3000775-1-git-send-email-arnd-r2nGTMty4D4@public.gmane.org>
2015-10-05 10:17   ` [PATCH 00/12] net: assorted y2038 changes David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).