Netdev List
 help / color / mirror / Atom feed
* Re: [PATCH net-next v2] block/drbd: use nla_put_u64_64bit()
From: Eric Dumazet @ 2016-05-04 17:13 UTC (permalink / raw)
  To: David Miller
  Cc: nicolas.dichtel, netdev, philipp.reisner, drbd-dev, linux-kernel
In-Reply-To: <20160504.125057.1606520320212390037.davem@davemloft.net>

On Wed, 2016-05-04 at 12:50 -0400, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Wed, 04 May 2016 07:27:06 -0700
> 
> > kernel was fine, and most user land apps were fine as well.
> 
> Userland should really not have to deal with garbage like this.
> 
> And because it quietly works just fine on x86-64, nothing makes
> sure that applications will universally get this right anyways.
> 
> Better to align things properly and magically all of these issues
> simply disappear.

Sure, but in practice we end up consuming 16 bytes (instead of 12) per
u64 attribute, only on some arches. 33 % space overhead.

So maybe some dumps will abort on those arches, while on x86 the size of
skb might be below some magic limit.

I guess this is fine, we do not break ABI in any way.

^ permalink raw reply

* Re: [PATCH net-next 4/5] treewide: replace dev->trans_start update with helper
From: Antonio Quartulli @ 2016-05-04 17:20 UTC (permalink / raw)
  To: Florian Westphal
  Cc: netdev, user-mode-linux-devel, linux-xtensa, linux1394-devel,
	linux-rdma, MPT-FusionLinux.pdl, linux-scsi, linux-can,
	linux-parisc, linux-omap, linux-hams, linux-usb, linux-wireless,
	linux-s390, devel, b.a.t.m.a.n, linux-bluetooth
In-Reply-To: <1462285994-31983-1-git-send-email-fw@strlen.de>

[-- Attachment #1: Type: text/plain, Size: 1643 bytes --]

On Tue, May 03, 2016 at 04:33:13PM +0200, Florian Westphal wrote:
> Replace all trans_start updates with netif_trans_update helper.
> change was done via spatch:
> 
> struct net_device *d;
> @@
> - d->trans_start = jiffies
> + netif_trans_update(d)
> 
> Compile tested only.
> 
> Cc: user-mode-linux-devel@lists.sourceforge.net
> Cc: linux-xtensa@linux-xtensa.org
> Cc: linux1394-devel@lists.sourceforge.net
> Cc: linux-rdma@vger.kernel.org
> Cc: netdev@vger.kernel.org
> Cc: MPT-FusionLinux.pdl@broadcom.com
> Cc: linux-scsi@vger.kernel.org
> Cc: linux-can@vger.kernel.org
> Cc: linux-parisc@vger.kernel.org
> Cc: linux-omap@vger.kernel.org
> Cc: linux-hams@vger.kernel.org
> Cc: linux-usb@vger.kernel.org
> Cc: linux-wireless@vger.kernel.org
> Cc: linux-s390@vger.kernel.org
> Cc: devel@driverdev.osuosl.org
> Cc: b.a.t.m.a.n@lists.open-mesh.org
> Cc: linux-bluetooth@vger.kernel.org
> Signed-off-by: Florian Westphal <fw@strlen.de>
> ---

[...]

>  net/batman-adv/soft-interface.c                        | 2 +-

[...]

> diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
> index 0710379..bae1397 100644
> --- a/net/batman-adv/soft-interface.c
> +++ b/net/batman-adv/soft-interface.c
> @@ -208,7 +208,7 @@ static int batadv_interface_tx(struct sk_buff *skb,
>  	if (atomic_read(&bat_priv->mesh_state) != BATADV_MESH_ACTIVE)
>  		goto dropped;
>  
> -	soft_iface->trans_start = jiffies;
> +	netif_trans_update(soft_iface);
>  	vid = batadv_get_vid(skb, 0);
>  	ethhdr = eth_hdr(skb);
>  


Acked-by: Antonio Quartulli <a@unstable.cc>

-- 
Antonio Quartulli

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* Re: [PATCH] tcp: ensure non-empty connection request queue
From: Rick Jones @ 2016-05-04 17:24 UTC (permalink / raw)
  To: Eric Dumazet, Peter Wu; +Cc: David S . Miller, netdev, Eric Dumazet, Kui Zhang
In-Reply-To: <1462321544.5535.337.camel@edumazet-glaptop3.roam.corp.google.com>

On 05/03/2016 05:25 PM, Eric Dumazet wrote:
> On Tue, 2016-05-03 at 23:54 +0200, Peter Wu wrote:
>> When applications use listen() with a backlog of 0, the kernel would
>> set the maximum connection request queue to zero. This causes false
>> reports of SYN flooding (if tcp_syncookies is enabled) or packet drops
>> otherwise.
>>

> Well, I believe I already gave my opinion on this.
>
> listen backlog is not a hint. This is a limit.
>
> It is the limit of outstanding children in accept queue.
>
> If backlog is 0, no child can be put in the accept queue.
>
> It is therefore Working As Intented.

Dropping the connection attempt makes sense, but is entering/claiming 
synflood really indicated in the case of a zero-length accept queue?

rick

^ permalink raw reply

* Re: [net-next PATCH v3 0/8] Fix Tunnel features and enable GSO partial for several drivers
From: David Miller @ 2016-05-04 17:32 UTC (permalink / raw)
  To: aduyck; +Cc: talal, netdev, michael.chan, alexander.duyck, galp, ogerlitz,
	eranbe
In-Reply-To: <20160502162828.11809.92444.stgit@ahduyck-xeon-server>

From: Alexander Duyck <aduyck@mirantis.com>
Date: Mon, 02 May 2016 09:38:06 -0700

> This patch series is meant to allow us to get the best performance possible
> for Mellanox ConnectX-3/4 and Broadcom NetXtreme-C/E adapters in terms of
> VXLAN and GRE tunnels.

Series applied, thanks Alex.

^ permalink raw reply

* Re: [PATCH] tcp: ensure non-empty connection request queue
From: Eric Dumazet @ 2016-05-04 17:34 UTC (permalink / raw)
  To: Rick Jones; +Cc: Peter Wu, David S . Miller, netdev, Eric Dumazet, Kui Zhang
In-Reply-To: <572A3048.60802@hpe.com>

On Wed, 2016-05-04 at 10:24 -0700, Rick Jones wrote:

> Dropping the connection attempt makes sense, but is entering/claiming 
> synflood really indicated in the case of a zero-length accept queue?

This is a one time message.

This is how people can learn about their user space bugs, or too small
backlog ;)

Being totally silent would be not so nice.

^ permalink raw reply

* Re: [v9, 6/7] MAINTAINERS: add entry for Freescale SoC driver
From: Scott Wood @ 2016-05-04 17:35 UTC (permalink / raw)
  To: Yangbo Lu, linux-mmc, linuxppc-dev, devicetree, linux-arm-kernel,
	linux-kernel, linux-clk, linux-i2c, iommu, netdev
  Cc: ulf.hansson, Mark Rutland, Rob Herring, Russell King,
	Jochen Friedrich, Joerg Roedel, Claudiu Manoil, Bhupesh Sharma,
	Qiang Zhao, Kumar Gala, Santosh Shilimkar, leoyang.li, xiaobo.xie
In-Reply-To: <1462332274-13744-7-git-send-email-yangbo.lu@nxp.com>

On Wed, 2016-05-04 at 11:24 +0800, Yangbo Lu wrote:
> Add maintainer entry for Freescale SoC driver including
> the QE library and the GUTS driver now. Also add maintainer
> for QE library.
> 
> Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
> ---
> Changes for v8:
> 	- Added this patch
> Changes for v9:
> 	- Added linux-arm mail list
> 	- Removed GUTS driver entry
> ---
>  MAINTAINERS | 11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 42e65d1..ce91db7 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -4622,9 +4622,18 @@ F:	drivers/net/ethernet/freescale/fec_ptp.c
>  F:	drivers/net/ethernet/freescale/fec.h
>  F:	Documentation/devicetree/bindings/net/fsl-fec.txt
>  
> +FREESCALE SOC DRIVER
> +M:	Scott Wood <oss@buserror.net>
> +L:	linuxppc-dev@lists.ozlabs.org
> +L:	linux-arm-kernel@lists.infradead.org
> +S:	Maintained
> +F:	drivers/soc/fsl/
> +F:	include/linux/fsl/
> +
>  FREESCALE QUICC ENGINE LIBRARY
> +M:	Qiang Zhao <qiang.zhao@nxp.com>
>  L:	linuxppc-dev@lists.ozlabs.org
> -S:	Orphan
> +S:	Maintained
>  F:	drivers/soc/fsl/qe/
>  F:	include/soc/fsl/*qe*.h
>  F:	include/soc/fsl/*ucc*.h

s/DRIVER/DRIVERS/

There's more than one.

Otherwise:
Acked-by: Scott Wood <oss@buserror.net>

-Scott

> 

^ permalink raw reply

* [PATCH] netdev: enc28j60 kernel panic fix.
From: David Russell @ 2016-05-04 17:51 UTC (permalink / raw)
  To: netdev

When connected directly to another system (not via a switch)
eventually a condition where a NULL pointer dereference occurs in
enc28j60_hw_tx() and this patch simply checks for that condition and
returns gracefully without causing a kernel panic.  I believe, but
have not investigated this is caused by a packet collision and am not
sure if the kernel tracks collisions or counts them as errors, so that
should probably be added if this is what's happening.  I'm also not
familiar with the linux kernel, so may have fixed this in a less than
ideal way.

Developer's Certificate of Origin 1.1

        By making a contribution to this project, I certify that:

        (d) I understand and agree that this project and the contribution
            are public and that a record of the contribution (including all
            personal information I submit with it, including my sign-off) is
            maintained indefinitely and may be redistributed consistent with
            this project or the open source license(s) involved.

Signed-off-by: David Russell <david@aprsworld.com>

---
diff --git a/drivers/net/ethernet/microchip/enc28j60.c
b/drivers/net/ethernet/microchip/enc28j60.c
index 86ea17e..36ac65f 100644
--- a/drivers/net/ethernet/microchip/enc28j60.c
+++ b/drivers/net/ethernet/microchip/enc28j60.c
@@ -1233,6 +1233,9 @@ static void enc28j60_irq_work_handler(struct
work_struct *work)
  */
 static void enc28j60_hw_tx(struct enc28j60_net *priv)
 {
+       if (!priv->tx_skb)
+               return;
+
        if (netif_msg_tx_queued(priv))
                printk(KERN_DEBUG DRV_NAME
                        ": Tx Packet Len:%d\n", priv->tx_skb->len);

^ permalink raw reply related

* Re: [PATCH] drivers: net: emac: add Atheros AR8035 phy initialization code
From: David Miller @ 2016-05-04 17:57 UTC (permalink / raw)
  To: chunkeey; +Cc: netdev
In-Reply-To: <1462277310-8949-1-git-send-email-chunkeey@googlemail.com>

From: Christian Lamparter <chunkeey@googlemail.com>
Date: Tue,  3 May 2016 14:08:30 +0200

> This patch adds the phy initialization code for Qualcomm
> Atheros AR8035 phy. This configuration is found in the
> Cisco Meraki MR24.
> 
> Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>

Applied to net-next, thanks.

^ permalink raw reply

* Re: [PATCH net-next 0/2] cxgb4: mbox enhancements for cxgb4
From: David Miller @ 2016-05-04 17:59 UTC (permalink / raw)
  To: hariprasad; +Cc: netdev, leedom, swise, nirranjan, santosh
In-Reply-To: <1462282082-6894-1-git-send-email-hariprasad@chelsio.com>

From: Hariprasad Shenai <hariprasad@chelsio.com>
Date: Tue,  3 May 2016 18:58:00 +0530

> This patch series checks for firmware errors when we are waiting for
> mbox response in a loop and breaks out. When negative timeout is passed
> to mailbox code, don't sleep. Negative timeout is passed only from
> interrupt context.
> 
> This patch series has been created against net-next tree and includes
> patches on cxgb4 driver.
> 
> We have included all the maintainers of respective drivers. Kindly review
> the change and let us know in case of any review comments.

Series applied, thanks.

^ permalink raw reply

* Re: [PATCH] drivers: net: xgene: Fix error handling
From: David Miller @ 2016-05-04 18:02 UTC (permalink / raw)
  To: mbrugger; +Cc: isubramanian, kchudgar, netdev, linux-kernel, linux-arm-kernel
In-Reply-To: <1462284307-15401-1-git-send-email-mbrugger@suse.com>

From: Matthias Brugger <mbrugger@suse.com>
Date: Tue,  3 May 2016 16:05:07 +0200

> When probe bails out with an error, we try to unregister the
> netdev before we have even registered it. Fix the goto statements
> for that.
> 
> Signed-off-by: Matthias Brugger <mbrugger@suse.com>

Applied.

^ permalink raw reply

* Re: [PATCH] tcp: ensure non-empty connection request queue
From: Rick Jones @ 2016-05-04 18:05 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: Peter Wu, David S . Miller, netdev, Eric Dumazet, Kui Zhang
In-Reply-To: <1462383266.5535.350.camel@edumazet-glaptop3.roam.corp.google.com>

On 05/04/2016 10:34 AM, Eric Dumazet wrote:
> On Wed, 2016-05-04 at 10:24 -0700, Rick Jones wrote:
>
>> Dropping the connection attempt makes sense, but is entering/claiming
>> synflood really indicated in the case of a zero-length accept queue?
>
> This is a one time message.
>
> This is how people can learn about their user space bugs, or too small
> backlog ;)
>
> Being totally silent would be not so nice.
>

Assuming Peter's assertion about just drops when syncookies are not 
enabled is accurate, should there be some one-time message in that case too?

rick

^ permalink raw reply

* Re: [PATCH] net: fec: only clear a queue's work bit if the queue was emptied
From: David Miller @ 2016-05-04 18:09 UTC (permalink / raw)
  To: u.kleine-koenig; +Cc: fugang.duan, kernel, netdev
In-Reply-To: <1462286333-23402-1-git-send-email-u.kleine-koenig@pengutronix.de>

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date: Tue,  3 May 2016 16:38:53 +0200

> In the receive path a queue's work bit was cleared unconditionally even
> if fec_enet_rx_queue only read out a part of the available packets from
> the hardware. This resulted in not reading any packets in the next napi
> turn and so packets were delayed or lost.
> 
> The obvious fix is to only clear a queue's bit when the queue was
> emptied.
> 
> Fixes: 4d494cdc92b3 ("net: fec: change data structure to support multiqueue")
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Applied and queued up for -stable, thanks.

^ permalink raw reply

* Re: [PATCH net-next 0/3] gre: receive also TEB packets for lwtunnels
From: David Miller @ 2016-05-04 18:11 UTC (permalink / raw)
  To: jbenc; +Cc: netdev, tgraf, pshelar, simon.horman
In-Reply-To: <cover.1462286214.git.jbenc@redhat.com>

From: Jiri Benc <jbenc@redhat.com>
Date: Tue,  3 May 2016 17:10:05 +0200

> NOTE: this patchset needs net merged to net-next.

Noted.

> This allows lwtunnel users to get also packets with ETH_P_TEB protocol
> specified in GRE header through an ipgre interface. There's really nothing
> special about these packets in the case of lwtunnels - it's just an inner
> protocol like any other. The only complications stem from keeping
> compatibility with other uses of GRE.
> 
> This will be used by openvswitch to support eth_push and eth_pop actions.
> I'd also like to see tc support for lwtunnels (this feature included) in the
> future.
> 
> The first patch is not directly related and can be submitted standalone if
> needed.

Series applied, thanks Jiri.

^ permalink raw reply

* Re: [PATCH] gre6: add Kconfig dependency for NET_IPGRE_DEMUX
From: David Miller @ 2016-05-04 18:12 UTC (permalink / raw)
  To: arnd
  Cc: kuznet, jmorris, yoshfuji, kaber, tom, hakke_007, pabeni, netdev,
	linux-kernel
In-Reply-To: <1462288817-721172-1-git-send-email-arnd@arndb.de>

From: Arnd Bergmann <arnd@arndb.de>
Date: Tue,  3 May 2016 17:19:57 +0200

> The ipv6 gre implementation was cleaned up to share more code
> with the ipv4 version, but it can be enabled even when NET_IPGRE_DEMUX
> is disabled, resulting in a link error:
> 
> net/built-in.o: In function `gre_rcv':
> :(.text+0x17f5d0): undefined reference to `gre_parse_header'
> ERROR: "gre_parse_header" [net/ipv6/ip6_gre.ko] undefined!
> 
> This adds a Kconfig dependency to prevent that now invalid
> configuration.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: 308edfdf1563 ("gre6: Cleanup GREv6 receive path, call common GRE functions")

Applied, thanks.

^ permalink raw reply

* Re: pull request [net]: batman-adv 20160430
From: David Miller @ 2016-05-04 18:13 UTC (permalink / raw)
  To: a
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r
In-Reply-To: <20160503.123330.1810855853724486551.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>

From: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Date: Tue, 03 May 2016 12:33:30 -0400 (EDT)

> From: Antonio Quartulli <a@unstable.cc>
> Date: Tue, 3 May 2016 22:42:29 +0800
> 
>> Do you have any plan on merging net into net-next in the following days ?
>> 
>> I am asking because I'd prefer to avoid you the hassle of dealing with the
>> conflicts.
> 
> I'll try to do this in the next few days.

Just FYI I did this last night.

^ permalink raw reply

* Re: [PATCH v2 net-next] dmfe: kill DEVICE define
From: David Miller @ 2016-05-04 18:13 UTC (permalink / raw)
  To: fw; +Cc: netdev
In-Reply-To: <1462294395-20440-1-git-send-email-fw@strlen.de>

From: Florian Westphal <fw@strlen.de>
Date: Tue,  3 May 2016 18:53:15 +0200

> use net_device directly. Compile tested, objdiff shows no changes.
> 
> Signed-off-by: Florian Westphal <fw@strlen.de>

Applied.

^ permalink raw reply

* Re: [PATCH net-next 0/5] net: remove trans_start from struct net_device
From: David Miller @ 2016-05-04 18:17 UTC (permalink / raw)
  To: fw; +Cc: netdev, linux-kernel
In-Reply-To: <1462285862-30946-1-git-send-email-fw@strlen.de>

From: Florian Westphal <fw@strlen.de>
Date: Tue,  3 May 2016 16:30:57 +0200

> We currently have two instances for trans_start, once in
> net_device and once in netdev_queue.
> 
> This series removes trans_start from net_device.
> Updates to dev->trans_start are replaced with updates to netdev queue 0.

Series applied, of course sans patch #1 which you resubmitted separately.

Thanks.

^ permalink raw reply

* Re: [PATCH] tcp: ensure non-empty connection request queue
From: Eric Dumazet @ 2016-05-04 18:18 UTC (permalink / raw)
  To: Rick Jones; +Cc: Peter Wu, David S . Miller, netdev, Eric Dumazet, Kui Zhang
In-Reply-To: <572A39E6.1020001@hpe.com>

On Wed, 2016-05-04 at 11:05 -0700, Rick Jones wrote:

> Assuming Peter's assertion about just drops when syncookies are not 
> enabled is accurate, should there be some one-time message in that case too?

We have plenty of drop points in the kernel without a message in syslog,
but proper SNMP counter updates.

Look at my recent commit 
9caad864151e525 ("tcp: increment sk_drops for listeners")

"ss -tm state listening" will show you the drop count per listener.

^ permalink raw reply

* Re: pull request [net]: batman-adv 20160430
From: Antonio Quartulli @ 2016-05-04 18:18 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, b.a.t.m.a.n
In-Reply-To: <20160504.141350.1935086155659300721.davem@davemloft.net>

[-- Attachment #1: Type: text/plain, Size: 182 bytes --]

On Wed, May 04, 2016 at 02:13:50PM -0400, David Miller wrote:
> 
> Just FYI I did this last night.

Thanks a lot for letting me know David.

Cheers,

-- 
Antonio Quartulli

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* Re: [PATC net-next] tcp: must block bh in __inet_twsk_hashdance()
From: Eric Dumazet @ 2016-05-04 18:22 UTC (permalink / raw)
  To: David Miller; +Cc: netdev
In-Reply-To: <20160504.005450.32648328658519474.davem@davemloft.net>

On Wed, 2016-05-04 at 00:54 -0400, David Miller wrote:
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Tue, 03 May 2016 17:10:50 -0700
> 
> > From: Eric Dumazet <edumazet@google.com>
> > 
> > __inet_twsk_hashdance() might be called from process context,
> > better block BH before acquiring bind hash and established locks
> > 
> > Fixes: c10d9310edf5 ("tcp: do not assume TCP code is non preemptible")
> > Signed-off-by: Eric Dumazet <edumazet@google.com>
> 
> Applied.

David, I do not see these two patches in net-next ?

(This one, and the "tcp: fix lockdep splat in tcp_snd_una_update()" one)

Thanks

^ permalink raw reply

* [RESEND PATCH 2/3] fs: poll/select/recvmmsg: use timespec64 for timeout events
From: Deepa Dinamani @ 2016-05-04 19:24 UTC (permalink / raw)
  To: linux-kernel
  Cc: arnd, y2038, netdev, john.stultz, Alexander Viro, linux-fsdevel,
	tglx, David S. Miller
In-Reply-To: <1461947989-21926-3-git-send-email-deepa.kernel@gmail.com>

struct timespec is not y2038 safe.
Even though timespec might be sufficient to represent
timeouts, use struct timespec64 here as the plan is to
get rid of all timespec reference in the kernel.

The patch transitions the common functions:
poll_select_set_timeout() and select_estimate_accuracy()
to use timespec64. And, all the syscalls that use these
functions are transitioned in the same patch.

The restart block parameters for poll uses monotonic time.
Use timespec64 here as well to assign timeout value. This
parameter in the restart block need not change because
this only holds the monotonic timestamp at which timeout
should occur. And, unsigned long data type should be big
enough for this timestamp.

The system call interfaces will be handled in a separate
series.

Compat interfaces need not change as timespec64 is an
alias to struct timespec on a 64 bit system.

Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
---
Resending to include John and Thomas on this patch as well.
This is to include this patch also in John's tree.
This will let all 3 patches in the series to merged through the same tree.
 
 fs/eventpoll.c       | 12 +++++-----
 fs/select.c          | 67 +++++++++++++++++++++++++++++-----------------------
 include/linux/poll.h | 11 +++++----
 net/socket.c         |  8 ++++---
 4 files changed, 54 insertions(+), 44 deletions(-)

diff --git a/fs/eventpoll.c b/fs/eventpoll.c
index 8a74a2a..10db912 100644
--- a/fs/eventpoll.c
+++ b/fs/eventpoll.c
@@ -1583,15 +1583,15 @@ static int ep_send_events(struct eventpoll *ep,
 	return ep_scan_ready_list(ep, ep_send_events_proc, &esed, 0, false);
 }
 
-static inline struct timespec ep_set_mstimeout(long ms)
+static inline struct timespec64 ep_set_mstimeout(long ms)
 {
-	struct timespec now, ts = {
+	struct timespec64 now, ts = {
 		.tv_sec = ms / MSEC_PER_SEC,
 		.tv_nsec = NSEC_PER_MSEC * (ms % MSEC_PER_SEC),
 	};
 
-	ktime_get_ts(&now);
-	return timespec_add_safe(now, ts);
+	ktime_get_ts64(&now);
+	return timespec64_add_safe(now, ts);
 }
 
 /**
@@ -1621,11 +1621,11 @@ static int ep_poll(struct eventpoll *ep, struct epoll_event __user *events,
 	ktime_t expires, *to = NULL;
 
 	if (timeout > 0) {
-		struct timespec end_time = ep_set_mstimeout(timeout);
+		struct timespec64 end_time = ep_set_mstimeout(timeout);
 
 		slack = select_estimate_accuracy(&end_time);
 		to = &expires;
-		*to = timespec_to_ktime(end_time);
+		*to = timespec64_to_ktime(end_time);
 	} else if (timeout == 0) {
 		/*
 		 * Avoid the unnecessary trip to the wait queue loop, if the
diff --git a/fs/select.c b/fs/select.c
index 8692939..8ed9da5 100644
--- a/fs/select.c
+++ b/fs/select.c
@@ -47,7 +47,7 @@
 
 #define MAX_SLACK	(100 * NSEC_PER_MSEC)
 
-static long __estimate_accuracy(struct timespec *tv)
+static long __estimate_accuracy(struct timespec64 *tv)
 {
 	long slack;
 	int divfactor = 1000;
@@ -70,10 +70,10 @@ static long __estimate_accuracy(struct timespec *tv)
 	return slack;
 }
 
-u64 select_estimate_accuracy(struct timespec *tv)
+u64 select_estimate_accuracy(struct timespec64 *tv)
 {
 	u64 ret;
-	struct timespec now;
+	struct timespec64 now;
 
 	/*
 	 * Realtime tasks get a slack of 0 for obvious reasons.
@@ -82,8 +82,8 @@ u64 select_estimate_accuracy(struct timespec *tv)
 	if (rt_task(current))
 		return 0;
 
-	ktime_get_ts(&now);
-	now = timespec_sub(*tv, now);
+	ktime_get_ts64(&now);
+	now = timespec64_sub(*tv, now);
 	ret = __estimate_accuracy(&now);
 	if (ret < current->timer_slack_ns)
 		return current->timer_slack_ns;
@@ -260,7 +260,7 @@ EXPORT_SYMBOL(poll_schedule_timeout);
 
 /**
  * poll_select_set_timeout - helper function to setup the timeout value
- * @to:		pointer to timespec variable for the final timeout
+ * @to:		pointer to timespec64 variable for the final timeout
  * @sec:	seconds (from user space)
  * @nsec:	nanoseconds (from user space)
  *
@@ -269,26 +269,28 @@ EXPORT_SYMBOL(poll_schedule_timeout);
  *
  * Returns -EINVAL if sec/nsec are not normalized. Otherwise 0.
  */
-int poll_select_set_timeout(struct timespec *to, long sec, long nsec)
+int poll_select_set_timeout(struct timespec64 *to, time64_t sec, long nsec)
 {
-	struct timespec ts = {.tv_sec = sec, .tv_nsec = nsec};
+	struct timespec64 ts = {.tv_sec = sec, .tv_nsec = nsec};
 
-	if (!timespec_valid(&ts))
+	if (!timespec64_valid(&ts))
 		return -EINVAL;
 
 	/* Optimize for the zero timeout value here */
 	if (!sec && !nsec) {
 		to->tv_sec = to->tv_nsec = 0;
 	} else {
-		ktime_get_ts(to);
-		*to = timespec_add_safe(*to, ts);
+		ktime_get_ts64(to);
+		*to = timespec64_add_safe(*to, ts);
 	}
 	return 0;
 }
 
-static int poll_select_copy_remaining(struct timespec *end_time, void __user *p,
+static int poll_select_copy_remaining(struct timespec64 *end_time,
+				      void __user *p,
 				      int timeval, int ret)
 {
+	struct timespec64 rts64;
 	struct timespec rts;
 	struct timeval rtv;
 
@@ -302,16 +304,18 @@ static int poll_select_copy_remaining(struct timespec *end_time, void __user *p,
 	if (!end_time->tv_sec && !end_time->tv_nsec)
 		return ret;
 
-	ktime_get_ts(&rts);
-	rts = timespec_sub(*end_time, rts);
-	if (rts.tv_sec < 0)
-		rts.tv_sec = rts.tv_nsec = 0;
+	ktime_get_ts64(&rts64);
+	rts64 = timespec64_sub(*end_time, rts64);
+	if (rts64.tv_sec < 0)
+		rts64.tv_sec = rts64.tv_nsec = 0;
+
+	rts = timespec64_to_timespec(rts64);
 
 	if (timeval) {
 		if (sizeof(rtv) > sizeof(rtv.tv_sec) + sizeof(rtv.tv_usec))
 			memset(&rtv, 0, sizeof(rtv));
-		rtv.tv_sec = rts.tv_sec;
-		rtv.tv_usec = rts.tv_nsec / NSEC_PER_USEC;
+		rtv.tv_sec = rts64.tv_sec;
+		rtv.tv_usec = rts64.tv_nsec / NSEC_PER_USEC;
 
 		if (!copy_to_user(p, &rtv, sizeof(rtv)))
 			return ret;
@@ -396,7 +400,7 @@ static inline void wait_key_set(poll_table *wait, unsigned long in,
 		wait->_key |= POLLOUT_SET;
 }
 
-int do_select(int n, fd_set_bits *fds, struct timespec *end_time)
+int do_select(int n, fd_set_bits *fds, struct timespec64 *end_time)
 {
 	ktime_t expire, *to = NULL;
 	struct poll_wqueues table;
@@ -522,7 +526,7 @@ int do_select(int n, fd_set_bits *fds, struct timespec *end_time)
 		 * pointer to the expiry value.
 		 */
 		if (end_time && !to) {
-			expire = timespec_to_ktime(*end_time);
+			expire = timespec64_to_ktime(*end_time);
 			to = &expire;
 		}
 
@@ -545,7 +549,7 @@ int do_select(int n, fd_set_bits *fds, struct timespec *end_time)
  * I'm trying ERESTARTNOHAND which restart only when you want to.
  */
 int core_sys_select(int n, fd_set __user *inp, fd_set __user *outp,
-			   fd_set __user *exp, struct timespec *end_time)
+			   fd_set __user *exp, struct timespec64 *end_time)
 {
 	fd_set_bits fds;
 	void *bits;
@@ -622,7 +626,7 @@ out_nofds:
 SYSCALL_DEFINE5(select, int, n, fd_set __user *, inp, fd_set __user *, outp,
 		fd_set __user *, exp, struct timeval __user *, tvp)
 {
-	struct timespec end_time, *to = NULL;
+	struct timespec64 end_time, *to = NULL;
 	struct timeval tv;
 	int ret;
 
@@ -648,15 +652,17 @@ static long do_pselect(int n, fd_set __user *inp, fd_set __user *outp,
 		       const sigset_t __user *sigmask, size_t sigsetsize)
 {
 	sigset_t ksigmask, sigsaved;
-	struct timespec ts, end_time, *to = NULL;
+	struct timespec ts;
+	struct timespec64 ts64, end_time, *to = NULL;
 	int ret;
 
 	if (tsp) {
 		if (copy_from_user(&ts, tsp, sizeof(ts)))
 			return -EFAULT;
+		ts64 = timespec_to_timespec64(ts);
 
 		to = &end_time;
-		if (poll_select_set_timeout(to, ts.tv_sec, ts.tv_nsec))
+		if (poll_select_set_timeout(to, ts64.tv_sec, ts64.tv_nsec))
 			return -EINVAL;
 	}
 
@@ -779,7 +785,7 @@ static inline unsigned int do_pollfd(struct pollfd *pollfd, poll_table *pwait,
 }
 
 static int do_poll(struct poll_list *list, struct poll_wqueues *wait,
-		   struct timespec *end_time)
+		   struct timespec64 *end_time)
 {
 	poll_table* pt = &wait->pt;
 	ktime_t expire, *to = NULL;
@@ -854,7 +860,7 @@ static int do_poll(struct poll_list *list, struct poll_wqueues *wait,
 		 * pointer to the expiry value.
 		 */
 		if (end_time && !to) {
-			expire = timespec_to_ktime(*end_time);
+			expire = timespec64_to_ktime(*end_time);
 			to = &expire;
 		}
 
@@ -868,7 +874,7 @@ static int do_poll(struct poll_list *list, struct poll_wqueues *wait,
 			sizeof(struct pollfd))
 
 int do_sys_poll(struct pollfd __user *ufds, unsigned int nfds,
-		struct timespec *end_time)
+		struct timespec64 *end_time)
 {
 	struct poll_wqueues table;
  	int err = -EFAULT, fdcount, len, size;
@@ -936,7 +942,7 @@ static long do_restart_poll(struct restart_block *restart_block)
 {
 	struct pollfd __user *ufds = restart_block->poll.ufds;
 	int nfds = restart_block->poll.nfds;
-	struct timespec *to = NULL, end_time;
+	struct timespec64 *to = NULL, end_time;
 	int ret;
 
 	if (restart_block->poll.has_timeout) {
@@ -957,7 +963,7 @@ static long do_restart_poll(struct restart_block *restart_block)
 SYSCALL_DEFINE3(poll, struct pollfd __user *, ufds, unsigned int, nfds,
 		int, timeout_msecs)
 {
-	struct timespec end_time, *to = NULL;
+	struct timespec64 end_time, *to = NULL;
 	int ret;
 
 	if (timeout_msecs >= 0) {
@@ -993,7 +999,8 @@ SYSCALL_DEFINE5(ppoll, struct pollfd __user *, ufds, unsigned int, nfds,
 		size_t, sigsetsize)
 {
 	sigset_t ksigmask, sigsaved;
-	struct timespec ts, end_time, *to = NULL;
+	struct timespec ts;
+	struct timespec64 end_time, *to = NULL;
 	int ret;
 
 	if (tsp) {
diff --git a/include/linux/poll.h b/include/linux/poll.h
index 9fb4f40..37b057b 100644
--- a/include/linux/poll.h
+++ b/include/linux/poll.h
@@ -96,7 +96,7 @@ extern void poll_initwait(struct poll_wqueues *pwq);
 extern void poll_freewait(struct poll_wqueues *pwq);
 extern int poll_schedule_timeout(struct poll_wqueues *pwq, int state,
 				 ktime_t *expires, unsigned long slack);
-extern u64 select_estimate_accuracy(struct timespec *tv);
+extern u64 select_estimate_accuracy(struct timespec64 *tv);
 
 
 static inline int poll_schedule(struct poll_wqueues *pwq, int state)
@@ -153,12 +153,13 @@ void zero_fd_set(unsigned long nr, unsigned long *fdset)
 
 #define MAX_INT64_SECONDS (((s64)(~((u64)0)>>1)/HZ)-1)
 
-extern int do_select(int n, fd_set_bits *fds, struct timespec *end_time);
+extern int do_select(int n, fd_set_bits *fds, struct timespec64 *end_time);
 extern int do_sys_poll(struct pollfd __user * ufds, unsigned int nfds,
-		       struct timespec *end_time);
+		       struct timespec64 *end_time);
 extern int core_sys_select(int n, fd_set __user *inp, fd_set __user *outp,
-			   fd_set __user *exp, struct timespec *end_time);
+			   fd_set __user *exp, struct timespec64 *end_time);
 
-extern int poll_select_set_timeout(struct timespec *to, long sec, long nsec);
+extern int poll_select_set_timeout(struct timespec64 *to, time64_t sec,
+				   long nsec);
 
 #endif /* _LINUX_POLL_H */
diff --git a/net/socket.c b/net/socket.c
index 5dbb0bb..bdfe115 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -2171,7 +2171,8 @@ int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen,
 	struct mmsghdr __user *entry;
 	struct compat_mmsghdr __user *compat_entry;
 	struct msghdr msg_sys;
-	struct timespec end_time;
+	struct timespec64 end_time;
+	struct timespec64 timeout64;
 
 	if (timeout &&
 	    poll_select_set_timeout(&end_time, timeout->tv_sec,
@@ -2223,8 +2224,9 @@ int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen,
 			flags |= MSG_DONTWAIT;
 
 		if (timeout) {
-			ktime_get_ts(timeout);
-			*timeout = timespec_sub(end_time, *timeout);
+			ktime_get_ts64(&timeout64);
+			*timeout = timespec64_to_timespec(
+					timespec64_sub(end_time, timeout64));
 			if (timeout->tv_sec < 0) {
 				timeout->tv_sec = timeout->tv_nsec = 0;
 				break;
-- 
1.9.1

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

^ permalink raw reply related

* Re: [RESEND PATCH 2/3] fs: poll/select/recvmmsg: use timespec64 for timeout events
From: John Stultz @ 2016-05-04 20:04 UTC (permalink / raw)
  To: Deepa Dinamani
  Cc: Arnd Bergmann, y2038 Mailman List, netdev, lkml, Alexander Viro,
	linux-fsdevel@vger.kernel.org, Thomas Gleixner, David S. Miller
In-Reply-To: <1462389899-2480-1-git-send-email-deepa.kernel@gmail.com>

On Wed, May 4, 2016 at 12:24 PM, Deepa Dinamani <deepa.kernel@gmail.com> wrote:
> struct timespec is not y2038 safe.
> Even though timespec might be sufficient to represent
> timeouts, use struct timespec64 here as the plan is to
> get rid of all timespec reference in the kernel.
>
> The patch transitions the common functions:
> poll_select_set_timeout() and select_estimate_accuracy()
> to use timespec64. And, all the syscalls that use these
> functions are transitioned in the same patch.
>
> The restart block parameters for poll uses monotonic time.
> Use timespec64 here as well to assign timeout value. This
> parameter in the restart block need not change because
> this only holds the monotonic timestamp at which timeout
> should occur. And, unsigned long data type should be big
> enough for this timestamp.
>
> The system call interfaces will be handled in a separate
> series.
>
> Compat interfaces need not change as timespec64 is an
> alias to struct timespec on a 64 bit system.
>
> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
> Cc: Alexander Viro <viro@zeniv.linux.org.uk>
> Cc: "David S. Miller" <davem@davemloft.net>
> Cc: netdev@vger.kernel.org
> ---
> Resending to include John and Thomas on this patch as well.
> This is to include this patch also in John's tree.
> This will let all 3 patches in the series to merged through the same tree.
>
>  fs/eventpoll.c       | 12 +++++-----
>  fs/select.c          | 67 +++++++++++++++++++++++++++++-----------------------
>  include/linux/poll.h | 11 +++++----
>  net/socket.c         |  8 ++++---
>  4 files changed, 54 insertions(+), 44 deletions(-)


So with the other two patches, I'm more comfortable queueing and
sending through to Thomas.

But I'm less comfortable making the call on this one. It looks
relatively straight forward, but it would be good to have maintainer
acks before I add it to my tree.

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

^ permalink raw reply

* Re: [PATCH net-next v2] macvtap: add namespace support to the sysfs device class
From: David Miller @ 2016-05-04 20:04 UTC (permalink / raw)
  To: marc; +Cc: netdev, ebiederm
In-Reply-To: <1462300254-22273-1-git-send-email-marc@arista.com>

From: Marc Angel <marc@arista.com>
Date: Tue,  3 May 2016 20:30:54 +0200

> @@ -1274,6 +1285,7 @@ static int macvtap_device_event(struct notifier_block *unused,
>  				unsigned long event, void *ptr)
>  {
>  	struct net_device *dev = netdev_notifier_info_to_dev(ptr);
> +	const char *tap_name = kasprintf(GFP_KERNEL, "tap%d", dev->ifindex);
>  	struct macvlan_dev *vlan;
>  	struct device *classdev;
>  	dev_t devt;

This 'tap_name' buffer seems to be leaked in several code paths.

^ permalink raw reply

* Re: [PATCH] mdio_bus: don't return NULL from mdiobus_scan()
From: David Miller @ 2016-05-04 20:14 UTC (permalink / raw)
  To: sergei.shtylyov; +Cc: netdev, f.fainelli
In-Reply-To: <4702228.vWmKBZLz6G@wasted.cogentembedded.com>

From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Date: Tue, 03 May 2016 23:14:41 +0300

> I've finally noticed that mdiobus_scan() also returns either NULL or error
> value on failure.  Return ERR_PTR(-ENODEV) instead of NULL since this is
> the  error value  already filtered out by the callers that want to ignore
> the  MDIO address scan failure...
> 
> Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>

Applied.

^ permalink raw reply

* Re: [PATCH] fix infoleak in llc
From: David Miller @ 2016-05-04 20:20 UTC (permalink / raw)
  To: kangjielu; +Cc: acme, netdev, linux-kernel, taesoo, insu, kjlu
In-Reply-To: <1462307705-5882-1-git-send-email-kjlu@gatech.edu>

From: Kangjie Lu <kangjielu@gmail.com>
Date: Tue,  3 May 2016 16:35:05 -0400

> The stack object “info” has a total size of 12 bytes. Its last byte
> is padding which is not initialized and leaked via “put_cmsg”.
> 
> Signed-off-by: Kangjie Lu <kjlu@gatech.edu>

Applied.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox