* Re: [PATCH net] ipv4: Fix use-after-free when flushing FIB tables
From: Ido Schimmel @ 2017-12-19 18:49 UTC (permalink / raw)
To: Alexander Duyck
Cc: David Miller, Ido Schimmel, Netdev, Duyck, Alexander H,
Fengguang Wu, David Ahern, mlxsw
In-Reply-To: <CAKgT0UfnK9ueT3PtD=HKB2f_XhccoVq6HnnQ=vRgEdtM-WUG2Q@mail.gmail.com>
On Tue, Dec 19, 2017 at 09:34:16AM -0800, Alexander Duyck wrote:
> That seems like unneeded complexity when the issue is just the order
> that these were created in versus the order they are freed in. As long
> as we always destroy the one containing the alias before the one that
> has the actual data we don't need to have a reference count. Basically
> the issue is the bring-up and the tear-down order. It isn't something
> that really needs a reference count since it would always be either 1
> or 2. My preference would be to just add a comment explaining that
> local must always be destroyed before the main trie in order to
> guarantee that there are no external references to the data contained
> in main when it is freed.
>
> The one question I have in all this is if I did the bring-up in the
> right order in the first place. I'm wondering if local should be where
> the combined trie lives instead of main. Local is currently destroyed
> after main anyway so I wonder if it wouldn't have been better if
> everything lived in local since from what I can tell it looks like we
> add rules for local first before we do so in main. The complexity of
> that patch would be higher though since the patch would need to be
> much larger and touch multiple files.
I decided to go with the original patch because it resulted in a very
small diff (patch is needed in -stable as well), but I agree with Dave
about it not being explicit enough.
How about I'll send v2 with a comment and then we can try Alex's
suggestion in net-next?
Thanks
^ permalink raw reply
* Re: [-next PATCH 4/4] treewide: Use DEVICE_ATTR_WO
From: Joe Perches @ 2017-12-19 18:51 UTC (permalink / raw)
To: Borislav Petkov
Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
Thomas Falcon, John Allen, Inaky Perez-Gonzalez, linux-wimax,
James Smart, Dick Kennedy, Zhang Rui, Eduardo Valentin,
Martin Schwidefsky, Heiko Carstens, Thomas Gleixner,
H. Peter Anvin, x86, Dmitry Torokhov, James E.J. Bottomley,
Martin K. Petersen
In-Reply-To: <20171219184441.ixxh757tl44qvk5l@pd.tnic>
On Tue, 2017-12-19 at 19:44 +0100, Borislav Petkov wrote:
> On Tue, Dec 19, 2017 at 10:15:09AM -0800, Joe Perches wrote:
> > Convert DEVICE_ATTR uses to DEVICE_ATTR_WO where possible.
> >
> > Done with perl script:
> >
> > $ git grep -w --name-only DEVICE_ATTR | \
> > xargs perl -i -e 'local $/; while (<>) { s/\bDEVICE_ATTR\s*\(\s*(\w+)\s*,\s*\(?(?:\s*S_IWUSR\s*|\s*0200\s*)\)?\s*,\s*NULL\s*,\s*\s_store\s*\)/DEVICE_ATTR_WO(\1)/g; print;}'
[]
> > diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
[]
> > @@ -560,7 +560,7 @@ static ssize_t pf_show(struct device *dev,
> > return sprintf(buf, "0x%x\n", uci->cpu_sig.pf);
> > }
> >
> > -static DEVICE_ATTR(reload, 0200, NULL, reload_store);
> > +static DEVICE_ATTR_WO(reload);
> > static DEVICE_ATTR(version, 0400, version_show, NULL);
> > static DEVICE_ATTR(processor_flags, 0400, pf_show, NULL);
> >
>
> # cat /sys/devices/system/cpu/microcode/reload
> cat: /sys/devices/system/cpu/microcode/reload: Permission denied
Not different behavior. It was and remains write only.
> The reason for the code churn being?
Consistency for easier grep by use-type.
^ permalink raw reply
* Re: [PATCH] net: ks8851: Support DT-provided MAC address
From: David Miller @ 2017-12-19 18:52 UTC (permalink / raw)
To: lukas; +Cc: ben, tristram.ha, david.choi, m.duckeck, netdev
In-Reply-To: <68ae82c3cac7b6e4123fa31140805f7fab93af06.1513591121.git.lukas@wunner.de>
From: Lukas Wunner <lukas@wunner.de>
Date: Mon, 18 Dec 2017 11:17:07 +0100
> Allow the boot loader to specify the MAC address in the device tree
> to override the EEPROM, or in case no EEPROM is present.
>
> Cc: Ben Dooks <ben@simtec.co.uk>
> Cc: Tristram Ha <tristram.ha@micrel.com>
> Cc: David J. Choi <david.choi@micrel.com>
> Signed-off-by: Lukas Wunner <lukas@wunner.de>
Applied to net-next, thank you.
^ permalink raw reply
* Re: pull request: bluetooth-next 2017-12-18
From: David Miller @ 2017-12-19 18:53 UTC (permalink / raw)
To: johan.hedberg-Re5JQEeQqe8AvxtiuMwx3w
Cc: linux-bluetooth-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20171218102721.GA17768@x1c>
From: Johan Hedberg <johan.hedberg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Date: Mon, 18 Dec 2017 11:27:21 +0100
> Here's the first bluetooth-next pull request for the 4.16 kernel.
>
> - hci_ll: multiple cleanups & fixes
> - Remove Gustavo Padovan from the MAINTAINERS file
> - Support BLE Adversing while connected (if the controller can do it)
> - DT updates for TI chips
> - Various other smaller cleanups & fixes
>
> Please let me know if there are any issues pulling. Thanks.
Pulled, thanks Johan.
^ permalink raw reply
* Re: [-next PATCH 4/4] treewide: Use DEVICE_ATTR_WO
From: Borislav Petkov @ 2017-12-19 18:54 UTC (permalink / raw)
To: Joe Perches
Cc: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
Thomas Falcon, John Allen, Inaky Perez-Gonzalez, linux-wimax,
James Smart, Dick Kennedy, Zhang Rui, Eduardo Valentin,
Martin Schwidefsky, Heiko Carstens, Thomas Gleixner,
H. Peter Anvin, x86, Dmitry Torokhov, James E.J. Bottomley,
Martin K. Petersen
In-Reply-To: <1513709474.1234.66.camel@perches.com>
On Tue, Dec 19, 2017 at 10:51:14AM -0800, Joe Perches wrote:
> > The reason for the code churn being?
>
> Consistency for easier grep by use-type.
Please explain that in the commit message so that we know why it was
changed.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
^ permalink raw reply
* Re: [-next PATCH 0/4] sysfs and DEVICE_ATTR_<foo>
From: Jani Nikula @ 2017-12-19 18:54 UTC (permalink / raw)
To: Joe Perches, linux-arm-kernel, linux-acpi, openipmi-developer,
intel-gfx, linuxppc-dev, netdev, linux-nvme, platform-driver-x86,
linux-s390, esc.storagedev, linux-scsi, linux-pm, linux-serial,
linux-usb, linux-kernel, alsa-devel, linux-omap
Cc: devel, linux-fbdev, linux-sh, dri-devel, linux-input, linux-media
In-Reply-To: <cover.1513706701.git.joe@perches.com>
On Tue, 19 Dec 2017, Joe Perches <joe@perches.com> wrote:
> drivers/gpu/drm/i915/i915_sysfs.c | 12 ++--
For i915,
Acked-by: Jani Nikula <jani.nikula@intel.com>
--
Jani Nikula, Intel Open Source Technology Center
^ permalink raw reply
* Re: [PATCH net-next] cxgb4: Report tid start range correctly for T6
From: David Miller @ 2017-12-19 18:54 UTC (permalink / raw)
To: ganeshgr; +Cc: netdev, nirranjan, indranil, venkatesh, arjun
In-Reply-To: <1513606522-5245-1-git-send-email-ganeshgr@chelsio.com>
From: Ganesh Goudar <ganeshgr@chelsio.com>
Date: Mon, 18 Dec 2017 19:45:22 +0530
> For T6, tid start range should be read from
> LE_DB_ACTIVE_TABLE_START_INDEX_A register.
>
> Signed-off-by: Arjun Vynipadath <arjun@chelsio.com>
> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Applied.
^ permalink raw reply
* [PATCH net] openvswitch: Fix pop_vlan action for double tagged frames
From: Eric Garver @ 2017-12-19 18:57 UTC (permalink / raw)
To: netdev; +Cc: Jiri Benc, ovs-dev
skb_vlan_pop() expects skb->protocol to be a valid TPID for double
tagged frames. As such don't override skb->protocol for normal ethernet
frames when extracting the key.
Fixes: 5108bbaddc37 ("openvswitch: add processing of L3 packets")
Signed-off-by: Eric Garver <e@erig.me>
---
net/openvswitch/flow.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
index dbe2379329c5..06d32ba3dd69 100644
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -559,8 +559,9 @@ static int parse_nsh(struct sk_buff *skb, struct sw_flow_key *key)
* of a correct length, otherwise the same as skb->network_header.
* For other key->eth.type values it is left untouched.
*
- * - skb->protocol: the type of the data starting at skb->network_header.
- * Equals to key->eth.type.
+ * - skb->protocol: For Ethernet, the ethertype or VLAN TPID.
+ * For non-Ethernet, the type of the data starting at skb->network_header
+ * (also equal to key->eth.type).
*/
static int key_extract(struct sk_buff *skb, struct sw_flow_key *key)
{
@@ -579,6 +580,7 @@ static int key_extract(struct sk_buff *skb, struct sw_flow_key *key)
return -EINVAL;
skb_reset_network_header(skb);
+ key->eth.type = skb->protocol;
} else {
eth = eth_hdr(skb);
ether_addr_copy(key->eth.src, eth->h_source);
@@ -592,15 +594,14 @@ static int key_extract(struct sk_buff *skb, struct sw_flow_key *key)
if (unlikely(parse_vlan(skb, key)))
return -ENOMEM;
- skb->protocol = parse_ethertype(skb);
- if (unlikely(skb->protocol == htons(0)))
+ key->eth.type = parse_ethertype(skb);
+ if (unlikely(key->eth.type == htons(0)))
return -ENOMEM;
skb_reset_network_header(skb);
__skb_push(skb, skb->data - skb_mac_header(skb));
}
skb_reset_mac_len(skb);
- key->eth.type = skb->protocol;
/* Network layer. */
if (key->eth.type == htons(ETH_P_IP)) {
--
2.12.0
^ permalink raw reply related
* Re: [net-next: PATCH 0/8] Armada 7k/8k PP2 ACPI support
From: Marcin Wojtas @ 2017-12-19 18:59 UTC (permalink / raw)
To: David Miller
Cc: linux-kernel, linux-arm-kernel, netdev, Russell King - ARM Linux,
Rafael J. Wysocki, Andrew Lunn, Florian Fainelli,
Antoine Ténart, Thomas Petazzoni, Gregory Clément,
Ezequiel Garcia, nadavh, Neta Zur Hershkovits, Ard Biesheuvel,
Grzegorz Jaszczyk, Tomasz Nowicki
In-Reply-To: <20171219.134810.48027351795338458.davem@davemloft.net>
Hi David,
2017-12-19 19:48 GMT+01:00 David Miller <davem@davemloft.net>:
> From: Marcin Wojtas <mw@semihalf.com>
> Date: Mon, 18 Dec 2017 10:17:56 +0100
>
>> Above support configures 1G to use its PHY normally. 10G can work now
>> only with the link interrupt mode. Somehow reading of the
>> string property in fwnode_mdiobus_child_is_phy works only with
>> DT and cannot cope with 10G PHY nodes as in:
>> https://pastebin.com/3JnYpU0A
>>
>> Above root cause will be further checked. In the meantime I will
>> appreciate any comments or remarks for the kernel patches.
>
> I would like you to figure this out before these changes go in.
>
Of course! v2 will not have such problem, I've been waiting however
for the feedback about the ACPI representation. Anyway, I'm strongly
leaning towards using _ADR/_CID objects in PHY's nodes for ACPI, so
maybe I'll just issue the v2 in order to push the discussion a bit
forward.
Thanks,
Marcin
^ permalink raw reply
* Re: [PATCH net] ipv4: Fix use-after-free when flushing FIB tables
From: David Miller @ 2017-12-19 19:01 UTC (permalink / raw)
To: idosch
Cc: alexander.duyck, idosch, netdev, alexander.h.duyck, fengguang.wu,
dsahern, mlxsw
In-Reply-To: <20171219184913.GA18980@splinter>
From: Ido Schimmel <idosch@idosch.org>
Date: Tue, 19 Dec 2017 20:49:13 +0200
> How about I'll send v2 with a comment and then we can try Alex's
> suggestion in net-next?
Sounds good.
^ permalink raw reply
* Re: [PATCH net-next v5 0/5] Introduce NETIF_F_GRO_HW
From: Marcelo Ricardo Leitner @ 2017-12-19 19:04 UTC (permalink / raw)
To: David Miller; +Cc: michael.chan, netdev, andrew.gospodarek
In-Reply-To: <20171219.105024.1047087594002892419.davem@davemloft.net>
On Tue, Dec 19, 2017 at 10:50:24AM -0500, David Miller wrote:
> From: Michael Chan <michael.chan@broadcom.com>
> Date: Sat, 16 Dec 2017 03:09:39 -0500
>
> > Introduce NETIF_F_GRO_HW feature flag and convert drivers that support
> > hardware GRO to use the new flag.
>
> Series applied, thanks for following through with this work.
Can we clarify on the meaning/expectations of dev_weight? The
documentation currently says:
The maximum number of packets that kernel can handle on a NAPI
interrupt, it's a Per-CPU variable.
I believe 'packets' here refers to packets on the wire.
For drivers doing LRO, we don't have visibility on how many
packets were aggregated so they count as 1, aggregated or not.
But for GRO_HW, drivers implementing it will get a bonus on its
dev_weight because instead of pulling 5 packets in a cycle to create 1
gro'ed skb, it will pull 1 big packet (which includes 5) and count it
as 1.
I understand that for all that matters, the hardware operations
involved on GRO_HW are really for only 1 packet, so it would make
sense to count it as 1. OTOH, this bump may cause additional pressure
in other places as in fact we are allowing more packets in in a given
cycle.
At least qede driver is counting 1 GRO_HW pkt as 1 budget.
Thanks,
Marcelo
^ permalink raw reply
* Re: pull-request: wireless-drivers-next 2017-12-18
From: David Miller @ 2017-12-19 19:06 UTC (permalink / raw)
To: kvalo-sgV2jX0FEOL9JmXXK+q4OQ
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
luciano.coelho-ral2JQCrhuEAvxtiuMwx3w
In-Reply-To: <874looktmz.fsf-HodKDYzPHsUD5k0oWYwrnHL1okKdlPRT@public.gmane.org>
From: Kalle Valo <kvalo-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
Date: Mon, 18 Dec 2017 16:17:24 +0200
> a pull request for 4.16 to net-next tree. This is a big one, but on the
> other hand most of the stuff here has been some time on linux-next so
> hopefully there are no nasty surprises. Even though Arnd just send a
> patch[1] five minutes ago about fixing a wcn36xx build warning, but I
> don't think that's critical enough to hold up this, so I'll send it to
> you in the next pull request.
>
> But this time we actually have a merge conflict due to a000 hardware
> rename in iwlwifi:
>
> CONFLICT (content): Merge conflict in drivers/net/wireless/intel/iwlwifi/pcie/drv.c
>
> The fix is quite straightforward, take the 22000 versions and manually
> add an entry for 0xA0F0 device:
>
> {IWL_PCI_DEVICE(0xA0F0, 0x0000, iwl22000_2ax_cfg_hr)},
>
> I put the 'git diff' output of my test resolution below, hopefully it
> helps. I'll also Cc Luca so he can correct any mistakes I did :)
>
> Please let me know if you have any problems.
Pulled, and thanks for the resolution diff. It helped a lot.
^ permalink raw reply
* Re: [PATCH 0/2 net-next] ibmvnic: Fix and increase maximum TX/RX queues
From: David Miller @ 2017-12-19 19:08 UTC (permalink / raw)
To: tlfalcon; +Cc: netdev
In-Reply-To: <1513623132-16554-1-git-send-email-tlfalcon@linux.vnet.ibm.com>
From: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Date: Mon, 18 Dec 2017 12:52:10 -0600
> This series renames IBMVNIC_MAX_TX_QUEUES to IBMVNIC_MAX_QUEUES since
> it is used to allocate both RX and TX queues. The value is also increased
> to accommodate newer hardware.
Series applied.
^ permalink raw reply
* Re: [PATCH net-next] ibmvnic: Include header descriptor support for ARP packets
From: David Miller @ 2017-12-19 19:10 UTC (permalink / raw)
To: tlfalcon; +Cc: netdev
In-Reply-To: <1513623160-16621-1-git-send-email-tlfalcon@linux.vnet.ibm.com>
From: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Date: Mon, 18 Dec 2017 12:52:40 -0600
> In recent tests with new adapters, it was discovered that ARP
> packets were not being properly processed. This patch adds
> support for ARP packet headers to be passed to backing adapters,
> if necessary.
>
> Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
Applied.
^ permalink raw reply
* Re: [net 1/1] tipc: fix list sorting bug in function tipc_group_update_member()
From: David Miller @ 2017-12-19 19:10 UTC (permalink / raw)
To: jon.maloy
Cc: netdev, mohan.krishna.ghanta.krishnamurthy, tung.q.nguyen,
hoang.h.le, canh.d.luu, ying.xue, tipc-discussion
In-Reply-To: <1513623785-26566-1-git-send-email-jon.maloy@ericsson.com>
From: Jon Maloy <jon.maloy@ericsson.com>
Date: Mon, 18 Dec 2017 20:03:05 +0100
> When, during a join operation, or during message transmission, a group
> member needs to be added to the group's 'congested' list, we sort it
> into the list in ascending order, according to its current advertised
> window size. However, we miss the case when the member is already on
> that list. This will have the result that the member, after the window
> size has been decremented, might be at the wrong position in that list.
> This again may have the effect that we during broadcast and multicast
> transmissions miss the fact that a destination is not yet ready for
> reception, and we end up sending anyway. From this point on, the
> behavior during the remaining session is unpredictable, e.g., with
> underflowing window sizes.
>
> We now correct this bug by unconditionally removing the member from
> the list before (re-)sorting it in.
>
> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Applied, thanks Jon.
^ permalink raw reply
* Re: [PATCH v3 net-next 3/6] net: Add SW fallback infrastructure for offloaded sockets
From: Eric Dumazet @ 2017-12-19 19:12 UTC (permalink / raw)
To: Ilya Lesokhin, netdev, davem
Cc: davejwatson, tom, hannes, borisp, aviadye, liranl
In-Reply-To: <20171218111033.13256-4-ilyal@mellanox.com>
On Mon, 2017-12-18 at 13:10 +0200, Ilya Lesokhin wrote:
> Offloaded sockets rely on the netdev to transform the transmitted
> packets before sending them over the network.
> When a packet from an offloaded socket is looped back or
> rerouted to a different device we need to detect it and
> do the transformation in software
>
> Signed-off-by: Ilya Lesokhin <ilyal@mellanox.com>
> Signed-off-by: Boris Pismenny <borisp@mellanox.com>
> ---
> include/net/sock.h | 17 +++++++++++++++++
> net/core/dev.c | 4 ++++
> 2 files changed, 21 insertions(+)
>
> diff --git a/include/net/sock.h b/include/net/sock.h
> index 9a9047268d37..5397307603ec 100644
> --- a/include/net/sock.h
> +++ b/include/net/sock.h
> @@ -479,6 +479,9 @@ struct sock {
> void (*sk_error_report)(struct sock *sk);
> int (*sk_backlog_rcv)(struct sock *sk,
> struct sk_buff *skb);
> + struct sk_buff* (*sk_offload_check)(struct sock *sk,
> + struct net_device *dev,
> + struct sk_buff *skb);
> void (*sk_destruct)(struct sock *sk);
> struct sock_reuseport __rcu *sk_reuseport_cb;
> struct rcu_head sk_rcu;
> @@ -2324,6 +2327,20 @@ static inline bool sk_fullsock(const struct sock *sk)
> return (1 << sk->sk_state) & ~(TCPF_TIME_WAIT | TCPF_NEW_SYN_RECV);
> }
>
> +/* Checks if this SKB belongs to an HW offloaded socket
> + * and whether any SW fallbacks are required based on dev.
> + */
> +static inline struct sk_buff *skb_offload_check(struct sk_buff *skb,
> + struct net_device *dev)
> +{
> + struct sock *sk = skb->sk;
> +
> + if (sk && sk_fullsock(sk) && sk->sk_offload_check)
> + skb = sk->sk_offload_check(sk, dev, skb);
> +
> + return skb;
> +}
> +
> /* This helper checks if a socket is a LISTEN or NEW_SYN_RECV
> * SYNACK messages can be attached to either ones (depending on SYNCOOKIE)
> */
> diff --git a/net/core/dev.c b/net/core/dev.c
> index b0eee49a2489..6a78d9046674 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -3051,6 +3051,10 @@ static struct sk_buff *validate_xmit_skb(struct sk_buff *skb, struct net_device
> if (unlikely(!skb))
> goto out_null;
>
> + skb = skb_offload_check(skb, dev);
> + if (!skb)
> + goto out_null;
> +
> if (netif_needs_gso(skb, features)) {
> struct sk_buff *segs;
>
How is it going to work with stacked devices (bonding, team, tunnels) ?
^ permalink raw reply
* Re: [PATCH 1/2] net: stmmac: Fix TX timestamp calculation
From: David Miller @ 2017-12-19 19:12 UTC (permalink / raw)
To: megahallon
Cc: netdev, linux-kernel, Jose.Abreu, peppe.cavallaro,
alexandre.torgue
In-Reply-To: <20171218223400.29644-1-megahallon@gmail.com>
From: Fredrik Hallenberg <megahallon@gmail.com>
Date: Mon, 18 Dec 2017 23:33:59 +0100
> When using GMAC4 the value written in PTP_SSIR should be shifted however
> the shifted value is also used in subsequent calculations which results
> in a bad timestamp value.
>
> Signed-off-by: Fredrik Hallenberg <megahallon@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH 2/2] net: stmmac: Fix bad RX timestamp extraction
From: David Miller @ 2017-12-19 19:12 UTC (permalink / raw)
To: megahallon
Cc: netdev, linux-kernel, Jose.Abreu, peppe.cavallaro,
alexandre.torgue
In-Reply-To: <20171218223400.29644-2-megahallon@gmail.com>
From: Fredrik Hallenberg <megahallon@gmail.com>
Date: Mon, 18 Dec 2017 23:34:00 +0100
> As noted in dwmac4_wrback_get_rx_timestamp_status the timestamp is found
> in the context descriptor following the current descriptor. However the
> current code looks for the context descriptor in the current
> descriptor, which will always fail.
>
> Signed-off-by: Fredrik Hallenberg <megahallon@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH v3 net-next 1/6] tcp: Add clean acked data hook
From: Eric Dumazet @ 2017-12-19 19:13 UTC (permalink / raw)
To: Ilya Lesokhin, netdev, davem
Cc: davejwatson, tom, hannes, borisp, aviadye, liranl
In-Reply-To: <20171218111033.13256-2-ilyal@mellanox.com>
On Mon, 2017-12-18 at 13:10 +0200, Ilya Lesokhin wrote:
> Called when a TCP segment is acknowledged.
> Could be used by application protocols who hold additional
> metadata associated with the stream data
> This is required by TLS device offload to release
> metadata associated with acknowledged TLS records.
>
> Signed-off-by: Boris Pismenny <borisp@mellanox.com>
> Signed-off-by: Ilya Lesokhin <ilyal@mellanox.com>
> Signed-off-by: Aviad Yehezkel <aviadye@mellanox.com>
> ---
> include/net/inet_connection_sock.h | 2 ++
> net/ipv4/tcp_input.c | 3 +++
> 2 files changed, 5 insertions(+)
>
> diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
> index 8e1bf9ae4a5e..ec405a667a85 100644
> --- a/include/net/inet_connection_sock.h
> +++ b/include/net/inet_connection_sock.h
> @@ -77,6 +77,7 @@ struct inet_connection_sock_af_ops {
> * @icsk_af_ops Operations which are AF_INET{4,6} specific
> * @icsk_ulp_ops Pluggable ULP control hook
> * @icsk_ulp_data ULP private data
> + * @icsk_clean_acked Clean acked data hook
> * @icsk_listen_portaddr_node hash to the portaddr listener hashtable
> * @icsk_ca_state: Congestion control state
> * @icsk_retransmits: Number of unrecovered [RTO] timeouts
> @@ -102,6 +103,7 @@ struct inet_connection_sock {
> const struct inet_connection_sock_af_ops *icsk_af_ops;
> const struct tcp_ulp_ops *icsk_ulp_ops;
> void *icsk_ulp_data;
> + void (*icsk_clean_acked)(struct sock *sk);
> struct hlist_node icsk_listen_portaddr_node;
> unsigned int (*icsk_sync_mss)(struct sock *sk, u32 pmtu);
> __u8 icsk_ca_state:6,
> diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
> index 4d55c4b338ee..961abc5be84c 100644
> --- a/net/ipv4/tcp_input.c
> +++ b/net/ipv4/tcp_input.c
> @@ -3592,6 +3592,9 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
> if (!prior_packets)
> goto no_queue;
>
> + if (icsk->icsk_clean_acked)
> + icsk->icsk_clean_acked(sk);
> +
> /* See if we can take anything off of the retransmit queue. */
> flag |= tcp_clean_rtx_queue(sk, prior_fack, prior_snd_una, &sack_state);
>
1) tcp_ack() is already very expensive.
2) Since you do not pass any state here, this looks very suspicious to
me.
^ permalink raw reply
* Re: [Patch net-next] net_sched: properly check for empty skb array on error path
From: David Miller @ 2017-12-19 19:13 UTC (permalink / raw)
To: xiyou.wangcong; +Cc: netdev, john.fastabend
In-Reply-To: <20171218223426.4685-1-xiyou.wangcong@gmail.com>
From: Cong Wang <xiyou.wangcong@gmail.com>
Date: Mon, 18 Dec 2017 14:34:26 -0800
> First, the check of &q->ring.queue against NULL is wrong, it
> is always false. We should check the value rather than the address.
>
> Secondly, we need the same check in pfifo_fast_reset() too,
> as both ->reset() and ->destroy() are called in qdisc_destroy().
>
> Fixes: c5ad119fb6c0 ("net: sched: pfifo_fast use skb_array")
> Reported-by: syzbot <syzkaller@googlegroups.com>
> Cc: John Fastabend <john.fastabend@gmail.com>
> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Applied, thanks Cong.
^ permalink raw reply
* [PATCH v1 1/4] lib/net_utils: Relax NULL-termination requirement on input string
From: Andy Shevchenko @ 2017-12-19 19:14 UTC (permalink / raw)
To: David S. Miller, netdev, Larry Finger, Florian Schilhabel, devel,
Greg Kroah-Hartman
Cc: Andy Shevchenko
We have not been caring about garbage at the end of input string and this
change doesn't affect it. What we prevent here is possibility to go over
boundaries when input string is not NULL terminated at all.
Allow mac_pton() work on non-NULL terminated strings.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
lib/net_utils.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/net_utils.c b/lib/net_utils.c
index af525353395d..d32c6961fe0f 100644
--- a/lib/net_utils.c
+++ b/lib/net_utils.c
@@ -4,12 +4,14 @@
#include <linux/ctype.h>
#include <linux/kernel.h>
+#define MAC_PTON_MINLEN (3 * ETH_ALEN - 1)
+
bool mac_pton(const char *s, u8 *mac)
{
int i;
/* XX:XX:XX:XX:XX:XX */
- if (strlen(s) < 3 * ETH_ALEN - 1)
+ if (strnlen(s, MAC_PTON_MINLEN) < MAC_PTON_MINLEN)
return false;
/* Don't dirty result unless string is valid MAC. */
--
2.15.1
^ permalink raw reply related
* [PATCH v1 4/4] staging: rtl8712: Replace mac address parsing
From: Andy Shevchenko @ 2017-12-19 19:14 UTC (permalink / raw)
To: David S. Miller, netdev, Larry Finger, Florian Schilhabel, devel,
Greg Kroah-Hartman
Cc: Andy Shevchenko
In-Reply-To: <20171219191412.14880-1-andriy.shevchenko@linux.intel.com>
Replace copy_from_user() + mac_pton() with mac_pton_from_user().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index e30a5be5f318..3f82c39eb071 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -1953,7 +1953,7 @@ static int r871x_get_ap_info(struct net_device *dev,
struct list_head *plist, *phead;
unsigned char *pbuf;
u8 bssid[ETH_ALEN];
- char data[33];
+ int ret;
if (padapter->bDriverStopped || (pdata == NULL))
return -EINVAL;
@@ -1967,9 +1967,11 @@ static int r871x_get_ap_info(struct net_device *dev,
pdata->flags = 0;
if (pdata->length < 32)
return -EINVAL;
- if (copy_from_user(data, pdata->pointer, 32))
- return -EINVAL;
- data[32] = 0;
+ ret = mac_pton_from_user(pdata->pointer, 32, bssid);
+ if (ret)
+ return ret;
+
+ netdev_info(dev, "r8712u: BSSID:%pM\n", bssid);
spin_lock_irqsave(&(pmlmepriv->scanned_queue.lock), irqL);
phead = &queue->queue;
@@ -1978,14 +1980,6 @@ static int r871x_get_ap_info(struct net_device *dev,
if (end_of_queue_search(phead, plist))
break;
pnetwork = container_of(plist, struct wlan_network, list);
- if (!mac_pton(data, bssid)) {
- netdev_info(dev, "r8712u: Invalid BSSID '%s'.\n",
- (u8 *)data);
- spin_unlock_irqrestore(&(pmlmepriv->scanned_queue.lock),
- irqL);
- return -EINVAL;
- }
- netdev_info(dev, "r8712u: BSSID:%pM\n", bssid);
if (ether_addr_equal(bssid, pnetwork->network.MacAddress)) {
/* BSSID match, then check if supporting wpa/wpa2 */
pbuf = r8712_get_wpa_ie(&pnetwork->network.IEs[12],
--
2.15.1
^ permalink raw reply related
* Re: [PATCH net-next v2] cxgb4: RSS table is 4k for T6
From: David Miller @ 2017-12-19 19:14 UTC (permalink / raw)
To: ganeshgr; +Cc: netdev, nirranjan, indranil, venkatesh
In-Reply-To: <1513648348-7956-1-git-send-email-ganeshgr@chelsio.com>
From: Ganesh Goudar <ganeshgr@chelsio.com>
Date: Tue, 19 Dec 2017 07:22:28 +0530
> RSS table is 4k for T6 and later cards, add check for the
> same.
>
> Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Applied, thanks Ganesh.
^ permalink raw reply
* [PATCH v1 2/4] lib/net_utils: Introduce mac_pton_from_user()
From: Andy Shevchenko @ 2017-12-19 19:14 UTC (permalink / raw)
To: David S. Miller, netdev, Larry Finger, Florian Schilhabel, devel,
Greg Kroah-Hartman
Cc: Andy Shevchenko
In-Reply-To: <20171219191412.14880-1-andriy.shevchenko@linux.intel.com>
Some drivers are getting MAC from user space. Make a helper for them.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
include/linux/kernel.h | 1 +
lib/net_utils.c | 12 ++++++++++++
2 files changed, 13 insertions(+)
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index ce51455e2adf..e203b313608d 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -587,6 +587,7 @@ extern int __must_check hex2bin(u8 *dst, const char *src, size_t count);
extern char *bin2hex(char *dst, const void *src, size_t count);
bool mac_pton(const char *s, u8 *mac);
+int __must_check mac_pton_from_user(const char __user *s, size_t count, u8 *mac);
/*
* General tracing related utility functions - trace_printk(),
diff --git a/lib/net_utils.c b/lib/net_utils.c
index d32c6961fe0f..7be3483aece6 100644
--- a/lib/net_utils.c
+++ b/lib/net_utils.c
@@ -3,6 +3,7 @@
#include <linux/if_ether.h>
#include <linux/ctype.h>
#include <linux/kernel.h>
+#include <linux/uaccess.h>
#define MAC_PTON_MINLEN (3 * ETH_ALEN - 1)
@@ -27,3 +28,14 @@ bool mac_pton(const char *s, u8 *mac)
return true;
}
EXPORT_SYMBOL(mac_pton);
+
+int mac_pton_from_user(const char __user *s, size_t count, u8 *mac)
+{
+ char buf[MAC_PTON_MINLEN];
+
+ count = min(count, sizeof(buf));
+ if (copy_from_user(buf, s, count))
+ return -EFAULT;
+ return mac_pton(buf, mac) ? 0 : -EINVAL;
+}
+EXPORT_SYMBOL(mac_pton_from_user);
--
2.15.1
^ permalink raw reply related
* [PATCH v1 3/4] staging: rtl8723bs: Replace mac address parsing
From: Andy Shevchenko @ 2017-12-19 19:14 UTC (permalink / raw)
To: David S. Miller, netdev, Larry Finger, Florian Schilhabel, devel,
Greg Kroah-Hartman
Cc: Andy Shevchenko
In-Reply-To: <20171219191412.14880-1-andriy.shevchenko@linux.intel.com>
Replace copy_from_user() + sscanf() with mac_pton_from_user().
While here, replace memcpy(..., ETH_ALEN) with ether_addr_copy().
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/staging/rtl8723bs/core/rtw_debug.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/rtl8723bs/core/rtw_debug.c b/drivers/staging/rtl8723bs/core/rtw_debug.c
index b5dd244fee8f..79ac91a6c3ba 100644
--- a/drivers/staging/rtl8723bs/core/rtw_debug.c
+++ b/drivers/staging/rtl8723bs/core/rtw_debug.c
@@ -380,21 +380,15 @@ ssize_t proc_set_roam_tgt_addr(struct file *file, const char __user *buffer, siz
{
struct net_device *dev = data;
struct adapter *adapter = (struct adapter *)rtw_netdev_priv(dev);
-
- char tmp[32];
u8 addr[ETH_ALEN];
+ int ret;
- if (count < 1)
- return -EFAULT;
-
- if (buffer && !copy_from_user(tmp, buffer, sizeof(tmp))) {
-
- int num = sscanf(tmp, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", addr, addr+1, addr+2, addr+3, addr+4, addr+5);
- if (num == 6)
- memcpy(adapter->mlmepriv.roam_tgt_addr, addr, ETH_ALEN);
+ ret = mac_pton_from_user(buffer, count, addr);
+ if (ret)
+ return ret;
- DBG_871X("set roam_tgt_addr to "MAC_FMT"\n", MAC_ARG(adapter->mlmepriv.roam_tgt_addr));
- }
+ ether_addr_copy(adapter->mlmepriv.roam_tgt_addr, addr);
+ DBG_871X("set roam_tgt_addr to "MAC_FMT"\n", MAC_ARG(adapter->mlmepriv.roam_tgt_addr));
return count;
}
--
2.15.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox