* [PATCH 0/4] net: dsa: mv88e6xxx: novice fixes and irq handling
From: Uwe Kleine-König @ 2018-03-19 10:05 UTC (permalink / raw)
To: Andrew Lunn, Vivien Didelot, Marc Zyngier, Thomas Gleixner
Cc: kernel, Florian Fainelli, netdev, Gregory CLEMENT
Hello,
this is a set of patches I created while I tried to understand how DSA
works. I don't claim I already got there and so the first 3 fixes are
trivial only.
I tried to make the switch on the espressobin SBC use the interrupt line
and needed the fourth patch to make this work. Given I don't have access
to the documentation of the Marvell switch, the patch is probably not
correct though (and so doesn't have a S-o-b).
When I first added the irq as:
interrupt-parent = <&gpiosb>;
interrupts = <23 IRQ_TYPE_LEVEL_LOW>;
to the switch of the espressobin's dtb, the irq couldn't be used. The
reason is the interaction of several things:
- On the first try to probe the switch, the driver did:
irq = of_irq_get(np, 0);
request_threaded_irq(irq, NULL, func, IRQF_ONESHOT | IRQF_TRIGGER_FALLING, ...);
and then later aborted with -EPROBE_DEFER because another resource
wasn't available yet. This correctly undid the request_threaded_irq
above using free_irq.
- When the probe routine was entered again, the call to of_irq_get(np, 0)
failed becauce the irq code remembered that the irq was requested
using edge triggered logic with:
irq: type mismatch, failed to map hwirq-23 for gpio!
(kernel/irq/irqdomain.c, line 801)
Any of the following changes would make the problem disappear:
- use IRQ_TYPE_EDGE_FALLING in the device tree;
- drop IRQF_TRIGGER_FALLING from the driver's use of
request_threaded_irq() (I think, see below); and
- make the irq code forget the trigger type when the last action is
removed
I think both the second and the third should be done.
For the third, after a quick look into kernel/irq I didn't find a
suitable place where to do that and so it would be great to get some
feedback from Marc or Thomas here.
Regarding the first one: Is the irq of the switch really edge sensitive?
I didn't see the line reset to 1 after an irq was triggered. (And again,
I don't have access on the documentation of the switch.) When I tested
the second change however the driver still failed because the
gpio controller doesn't support level sensitive irqs. :-|
Looking forward to your comments
Uwe Kleine-Köníg
Uwe Kleine-König (4):
net: dsa: mv88e6xxx: Fix name of switch 88E6141
net: dsa: mv88e6xxx: Fix typo in a comment
net: dsa: mv88e6xxx: Fix interrupt name for g2 irq
net: dsa: mv88e6xxx: Guess number of g1 irqs
drivers/net/dsa/mv88e6xxx/chip.c | 6 ++++--
drivers/net/dsa/mv88e6xxx/global2.c | 2 +-
2 files changed, 5 insertions(+), 3 deletions(-)
--
2.16.2
^ permalink raw reply
* Re: WARNING: CPU: 3 PID: 0 at net/sched/sch_hfsc.c:1388 hfsc_dequeue+0x319/0x350 [sch_hfsc]
From: Jamal Hadi Salim @ 2018-03-19 10:07 UTC (permalink / raw)
To: Cong Wang, Marco Berizzi; +Cc: Linux Kernel Network Developers, Eric Dumazet
In-Reply-To: <CAM_iQpX5c6QoRZ8+oxs3P0TLwfjh2DTu4R8vUtOY8rYyweXRLQ@mail.gmail.com>
On 18-03-15 08:48 PM, Cong Wang wrote:
> On Wed, Mar 14, 2018 at 1:10 AM, Marco Berizzi <pupilla@libero.it> wrote:
>>> Il 9 marzo 2018 alle 0.14 Cong Wang <xiyou.wangcong@gmail.com> ha scritto:
>>>
>>>
>>> On Thu, Mar 8, 2018 at 8:02 AM, Marco Berizzi <pupilla@libero.it> wrote:
>>>>> Marco Berizzi wrote:
>>>>>
>>>>>
>>>>> Hello everyone,
>>>>>
>>>>> Yesterday I got this error on a slackware linux 4.16-rc4 system
>>>>> running as a traffic shaping gateway and netfilter nat.
>>>>> The error has been arisen after a partial ISP network outage,
>>>>> so unfortunately it will not trivial for me to reproduce it again.
>>>>
>>>> Hello everyone,
>>>>
>>>> I'm getting this error twice/day, so fortunately I'm able to
>>>> reproduce it.
>>>
>>> IIRC, there was a patch for this, but it got lost...
>>>
>>> I will take a look anyway.
>>
>> ok, thanks for the response. Let me know when there will be a patch
>> available to test.
>
> It has been reported here:
> https://bugzilla.kernel.org/show_bug.cgi?id=109581
>
> And there is a workaround from Konstantin:
> https://patchwork.ozlabs.org/patch/803885/
>
> Unfortunately I don't think that is a real fix, we probably need to
> fix HFSC itself rather than just workaround the qlen==0. It is not
> trivial since HFSC implementation is not easy to understand.
> Maybe Jamal knows better than me.
>
Sorry for the latency - I looked at this on the plane and it is very
specific to fq/codel. It is not clear to me why codel needs this but
i note it has been there from the initial commit and from that
perspective the patch looks reasonable. In any case:
Punting it to Eric (on Cc).
cheers,
jamal
> Thanks
>
^ permalink raw reply
* Re: [rds-devel] [PATCH RFC RFC] rds: Use NETDEV_UNREGISTER in rds_tcp_dev_event() (then kill NETDEV_UNREGISTER_FINAL)
From: Kirill Tkhai @ 2018-03-19 10:08 UTC (permalink / raw)
To: Sowmini Varadhan; +Cc: rds-devel, linux-rdma, netdev, edumazet, davem
In-Reply-To: <20180318204520.GA14963@oracle.com>
Hi, Sowmini,
thanks for looking into this.
On 18.03.2018 23:45, Sowmini Varadhan wrote:
> On (03/18/18 00:55), Kirill Tkhai wrote:
>>
>> I just want to make rds not using NETDEV_UNREGISTER_FINAL. If there is
>> another solution to do that, I'm not again that.
>
> The patch below takes care of this. I've done some preliminary testing,
> and I'll send it upstream after doing additional self-review/testing.
> Please also take a look, if you can, to see if I missed something.
>
> Thanks for the input,
>
> --Sowmini
> -------------------------------patch follows--------------------------------
>
> diff --git a/net/rds/tcp.c b/net/rds/tcp.c
> index 08ea9cd..87c2643 100644
> --- a/net/rds/tcp.c
> +++ b/net/rds/tcp.c
> @@ -485,40 +485,6 @@ static __net_init int rds_tcp_init_net(struct net *net)
> return err;
> }
>
> -static void __net_exit rds_tcp_exit_net(struct net *net)
> -{
> - struct rds_tcp_net *rtn = net_generic(net, rds_tcp_netid);
> -
> - if (rtn->rds_tcp_sysctl)
> - unregister_net_sysctl_table(rtn->rds_tcp_sysctl);
> -
> - if (net != &init_net && rtn->ctl_table)
> - kfree(rtn->ctl_table);
> -
> - /* If rds_tcp_exit_net() is called as a result of netns deletion,
> - * the rds_tcp_kill_sock() device notifier would already have cleaned
> - * up the listen socket, thus there is no work to do in this function.
> - *
> - * If rds_tcp_exit_net() is called as a result of module unload,
> - * i.e., due to rds_tcp_exit() -> unregister_pernet_subsys(), then
> - * we do need to clean up the listen socket here.
> - */
> - if (rtn->rds_tcp_listen_sock) {
> - struct socket *lsock = rtn->rds_tcp_listen_sock;
> -
> - rtn->rds_tcp_listen_sock = NULL;
> - rds_tcp_listen_stop(lsock, &rtn->rds_tcp_accept_w);
> - }
> -}
> -
> -static struct pernet_operations rds_tcp_net_ops = {
> - .init = rds_tcp_init_net,
> - .exit = rds_tcp_exit_net,
> - .id = &rds_tcp_netid,
> - .size = sizeof(struct rds_tcp_net),
> - .async = true,
> -};
> -
> static void rds_tcp_kill_sock(struct net *net)
> {
> struct rds_tcp_connection *tc, *_tc;
> @@ -546,40 +512,38 @@ static void rds_tcp_kill_sock(struct net *net)
> rds_conn_destroy(tc->t_cpath->cp_conn);
> }
>
> -void *rds_tcp_listen_sock_def_readable(struct net *net)
> +static void __net_exit rds_tcp_exit_net(struct net *net)
> {
> struct rds_tcp_net *rtn = net_generic(net, rds_tcp_netid);
> - struct socket *lsock = rtn->rds_tcp_listen_sock;
>
> - if (!lsock)
> - return NULL;
> + rds_tcp_kill_sock(net);
rds_tcp_listen_sock destruction looks nice and safe, since all
the places the sockets is dereferenced use sk_callback_lock.
So they don't miss rds_tcp_listen_sock = NULL, as rds_tcp_listen_stop()
takes the lock too.
rds_tcp_conn_list is populated from:
1)rds_tcp_accept_one(), which can't happen after we flushed the queue
in rds_tcp_listen_stop();
2)rds_sendmsg(), which is triggered by userspace, and that's impossible,
when net is dead;
3)rds_ib_cm_handle_connect(), which call rds_conn_create() with init_net
argument only. This may race with module unloading only, but this problem
is already solved in RDS by rds_destroy_pending() check, which care about
that:
static bool rds_tcp_is_unloading(struct rds_connection *conn)
{
return atomic_read(&rds_tcp_unloading) != 0;
}
static void rds_tcp_exit(void)
{
rds_tcp_set_unloading();
synchronize_rcu();
...
}
static struct rds_connection * __rds_conn_create(...)
{
...
rcu_read_lock();
if (rds_destroy_pending(conn))
ret = -ENETDOWN;
else
ret = trans->conn_alloc(conn, GFP_ATOMIC);
...
}
So, everything looks good for me.
Kirill
>
> - return lsock->sk->sk_user_data;
> + if (rtn->rds_tcp_sysctl)
> + unregister_net_sysctl_table(rtn->rds_tcp_sysctl);
> +
> + if (net != &init_net && rtn->ctl_table)
> + kfree(rtn->ctl_table);
> }
>
> -static int rds_tcp_dev_event(struct notifier_block *this,
> - unsigned long event, void *ptr)
> +static struct pernet_operations rds_tcp_net_ops = {
> + .init = rds_tcp_init_net,
> + .exit = rds_tcp_exit_net,
> + .id = &rds_tcp_netid,
> + .size = sizeof(struct rds_tcp_net),
> + .async = true,
> +};
> +
> +void *rds_tcp_listen_sock_def_readable(struct net *net)
> {
> - struct net_device *dev = netdev_notifier_info_to_dev(ptr);
> + struct rds_tcp_net *rtn = net_generic(net, rds_tcp_netid);
> + struct socket *lsock = rtn->rds_tcp_listen_sock;
>
> - /* rds-tcp registers as a pernet subys, so the ->exit will only
> - * get invoked after network acitivity has quiesced. We need to
> - * clean up all sockets to quiesce network activity, and use
> - * the unregistration of the per-net loopback device as a trigger
> - * to start that cleanup.
> - */
> - if (event == NETDEV_UNREGISTER_FINAL &&
> - dev->ifindex == LOOPBACK_IFINDEX)
> - rds_tcp_kill_sock(dev_net(dev));
> + if (!lsock)
> + return NULL;
>
> - return NOTIFY_DONE;
> + return lsock->sk->sk_user_data;
> }
>
> -static struct notifier_block rds_tcp_dev_notifier = {
> - .notifier_call = rds_tcp_dev_event,
> - .priority = -10, /* must be called after other network notifiers */
> -};
> -
> /* when sysctl is used to modify some kernel socket parameters,this
> * function resets the RDS connections in that netns so that we can
> * restart with new parameters. The assumption is that such reset
> @@ -625,9 +589,7 @@ static void rds_tcp_exit(void)
> rds_tcp_set_unloading();
> synchronize_rcu();
> rds_info_deregister_func(RDS_INFO_TCP_SOCKETS, rds_tcp_tc_info);
> - unregister_pernet_subsys(&rds_tcp_net_ops);
> - if (unregister_netdevice_notifier(&rds_tcp_dev_notifier))
> - pr_warn("could not unregister rds_tcp_dev_notifier\n");
> + unregister_pernet_device(&rds_tcp_net_ops);
> rds_tcp_destroy_conns();
> rds_trans_unregister(&rds_tcp_transport);
> rds_tcp_recv_exit();
> @@ -651,24 +613,17 @@ static int rds_tcp_init(void)
> if (ret)
> goto out_slab;
>
> - ret = register_pernet_subsys(&rds_tcp_net_ops);
> + ret = register_pernet_device(&rds_tcp_net_ops);
> if (ret)
> goto out_recv;
>
> - ret = register_netdevice_notifier(&rds_tcp_dev_notifier);
> - if (ret) {
> - pr_warn("could not register rds_tcp_dev_notifier\n");
> - goto out_pernet;
> - }
> -
> rds_trans_register(&rds_tcp_transport);
>
> rds_info_register_func(RDS_INFO_TCP_SOCKETS, rds_tcp_tc_info);
>
> goto out;
>
> -out_pernet:
> - unregister_pernet_subsys(&rds_tcp_net_ops);
> + unregister_pernet_device(&rds_tcp_net_ops);
> out_recv:
> rds_tcp_recv_exit();
> out_slab:
^ permalink raw reply
* Re: [bpf-next V3 PATCH 00/15] XDP redirect memory return API
From: Jesper Dangaard Brouer @ 2018-03-19 10:10 UTC (permalink / raw)
To: Jason Wang
Cc: netdev, BjörnTöpel, magnus.karlsson, eugenia,
John Fastabend, Eran Ben Elisha, Saeed Mahameed, galp,
Daniel Borkmann, Alexei Starovoitov, Tariq Toukan, brouer
In-Reply-To: <0cb14140-5632-8b07-9088-2adb7dfedc0b@redhat.com>
On Fri, 16 Mar 2018 17:04:17 +0800
Jason Wang <jasowang@redhat.com> wrote:
> Looks like the series forget to register memory model for tun and
> virtio-net.
Well, no. It is actually not strictly necessary to invoke
xdp_rxq_info_reg_mem_model() because enum MEM_TYPE_PAGE_SHARED == 0.
And if not passing an allocator pointer to the call, then an mem_id is
not registered... and __xdp_return_frame() skips the rhashtable_lookup.
I designed the API this way, because I want to support later adding an
allocator even for the refcnt scheme MEM_TYPE_PAGE_SHARED. (As it
would be a performance optimization to return the pages to the
originating RX-CPU, and move the page refcnt dec back to that orig CPU).
I did add an xdp_rxq_info_reg_mem_model() call to ixgbe, for human
programmer "documentation" even-though it isn't strickly necessary. I
guess, I could add similar calls to tun and virtio_net, and then we
avoid any implicit assumptions. And makes it more clear that
XDP_REDIRECT support use the memory model return API.
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
^ permalink raw reply
* [PATCH] can: cc770: Fix use after free in cc770_tx_interrupt()
From: Marc Kleine-Budde @ 2018-03-19 10:14 UTC (permalink / raw)
To: netdev
Cc: davem, linux-can, kernel, Andri Yngvason, linux-stable,
Marc Kleine-Budde
In-Reply-To: <20180319101431.11032-1-mkl@pengutronix.de>
From: Andri Yngvason <andri.yngvason@marel.com>
This fixes use after free introduced by the last cc770 patch.
Signed-off-by: Andri Yngvason <andri.yngvason@marel.com>
Fixes: 746201235b3f ("can: cc770: Fix queue stall & dropped RTR reply")
Cc: linux-stable <stable@vger.kernel.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
drivers/net/can/cc770/cc770.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/can/cc770/cc770.c b/drivers/net/can/cc770/cc770.c
index 2743d82d4424..6da69af103e6 100644
--- a/drivers/net/can/cc770/cc770.c
+++ b/drivers/net/can/cc770/cc770.c
@@ -706,13 +706,12 @@ static void cc770_tx_interrupt(struct net_device *dev, unsigned int o)
return;
}
- can_put_echo_skb(priv->tx_skb, dev, 0);
- can_get_echo_skb(dev, 0);
-
cf = (struct can_frame *)priv->tx_skb->data;
stats->tx_bytes += cf->can_dlc;
stats->tx_packets++;
+ can_put_echo_skb(priv->tx_skb, dev, 0);
+ can_get_echo_skb(dev, 0);
priv->tx_skb = NULL;
netif_wake_queue(dev);
--
2.16.2
^ permalink raw reply related
* pull-request: can 2018-03-19
From: Marc Kleine-Budde @ 2018-03-19 10:14 UTC (permalink / raw)
To: netdev; +Cc: davem, linux-can, kernel
Hello David,
this is a pull reqeust of one patch for net/master.
The patch is by Andri Yngvason and fixes a potential use-after-free bug
in the cc770 driver introduced in the previous pull-request.
regards,
Marc
---
The following changes since commit a069215cf5985f3aa1bba550264907d6bd05c5f7:
net: fec: Fix unbalanced PM runtime calls (2018-03-18 16:32:47 -0400)
are available in the Git repository at:
ssh://git@gitolite.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git tags/linux-can-fixes-for-4.16-20180319
for you to fetch changes up to 9ffd7503944ec7c0ef41c3245d1306c221aef2be:
can: cc770: Fix use after free in cc770_tx_interrupt() (2018-03-19 10:57:29 +0100)
----------------------------------------------------------------
linux-can-fixes-for-4.16-20180319
----------------------------------------------------------------
Andri Yngvason (1):
can: cc770: Fix use after free in cc770_tx_interrupt()
drivers/net/can/cc770/cc770.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
^ permalink raw reply
* Re: [PATCH net 0/3] vti4, ip_tunnel: Fixes for MTU assignment and validation
From: Steffen Klassert @ 2018-03-19 10:20 UTC (permalink / raw)
To: David Miller; +Cc: sbrivio, sd, herbert, pshelar, netdev
In-Reply-To: <20180317.194613.723246862858267769.davem@davemloft.net>
On Sat, Mar 17, 2018 at 07:46:13PM -0400, David Miller wrote:
> From: Stefano Brivio <sbrivio@redhat.com>
> Date: Thu, 15 Mar 2018 17:16:26 +0100
>
> > Patch 1/3 re-introduces a fix to ensure that default MTU on new
> > link is not lowered unnecessarily because of double counting of
> > headers. This fix was originally introduced in 2014 and got lost
> > in a merge commit shortly afterwards.
> >
> > Patches 2/3 and 3/3 ensure that MTU passed from userspace on link
> > creation is taken into account and also properly validated.
>
> Steffen, I am assuming that you will pick up this series and the
> subsequent one dealing with vti6.
Yes, series is now applied to the ipsec tree.
Thanks a lot!
^ permalink raw reply
* Re: [PATCH net 0/3] vti6: Fixes for MTU assignment and validation
From: Steffen Klassert @ 2018-03-19 10:20 UTC (permalink / raw)
To: Stefano Brivio
Cc: David S . Miller, Sabrina Dubroca, Herbert Xu, Alexey Kodanev,
Jarod Wilson, netdev
In-Reply-To: <cover.1521128962.git.sbrivio@redhat.com>
On Thu, Mar 15, 2018 at 05:17:10PM +0100, Stefano Brivio wrote:
> This series introduces fixes to ensure that default MTU
> assignment for vti6 is properly calculated (and to make it
> consistent with vti4), to ensure we always use the MTU from
> userspace (and validate it), if given, when a link is created or
> changed, and that the MTU upper bound is properly set.
>
> Stefano Brivio (3):
> vti6: Properly adjust vti6 MTU from MTU of lower device
> vti6: Keep set MTU on link creation or change, validate it
> vti6: Fix dev->max_mtu setting
>
> net/ipv6/ip6_vti.c | 36 +++++++++++++++++++++++-------------
> 1 file changed, 23 insertions(+), 13 deletions(-)
Also applied, thanks Stefano!
^ permalink raw reply
* [PATCH net] ipv6: old_dport should be a __be16 in __ip6_datagram_connect()
From: Stefano Brivio @ 2018-03-19 10:24 UTC (permalink / raw)
To: David S . Miller; +Cc: Paolo Abeni, Wei Wang, Guillaume Nault, netdev
Fixes: 2f987a76a977 ("net: ipv6: keep sk status consistent after datagram connect failure")
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Acked-by: Paolo Abeni <pabeni@redhat.com>
---
net/ipv6/datagram.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c
index 8a9ac2d0f5d3..a9f7eca0b6a3 100644
--- a/net/ipv6/datagram.c
+++ b/net/ipv6/datagram.c
@@ -149,7 +149,7 @@ int __ip6_datagram_connect(struct sock *sk, struct sockaddr *uaddr,
struct in6_addr *daddr, old_daddr;
__be32 fl6_flowlabel = 0;
__be32 old_fl6_flowlabel;
- __be32 old_dport;
+ __be16 old_dport;
int addr_type;
int err;
--
2.15.1
^ permalink raw reply related
* [PATCH] rtlwifi: rtl8821ae: fix spelling mistake: "Aboslute" -> "Absolute"
From: Colin King @ 2018-03-19 10:40 UTC (permalink / raw)
To: Ping-Ke Shih, Kalle Valo, Tsang-Shian Lin, Larry Finger,
linux-wireless, netdev
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
Trivial fix to spelling mistake in RT_TRACE message text.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
index b11365a5ee1f..9111ba7ff0a1 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/dm.c
@@ -1475,7 +1475,7 @@ void rtl8812ae_dm_txpwr_track_set_pwr(struct ieee80211_hw *hw,
}
} else if (method == MIX_MODE) {
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
- "pDM_Odm->DefaultOfdmIndex=%d, pDM_Odm->Aboslute_OFDMSwingIdx[RFPath]=%d, RF_Path = %d\n",
+ "pDM_Odm->DefaultOfdmIndex=%d, pDM_Odm->Absolute_OFDMSwingIdx[RFPath]=%d, RF_Path = %d\n",
rtldm->default_ofdm_index,
rtldm->absolute_ofdm_swing_idx[rf_path],
rf_path);
@@ -1750,7 +1750,7 @@ void rtl8812ae_dm_txpower_tracking_callback_thermalmeter(
/*Record delta swing for mix mode power tracking*/
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
- "******Temp is higher and pDM_Odm->Aboslute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n",
+ "******Temp is higher and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n",
rtldm->absolute_ofdm_swing_idx[RF90_PATH_A]);
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
@@ -1766,7 +1766,7 @@ void rtl8812ae_dm_txpower_tracking_callback_thermalmeter(
/*Record delta swing for mix mode power tracking*/
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
- "******Temp is higher and pDM_Odm->Aboslute_OFDMSwingIdx[ODM_RF_PATH_B] = %d\n",
+ "******Temp is higher and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = %d\n",
rtldm->absolute_ofdm_swing_idx[RF90_PATH_B]);
} else {
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
@@ -1782,7 +1782,7 @@ void rtl8812ae_dm_txpower_tracking_callback_thermalmeter(
-1 * delta_swing_table_idx_tdown_a[delta];
/* Record delta swing for mix mode power tracking*/
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
- "******Temp is lower and pDM_Odm->Aboslute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n",
+ "******Temp is lower and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n",
rtldm->absolute_ofdm_swing_idx[RF90_PATH_A]);
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
@@ -1799,7 +1799,7 @@ void rtl8812ae_dm_txpower_tracking_callback_thermalmeter(
/*Record delta swing for mix mode power tracking*/
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
- "******Temp is lower and pDM_Odm->Aboslute_OFDMSwingIdx[ODM_RF_PATH_B] = %d\n",
+ "******Temp is lower and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = %d\n",
rtldm->absolute_ofdm_swing_idx[RF90_PATH_B]);
}
@@ -2115,7 +2115,7 @@ void rtl8821ae_dm_txpwr_track_set_pwr(struct ieee80211_hw *hw,
}
} else if (method == MIX_MODE) {
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
- "pDM_Odm->DefaultOfdmIndex=%d,pDM_Odm->Aboslute_OFDMSwingIdx[RFPath]=%d, RF_Path = %d\n",
+ "pDM_Odm->DefaultOfdmIndex=%d,pDM_Odm->Absolute_OFDMSwingIdx[RFPath]=%d, RF_Path = %d\n",
rtldm->default_ofdm_index,
rtldm->absolute_ofdm_swing_idx[rf_path],
rf_path);
@@ -2329,7 +2329,7 @@ void rtl8821ae_dm_txpower_tracking_callback_thermalmeter(
/*Record delta swing for mix mode power tracking*/
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
- "******Temp is higher and pDM_Odm->Aboslute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n",
+ "******Temp is higher and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n",
rtldm->absolute_ofdm_swing_idx[RF90_PATH_A]);
} else {
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
@@ -2345,7 +2345,7 @@ void rtl8821ae_dm_txpower_tracking_callback_thermalmeter(
-1 * delta_swing_table_idx_tdown_a[delta];
/* Record delta swing for mix mode power tracking*/
RT_TRACE(rtlpriv, COMP_POWER_TRACKING, DBG_LOUD,
- "******Temp is lower and pDM_Odm->Aboslute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n",
+ "******Temp is lower and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n",
rtldm->absolute_ofdm_swing_idx[RF90_PATH_A]);
}
--
2.15.1
^ permalink raw reply related
* Re: [PATCH v5 2/2] Remove false-positive VLAs when using max()
From: Andrey Ryabinin @ 2018-03-19 10:45 UTC (permalink / raw)
To: Kees Cook, Andrew Morton
Cc: Linus Torvalds, Josh Poimboeuf, Rasmus Villemoes, Randy Dunlap,
Miguel Ojeda, Ingo Molnar, David Laight, Ian Abbott, linux-input,
linux-btrfs, netdev, linux-kernel, kernel-hardening
In-Reply-To: <1521174359-46392-3-git-send-email-keescook@chromium.org>
On 03/16/2018 07:25 AM, Kees Cook wrote:
> As part of removing VLAs from the kernel[1], we want to build with -Wvla,
> but it is overly pessimistic and only accepts constant expressions for
> stack array sizes, instead of also constant values. The max() macro
> triggers the warning, so this refactors these uses of max() to use the
> new const_max() instead.
>
> [1] https://lkml.org/lkml/2018/3/7/621
>
> Signed-off-by: Kees Cook <keescook@chromium.org>
> ---
> drivers/input/touchscreen/cyttsp4_core.c | 2 +-
> fs/btrfs/tree-checker.c | 3 ++-
> lib/vsprintf.c | 5 +++--
> net/ipv4/proc.c | 8 ++++----
> net/ipv6/proc.c | 11 +++++------
> 5 files changed, 15 insertions(+), 14 deletions(-)
>
FWIW, the patch below is alternative way to deal with these (Note, I didn't test my patch, just demonstrating the idea).
It's quite simple, and should work on any gcc version.
This approach wouldn't work well for CONFIG dependent max values, especially in case of single constant
expression being dependent on several config options, but it seems we don't have any these.
drivers/input/touchscreen/cyttsp4_core.c | 3 ++-
fs/btrfs/tree-checker.c | 3 ++-
lib/vsprintf.c | 6 ++++--
net/ipv4/proc.c | 4 +++-
net/ipv6/proc.c | 6 ++++--
5 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/drivers/input/touchscreen/cyttsp4_core.c b/drivers/input/touchscreen/cyttsp4_core.c
index 727c3232517c..ce546a3fad3d 100644
--- a/drivers/input/touchscreen/cyttsp4_core.c
+++ b/drivers/input/touchscreen/cyttsp4_core.c
@@ -868,7 +868,8 @@ static void cyttsp4_get_mt_touches(struct cyttsp4_mt_data *md, int num_cur_tch)
struct cyttsp4_touch tch;
int sig;
int i, j, t = 0;
- int ids[max(CY_TMA1036_MAX_TCH, CY_TMA4XX_MAX_TCH)];
+ int ids[CY_TMA4XX_MAX_TCH];
+ BUILD_BUG_ON(CY_TMA1036_MAX_TCH > CY_TMA4XX_MAX_TCH);
memset(ids, 0, si->si_ofs.tch_abs[CY_TCH_T].max * sizeof(int));
for (i = 0; i < num_cur_tch; i++) {
diff --git a/fs/btrfs/tree-checker.c b/fs/btrfs/tree-checker.c
index 8871286c1a91..ad4c2fea572f 100644
--- a/fs/btrfs/tree-checker.c
+++ b/fs/btrfs/tree-checker.c
@@ -346,7 +346,8 @@ static int check_dir_item(struct btrfs_fs_info *fs_info,
*/
if (key->type == BTRFS_DIR_ITEM_KEY ||
key->type == BTRFS_XATTR_ITEM_KEY) {
- char namebuf[max(BTRFS_NAME_LEN, XATTR_NAME_MAX)];
+ char namebuf[BTRFS_NAME_LEN];
+ BUILD_BUG_ON(XATTR_NAME_MAX > BTRFS_NAME_LEN);
read_extent_buffer(leaf, namebuf,
(unsigned long)(di + 1), name_len);
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 942b5234a59b..fa081d684660 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -754,13 +754,15 @@ char *resource_string(char *buf, char *end, struct resource *res,
#define FLAG_BUF_SIZE (2 * sizeof(res->flags))
#define DECODED_BUF_SIZE sizeof("[mem - 64bit pref window disabled]")
#define RAW_BUF_SIZE sizeof("[mem - flags 0x]")
- char sym[max(2*RSRC_BUF_SIZE + DECODED_BUF_SIZE,
- 2*RSRC_BUF_SIZE + FLAG_BUF_SIZE + RAW_BUF_SIZE)];
+ char sym[2*RSRC_BUF_SIZE + DECODED_BUF_SIZE];
char *p = sym, *pend = sym + sizeof(sym);
int decode = (fmt[0] == 'R') ? 1 : 0;
const struct printf_spec *specp;
+ BUILD_BUG_ON((2*RSRC_BUF_SIZE + FLAG_BUF_SIZE + RAW_BUF_SIZE) >
+ (2*RSRC_BUF_SIZE + DECODED_BUF_SIZE));
+
*p++ = '[';
if (res->flags & IORESOURCE_IO) {
p = string(p, pend, "io ", str_spec);
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c
index d97e83b2dd33..9d08749de8d0 100644
--- a/net/ipv4/proc.c
+++ b/net/ipv4/proc.c
@@ -46,7 +46,7 @@
#include <net/sock.h>
#include <net/raw.h>
-#define TCPUDP_MIB_MAX max_t(u32, UDP_MIB_MAX, TCP_MIB_MAX)
+#define TCPUDP_MIB_MAX TCP_MIB_MAX
/*
* Report socket allocation statistics [mea@utu.fi]
@@ -404,6 +404,8 @@ static int snmp_seq_show_tcp_udp(struct seq_file *seq, void *v)
struct net *net = seq->private;
int i;
+ BUILD_BUG_ON(UDP_MIB_MAX > TCP_MIB_MAX);
+
memset(buff, 0, TCPUDP_MIB_MAX * sizeof(unsigned long));
seq_puts(seq, "\nTcp:");
diff --git a/net/ipv6/proc.c b/net/ipv6/proc.c
index 1678cf037688..3ad91dae7324 100644
--- a/net/ipv6/proc.c
+++ b/net/ipv6/proc.c
@@ -32,8 +32,7 @@
#define MAX4(a, b, c, d) \
max_t(u32, max_t(u32, a, b), max_t(u32, c, d))
-#define SNMP_MIB_MAX MAX4(UDP_MIB_MAX, TCP_MIB_MAX, \
- IPSTATS_MIB_MAX, ICMP_MIB_MAX)
+#define SNMP_MIB_MAX IPSTATS_MIB_MAX
static int sockstat6_seq_show(struct seq_file *seq, void *v)
{
@@ -198,6 +197,9 @@ static void snmp6_seq_show_item(struct seq_file *seq, void __percpu *pcpumib,
unsigned long buff[SNMP_MIB_MAX];
int i;
+ BUILD_BUG_ON(MAX4(UDP_MIB_MAX, TCP_MIB_MAX,
+ IPSTATS_MIB_MAX, ICMP_MIB_MAX) > SNMP_MIB_MAX);
+
if (pcpumib) {
memset(buff, 0, sizeof(unsigned long) * SNMP_MIB_MAX);
--
2.16.1
^ permalink raw reply related
* [PATCH] ncpfs: memory corruption in ncp_read_kernel()
From: Dan Carpenter @ 2018-03-19 11:07 UTC (permalink / raw)
To: Petr Vandrovec
Cc: devel, security, Greg Kroah-Hartman, netdev, Philippe Ombredanne,
Thomas Gleixner, David S. Miller
In-Reply-To: <CA+ygN1LiXW3uNuMS-eRv5Y_WJNyyr77+Rgycec4Y-Ju2VGrNWA@mail.gmail.com>
If the server is malicious then *bytes_read could be larger than the
size of the "target" buffer. It would lead to memory corruption when we
do the memcpy().
Reported-by: Dr Silvio Cesare of InfoSect <Silvio Cesare <silvio.cesare@gmail.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/staging/ncpfs/ncplib_kernel.c b/drivers/staging/ncpfs/ncplib_kernel.c
index 804adfebba2f..3e047eb4cc7c 100644
--- a/drivers/staging/ncpfs/ncplib_kernel.c
+++ b/drivers/staging/ncpfs/ncplib_kernel.c
@@ -981,6 +981,10 @@ ncp_read_kernel(struct ncp_server *server, const char *file_id,
goto out;
}
*bytes_read = ncp_reply_be16(server, 0);
+ if (*bytes_read > to_read) {
+ result = -EINVAL;
+ goto out;
+ }
source = ncp_reply_data(server, 2 + (offset & 1));
memcpy(target, source, *bytes_read);
^ permalink raw reply related
* Re: [PATCH net-next 02/10] net: phy: phylink: allow 10GKR interface to use in-band negotiation
From: Russell King - ARM Linux @ 2018-03-19 11:12 UTC (permalink / raw)
To: Antoine Tenart
Cc: davem, kishon, gregory.clement, andrew, jason,
sebastian.hesselbarth, netdev, linux-kernel, thomas.petazzoni,
maxime.chevallier, miquel.raynal, nadavh, stefanc, ymarkman, mw,
linux-arm-kernel
In-Reply-To: <20180319085252.GF4519@kwain>
On Mon, Mar 19, 2018 at 09:52:52AM +0100, Antoine Tenart wrote:
> Hi Russell,
>
> On Fri, Mar 16, 2018 at 03:53:07PM +0000, Russell King - ARM Linux wrote:
> > On Fri, Mar 16, 2018 at 11:33:43AM +0100, Antoine Tenart wrote:
> > > The PHY mode 10GKR can use in-band negotiation. This patches allows this
> > > mode to be used with MLO_AN_INBAND in phylink.
> > >
> > > Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
> > > ---
> > > drivers/net/phy/phylink.c | 3 ++-
> > > 1 file changed, 2 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
> > > index 51a011a349fe..7224b005f0dd 100644
> > > --- a/drivers/net/phy/phylink.c
> > > +++ b/drivers/net/phy/phylink.c
> > > @@ -768,7 +768,8 @@ int phylink_of_phy_connect(struct phylink *pl, struct device_node *dn,
> > > /* Fixed links and 802.3z are handled without needing a PHY */
> > > if (pl->link_an_mode == MLO_AN_FIXED ||
> > > (pl->link_an_mode == MLO_AN_INBAND &&
> > > - phy_interface_mode_is_8023z(pl->link_interface)))
> > > + (phy_interface_mode_is_8023z(pl->link_interface) ||
> > > + pl->link_interface == PHY_INTERFACE_MODE_10GKR)))
> >
> > There is no inband negotiation like there is with 802.3z or SGMII,
> > so this makes no sense.
>
> Oh, that's what I feared. I read some docs but probably will need more
> :)
>
> Anyway, the reason to use in-band negotiation was also to avoid using
> fixed-link. It would work but always report the link is up, which for
> the user isn't a great experience as we have a way to detect this.
>
> What would you suggest to achieve this in a reasonable way?
The intention of this test in phylink_of_phy_connect() is to avoid
failing when there is no requirement for a PHY to be present (such as
a fixed link, or an 802.3z link.) However, with 10G PHYs such as the
3310, we need the PHY so we can read the speed from it, and so know
whether to downgrade the MAC to SGMII mode, or having downgraded the
MAC, upgrade it back to 10G mode when the PHY switches to 10G.
I'm guessing that you're wanting this for the DB boards, but I don't
see why. Do they not have PHYs?
--
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 8.8Mbps down 630kbps up
According to speedtest.net: 8.21Mbps down 510kbps up
^ permalink raw reply
* Re: [PATCH net 4/7] net: aquantia: Add aq_tx_clean_budget and valid budget handling logic
From: Igor Russkikh @ 2018-03-19 11:18 UTC (permalink / raw)
To: David Miller; +Cc: netdev, darcari, pavel.belous
In-Reply-To: <20180316.145137.1684632029426990322.davem@davemloft.net>
Hi David,
Thanks for the comments.
>>
>> +unsigned aq_tx_clean_budget = 256;
>> +module_param_named(aq_tx_clean_budget, aq_tx_clean_budget, uint, 0644);
>> +MODULE_PARM_DESC(aq_tx_clean_budget, "Maximum descriptors to cleanup on TX at once");
>> +
>> static void aq_nic_update_ndev_stats(struct aq_nic_s *self);
>
> Please do not add driver private module parameter knobs like this.
>
> Instead, please use a existing, device agnostic, runtime,
> configuration mechanism to control this.
I'm not aware of any existing standard way to configure tx cleanup budget.
Many drivers just have it hardcoded via define. Is that what you suggest then?
BR, Igor
^ permalink raw reply
* Re: [PATCH net 0/7] fix idr leak in actions
From: Jamal Hadi Salim @ 2018-03-19 11:32 UTC (permalink / raw)
To: Davide Caratti, Cong Wang, Jiri Pirko, David S. Miller; +Cc: netdev
In-Reply-To: <cover.1521417146.git.dcaratti@redhat.com>
On 18-03-18 08:06 PM, Davide Caratti wrote:
> This series fixes situations where a temporary failure to install a TC
> action results in the permanent impossibility to reuse the configured
> 'index'.
>
> Thanks to Cong Wang for the initial review.
>
Yikes ;->
These patches look good.
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Davide, Can you please contribute your tests to tdc?
Those test would have for sure caught that.
cheers,
jamal
^ permalink raw reply
* [PATCH net-next can] Converting pernet_operations (part #9)
From: Kirill Tkhai @ 2018-03-19 11:38 UTC (permalink / raw)
To: davem, socketcan, mkl, linux-can, netdev, ktkhai
Hi,
this series continues to review and to convert pernet_operations
to make them possible to be executed in parallel for several
net namespaces at the same time. There is only one patch converting
can_pernet_ops.
Thanks,
Kirill
---
Kirill Tkhai (1):
net: Convert can_pernet_ops
net/can/af_can.c | 1 +
1 file changed, 1 insertion(+)
--
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
^ permalink raw reply
* [PATCH net-next] net: Convert can_pernet_ops
From: Kirill Tkhai @ 2018-03-19 11:39 UTC (permalink / raw)
To: davem, socketcan, mkl, linux-can, netdev, ktkhai
In-Reply-To: <152145944801.26024.17416146842279639788.stgit@localhost.localdomain>
These pernet_operations create and destroy /proc entries
and cancel per-net timer.
Also, there are unneed iterations over empty list of net
devices, since all net devices must be already moved
to init_net or unregistered by default_device_ops. This
already was mentioned here:
https://marc.info/?l=linux-can&m=150169589119335&w=2
So, it looks safe to make them async.
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
net/can/af_can.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/can/af_can.c b/net/can/af_can.c
index 6da324550eec..e899970398a1 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -954,6 +954,7 @@ static struct notifier_block can_netdev_notifier __read_mostly = {
static struct pernet_operations can_pernet_ops __read_mostly = {
.init = can_pernet_init,
.exit = can_pernet_exit,
+ .async = true,
};
static __init int can_init(void)
^ permalink raw reply related
* [PATCH net-next 0/2] Converting pernet_operations (part #10)
From: Kirill Tkhai @ 2018-03-19 11:45 UTC (permalink / raw)
To: alex.aring, stefan, davem, pablo, kadlec, fw, yoshfuji, brouer,
keescook, ktkhai, linux-wpan, netdev, netfilter-devel
Hi,
this series continues to review and to convert pernet_operations
to make them possible to be executed in parallel for several
net namespaces at the same time. There are two ops similar
to already converted ip4_frags_ops.
This requires a560002437d3 "net: Fix hlist corruptions
in inet_evict_bucket()", which is currently in net.git.
It seems to be the finial convertion series.
Thanks,
Kirill
---
Kirill Tkhai (2):
net: Convert lowpan_frags_ops
net: Convert nf_ct_net_ops
net/ieee802154/6lowpan/reassembly.c | 1 +
net/ipv6/netfilter/nf_conntrack_reasm.c | 1 +
2 files changed, 2 insertions(+)
--
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
^ permalink raw reply
* [PATCH net-next 1/2] net: Convert lowpan_frags_ops
From: Kirill Tkhai @ 2018-03-19 11:45 UTC (permalink / raw)
To: alex.aring, stefan, davem, pablo, kadlec, fw, yoshfuji, brouer,
keescook, ktkhai, linux-wpan, netdev, netfilter-devel
In-Reply-To: <152145973147.26348.4080298027358158796.stgit@localhost.localdomain>
These pernet_operations register and unregister sysctl.
Also, there is inet_frags_exit_net() called in exit method,
which has to be safe after a560002437d3 "net: Fix hlist
corruptions in inet_evict_bucket()".
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
net/ieee802154/6lowpan/reassembly.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ieee802154/6lowpan/reassembly.c b/net/ieee802154/6lowpan/reassembly.c
index 85bf86ad6b18..a9ccb1322f69 100644
--- a/net/ieee802154/6lowpan/reassembly.c
+++ b/net/ieee802154/6lowpan/reassembly.c
@@ -603,6 +603,7 @@ static void __net_exit lowpan_frags_exit_net(struct net *net)
static struct pernet_operations lowpan_frags_ops = {
.init = lowpan_frags_init_net,
.exit = lowpan_frags_exit_net,
+ .async = true,
};
int __init lowpan_net_frag_init(void)
^ permalink raw reply related
* [PATCH net-next 2/2] net: Convert nf_ct_net_ops
From: Kirill Tkhai @ 2018-03-19 11:45 UTC (permalink / raw)
To: alex.aring, stefan, davem, pablo, kadlec, fw, yoshfuji, brouer,
keescook, ktkhai, linux-wpan, netdev, netfilter-devel
In-Reply-To: <152145973147.26348.4080298027358158796.stgit@localhost.localdomain>
These pernet_operations register and unregister sysctl.
Also, there is inet_frags_exit_net() called in exit method,
which has to be safe after a560002437d3 "net: Fix hlist
corruptions in inet_evict_bucket()".
Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
net/ipv6/netfilter/nf_conntrack_reasm.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index b84ce3e6d728..34136fe80ed5 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -646,6 +646,7 @@ static void nf_ct_net_exit(struct net *net)
static struct pernet_operations nf_ct_net_ops = {
.init = nf_ct_net_init,
.exit = nf_ct_net_exit,
+ .async = true,
};
int nf_ct_frag6_init(void)
^ permalink raw reply related
* Re: [PATCH 1/2 v3] net: add uevent socket member
From: Kirill Tkhai @ 2018-03-19 11:53 UTC (permalink / raw)
To: Christian Brauner, ebiederm, gregkh, netdev, linux-kernel; +Cc: serge, avagin
In-Reply-To: <20180317110826.1581-1-christian.brauner@ubuntu.com>
Thanks for doing this. One small comment below.
On 17.03.2018 14:08, Christian Brauner wrote:
> This commit adds struct uevent_sock to struct net. Since struct uevent_sock
> records the position of the uevent socket in the uevent socket list we can
> trivially remove it from the uevent socket list during cleanup. This speeds
> up the old removal codepath.
> Note, list_del() will hit __list_del_entry_valid() in its call chain which
> will validate that the element is a member of the list. If it isn't it will
> take care that the list is not modified.
>
> Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
> ---
> Changelog v2->v3:
> * patch added
> This patch was split out of the follow up patch
> Subject: [PATCH 2/2 v3] netns: send uevent messages
>
> Changelog v1->v2:
> * patch not present
>
> Changelog v0->v1:
> * patch not present
> ---
> include/net/net_namespace.h | 4 +++-
> lib/kobject_uevent.c | 19 +++++++++----------
> 2 files changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
> index f306b2aa15a4..abd7d91bffac 100644
> --- a/include/net/net_namespace.h
> +++ b/include/net/net_namespace.h
> @@ -40,7 +40,7 @@ struct net_device;
> struct sock;
> struct ctl_table_header;
> struct net_generic;
> -struct sock;
> +struct uevent_sock;
> struct netns_ipvs;
>
>
> @@ -79,6 +79,8 @@ struct net {
> struct sock *rtnl; /* rtnetlink socket */
> struct sock *genl_sock;
>
> + struct uevent_sock *uevent_sock; /* uevent socket */
> +
> struct list_head dev_base_head;
> struct hlist_head *dev_name_head;
> struct hlist_head *dev_index_head;
> diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
> index 9fe6ec8fda28..cbdc60542cab 100644
> --- a/lib/kobject_uevent.c
> +++ b/lib/kobject_uevent.c
> @@ -32,11 +32,13 @@ u64 uevent_seqnum;
> #ifdef CONFIG_UEVENT_HELPER
> char uevent_helper[UEVENT_HELPER_PATH_LEN] = CONFIG_UEVENT_HELPER_PATH;
> #endif
> -#ifdef CONFIG_NET
> +
> struct uevent_sock {
> struct list_head list;
> struct sock *sk;
> };
> +
> +#ifdef CONFIG_NET
> static LIST_HEAD(uevent_sock_list);
> #endif
>
> @@ -621,6 +623,9 @@ static int uevent_net_init(struct net *net)
> kfree(ue_sk);
> return -ENODEV;
> }
> +
> + net->uevent_sock = ue_sk;
> +
> mutex_lock(&uevent_sock_mutex);
> list_add_tail(&ue_sk->list, &uevent_sock_list);
> mutex_unlock(&uevent_sock_mutex);
> @@ -629,22 +634,16 @@ static int uevent_net_init(struct net *net)
>
> static void uevent_net_exit(struct net *net)
> {
> - struct uevent_sock *ue_sk;
> + struct uevent_sock *ue_sk = net->uevent_sock;
>
> mutex_lock(&uevent_sock_mutex);
> - list_for_each_entry(ue_sk, &uevent_sock_list, list) {
> - if (sock_net(ue_sk->sk) == net)
> - goto found;
> - }
> - mutex_unlock(&uevent_sock_mutex);
> - return;
> -
> -found:
> list_del(&ue_sk->list);
> mutex_unlock(&uevent_sock_mutex);
>
> netlink_kernel_release(ue_sk->sk);
> kfree(ue_sk);
> +
> + return;
There is end of function. Doesn't return is excess here?
> }
>
> static struct pernet_operations uevent_net_ops = {
>
Kirill
^ permalink raw reply
* 4.14.2[6-7] tcp_push NULL pointer
From: Tomas Charvat @ 2018-03-19 11:51 UTC (permalink / raw)
To: netdev
[-- Attachment #1.1: Type: text/plain, Size: 9282 bytes --]
I have seen on multiple servers with kernel-4.14.26 and 4.14.27
following errors in dmes. It seems that it also caused involved process
to crash (apache and qmail-smtpd).
[Fri Mar 16 00:00:11 2018] BUG: unable to handle kernel NULL pointer
dereference at 0000000000000038
[Fri Mar 16 00:00:11 2018] IP: tcp_push+0x3d/0x110
[Fri Mar 16 00:00:11 2018] PGD 0 P4D 0
[Fri Mar 16 00:00:11 2018] Oops: 0002 [#1] SMP NOPTI
[Fri Mar 16 00:00:11 2018] CPU: 74 PID: 50845 Comm: parse_scanner.p Not
tainted 4.14.27-gentoo #1
[Fri Mar 16 00:00:11 2018] Hardware name: Supermicro AS
-1123US-TR4/H11DSU-iN, BIOS 1.0a 09/14/2017
[Fri Mar 16 00:00:11 2018] task: ffffa33f855226c0 task.stack:
ffffbf3765394000
[Fri Mar 16 00:00:11 2018] RIP: 0010:tcp_push+0x3d/0x110
[Fri Mar 16 00:00:11 2018] RSP: 0018:ffffbf3765397cd0 EFLAGS: 00010246
[Fri Mar 16 00:00:11 2018] RAX: 0000000000000000 RBX: ffffa33b8664d000
RCX: 0000000000000000
[Fri Mar 16 00:00:11 2018] RDX: 0000000000000001 RSI: 0000000000000000
RDI: ffffa33b6338ac00
[Fri Mar 16 00:00:11 2018] RBP: 0000000000001c20 R08: 0000000000000576
R09: ffffa33b6338ad58
[Fri Mar 16 00:00:11 2018] R10: 0000000000000576 R11: 0000000000000000
R12: 00000000ffffffe0
[Fri Mar 16 00:00:11 2018] R13: 0000000000001c20 R14: ffffa33b6338ac00
R15: ffffbf3765397dd0
[Fri Mar 16 00:00:11 2018] FS: 00007f64301f1700(0000)
GS:ffffa33b9fc80000(0000) knlGS:0000000000000000
[Fri Mar 16 00:00:11 2018] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[Fri Mar 16 00:00:11 2018] CR2: 0000000000000038 CR3: 0000800ff30bc000
CR4: 00000000001406e0
[Fri Mar 16 00:00:11 2018] Call Trace:
[Fri Mar 16 00:00:11 2018] tcp_sendmsg_locked+0x65c/0xe40
[Fri Mar 16 00:00:11 2018] tcp_sendmsg+0x2e/0x50
[Fri Mar 16 00:00:11 2018] sock_sendmsg+0x3e/0x50
[Fri Mar 16 00:00:11 2018] SYSC_sendto+0x123/0x1c0
[Fri Mar 16 00:00:11 2018] do_syscall_64+0x80/0x340
[Fri Mar 16 00:00:11 2018] ? __do_page_fault+0x19c/0x3f0
[Fri Mar 16 00:00:11 2018] entry_SYSCALL_64_after_hwframe+0x3d/0xa2
[Fri Mar 16 00:00:11 2018] RIP: 0033:0x7f642f9d0b01
[Fri Mar 16 00:00:11 2018] RSP: 002b:00007ffcfaa9c530 EFLAGS: 00000246
ORIG_RAX: 000000000000002c
[Fri Mar 16 00:00:11 2018] RAX: ffffffffffffffda RBX: 0000562485e03c18
RCX: 00007f642f9d0b01
[Fri Mar 16 00:00:11 2018] RDX: 0000000000002000 RSI: 0000562485e03c18
RDI: 0000000000000004
[Fri Mar 16 00:00:11 2018] RBP: 0000562485a6d2a8 R08: 0000000000000000
R09: 0000000000000000
[Fri Mar 16 00:00:11 2018] R10: 0000000000000000 R11: 0000000000000246
R12: 0000000000000000
[Fri Mar 16 00:00:11 2018] R13: 0000562485e03c18 R14: 0000000000002000
R15: 0000562485c18300
[Fri Mar 16 00:00:11 2018] Code: 00 48 8b 87 60 01 00 00 4c 8d 8f 58 01
00 00 b9 00 00 00 00 41 89 f3 49 39 c1 48 0f 44 c1 41 81 e3 00 80 00 00
0f 85 a5 00 00 00 <80> 48 38 08 8b 8f 6c 06 00 00 89 8f 74 06 00 00 83
e6 01 74 0c
[Fri Mar 16 00:00:11 2018] RIP: tcp_push+0x3d/0x110 RSP: ffffbf3765397cd0
[Fri Mar 16 00:00:11 2018] CR2: 0000000000000038
[Fri Mar 16 00:00:11 2018] ---[ end trace 4ed52c64cd15c543 ]---
[Thu Mar 15 14:56:06 2018] BUG: unable to handle kernel NULL pointer
dereference at 0000000000000038
[Thu Mar 15 14:56:06 2018] IP: tcp_push+0x3d/0x110
[Thu Mar 15 14:56:06 2018] PGD 0 P4D 0
[Thu Mar 15 14:56:06 2018] Oops: 0002 [#1] SMP NOPTI
[Thu Mar 15 14:56:06 2018] CPU: 2 PID: 17214 Comm: rsync Not tainted
4.14.26-gentoo #1
[Thu Mar 15 14:56:06 2018] Hardware name: Xen HVM domU, BIOS 4.9.1
01/26/2018
[Thu Mar 15 14:56:06 2018] task: ffff880164ca9a00 task.stack:
ffffc90002548000
[Thu Mar 15 14:56:06 2018] RIP: 0010:tcp_push+0x3d/0x110
[Thu Mar 15 14:56:06 2018] RSP: 0018:ffffc9000254bc90 EFLAGS: 00010246
[Thu Mar 15 14:56:06 2018] RAX: 0000000000000000 RBX: ffff88006cf6a380
RCX: 0000000000000000
[Thu Mar 15 14:56:06 2018] RDX: 0000000000000000 RSI: 0000000000000040
RDI: ffff880100025d00
[Thu Mar 15 14:56:06 2018] RBP: 00000000000065d0 R08: 00000000000043e0
R09: ffff880100025e58
[Thu Mar 15 14:56:06 2018] R10: 00000000000005a8 R11: 0000000000000000
R12: 00000000000065d0
[Thu Mar 15 14:56:06 2018] R13: 00000000ffffffe0 R14: ffffc9000254bd80
R15: ffff880100025d00
[Thu Mar 15 14:56:06 2018] FS: 00007f1ffba19e80(0000)
GS:ffff88018f500000(0000) knlGS:0000000000000000
[Thu Mar 15 14:56:06 2018] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[Thu Mar 15 14:56:06 2018] CR2: 0000000000000038 CR3: 0000000093550000
CR4: 00000000000406e0
[Thu Mar 15 14:56:06 2018] Call Trace:
[Thu Mar 15 14:56:06 2018] tcp_sendmsg_locked+0x32d/0xe50
[Thu Mar 15 14:56:06 2018] tcp_sendmsg+0x2e/0x50
[Thu Mar 15 14:56:06 2018] sock_sendmsg+0x3e/0x50
[Thu Mar 15 14:56:06 2018] sock_write_iter+0x86/0x100
[Thu Mar 15 14:56:06 2018] __vfs_write+0x14d/0x1c0
[Thu Mar 15 14:56:06 2018] vfs_write+0xc3/0x1d0
[Thu Mar 15 14:56:06 2018] SyS_write+0x62/0xe0
[Thu Mar 15 14:56:06 2018] do_syscall_64+0x87/0x330
[Thu Mar 15 14:56:06 2018] ? __do_page_fault+0x1e0/0x450
[Thu Mar 15 14:56:06 2018] entry_SYSCALL_64_after_hwframe+0x3d/0xa2
[Thu Mar 15 14:56:06 2018] RIP: 0033:0x7f1ffaef0b50
[Thu Mar 15 14:56:06 2018] RSP: 002b:00007ffe0b34a9d8 EFLAGS: 00000246
ORIG_RAX: 0000000000000001
[Thu Mar 15 14:56:06 2018] RAX: ffffffffffffffda RBX: 0000000000000003
RCX: 00007f1ffaef0b50
[Thu Mar 15 14:56:06 2018] RDX: 000000000000c195 RSI: 0000558248b77bc0
RDI: 0000000000000003
[Thu Mar 15 14:56:06 2018] RBP: 00007ffe0b34aa50 R08: 000000000000c195
R09: e34308fec493ee59
[Thu Mar 15 14:56:06 2018] R10: 00007ffe0b34aad0 R11: 0000000000000246
R12: 00007ffe0b34ab50
[Thu Mar 15 14:56:06 2018] R13: 00007ffe0b34aad0 R14: 0000000000000002
R15: 0000558247c3b440
[Thu Mar 15 14:56:06 2018] Code: 00 48 8b 87 60 01 00 00 4c 8d 8f 58 01
00 00 b9 00 00 00 00 41 89 f3 4c 39 c8 48 0f 44 c1 41 81 e3 00 80 00 00
0f 85 a5 00 00 00 <80> 48 38 08 8b 8f 6c 06 00 00 89 8f 74 06 00 00 83
e6 01 74 0c
[Thu Mar 15 14:56:06 2018] RIP: tcp_push+0x3d/0x110 RSP: ffffc9000254bc90
[Thu Mar 15 14:56:06 2018] CR2: 0000000000000038
[Thu Mar 15 14:56:06 2018] ---[ end trace 6a582fb8616d56be ]---
[Sat Mar 17 04:47:25 2018] BUG: unable to handle kernel NULL pointer
dereference at 0000000000000038
[Sat Mar 17 04:47:25 2018] IP: tcp_push+0x3d/0x110
[Sat Mar 17 04:47:25 2018] PGD 0 P4D 0
[Sat Mar 17 04:47:25 2018] Oops: 0002 [#2] SMP NOPTI
[Sat Mar 17 04:47:25 2018] CPU: 1 PID: 20758 Comm: rsync Tainted: G
D 4.14.26-gentoo #1
[Sat Mar 17 04:47:25 2018] Hardware name: Xen HVM domU, BIOS 4.9.1
01/26/2018
[Sat Mar 17 04:47:25 2018] task: ffff8800b1b5c100 task.stack:
ffffc90002388000
[Sat Mar 17 04:47:25 2018] RIP: 0010:tcp_push+0x3d/0x110
[Sat Mar 17 04:47:25 2018] RSP: 0018:ffffc9000238bc90 EFLAGS: 00010246
[Sat Mar 17 04:47:25 2018] RAX: 0000000000000000 RBX: ffff8800a8c90c40
RCX: 0000000000000000
[Sat Mar 17 04:47:25 2018] RDX: 0000000000000000 RSI: 0000000000000040
RDI: ffff88005e0f2e80
[Sat Mar 17 04:47:25 2018] RBP: 0000000000007038 R08: 0000000000005028
R09: ffff88005e0f2fd8
[Sat Mar 17 04:47:25 2018] R10: 0000000000000558 R11: 0000000000000000
R12: 0000000000007038
[Sat Mar 17 04:47:25 2018] R13: 00000000ffffffe0 R14: ffffc9000238bd80
R15: ffff88005e0f2e80
[Sat Mar 17 04:47:25 2018] FS: 00007f1ffba19e80(0000)
GS:ffff88018f480000(0000) knlGS:0000000000000000
[Sat Mar 17 04:47:25 2018] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[Sat Mar 17 04:47:25 2018] CR2: 0000000000000038 CR3: 00000001029fe000
CR4: 00000000000406e0
[Sat Mar 17 04:47:25 2018] Call Trace:
[Sat Mar 17 04:47:25 2018] tcp_sendmsg_locked+0x32d/0xe50
[Sat Mar 17 04:47:25 2018] tcp_sendmsg+0x2e/0x50
[Sat Mar 17 04:47:25 2018] sock_sendmsg+0x3e/0x50
[Sat Mar 17 04:47:25 2018] sock_write_iter+0x86/0x100
[Sat Mar 17 04:47:25 2018] __vfs_write+0x14d/0x1c0
[Sat Mar 17 04:47:25 2018] vfs_write+0xc3/0x1d0
[Sat Mar 17 04:47:25 2018] SyS_write+0x62/0xe0
[Sat Mar 17 04:47:25 2018] do_syscall_64+0x87/0x330
[Sat Mar 17 04:47:25 2018] ? __do_page_fault+0x1e0/0x450
[Sat Mar 17 04:47:25 2018] entry_SYSCALL_64_after_hwframe+0x3d/0xa2
[Sat Mar 17 04:47:25 2018] RIP: 0033:0x7f1ffaef0b50
[Sat Mar 17 04:47:26 2018] RSP: 002b:00007ffe0b34a9d8 EFLAGS: 00000246
ORIG_RAX: 0000000000000001
[Sat Mar 17 04:47:26 2018] RAX: ffffffffffffffda RBX: 0000000000000003
RCX: 00007f1ffaef0b50
[Sat Mar 17 04:47:26 2018] RDX: 000000000000fe15 RSI: 0000558248b77bd0
RDI: 0000000000000003
[Sat Mar 17 04:47:26 2018] RBP: 00007ffe0b34aa50 R08: 000000000000fe15
R09: 0000000000003dae
[Sat Mar 17 04:47:26 2018] R10: 00007ffe0b34aad0 R11: 0000000000000246
R12: 00007ffe0b34ab50
[Sat Mar 17 04:47:26 2018] R13: 00007ffe0b34aad0 R14: 0000000000000002
R15: 0000558247c3b440
[Sat Mar 17 04:47:26 2018] Code: 00 48 8b 87 60 01 00 00 4c 8d 8f 58 01
00 00 b9 00 00 00 00 41 89 f3 4c 39 c8 48 0f 44 c1 41 81 e3 00 80 00 00
0f 85 a5 00 00 00 <80> 48 38 08 8b 8f 6c 06 00 00 89 8f 74 06 00 00 83
e6 01 74 0c
[Sat Mar 17 04:47:26 2018] RIP: tcp_push+0x3d/0x110 RSP: ffffc9000238bc90
[Sat Mar 17 04:47:26 2018] CR2: 0000000000000038
[Sat Mar 17 04:47:26 2018] ---[ end trace 6a582fb8616d56bf ]---
--
Tomas Charvat
EXCELLO | Virusfree
w: www.virusfree.cz
e: tc@excello.cz
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply
* Re: [PATCH 1/4] net: dsa: mv88e6xxx: Fix name of switch 88E6141
From: Andrew Lunn @ 2018-03-19 11:58 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Vivien Didelot, kernel, Florian Fainelli, netdev, Gregory CLEMENT
In-Reply-To: <20180319100523.24498-2-u.kleine-koenig@pengutronix.de>
On Mon, Mar 19, 2018 at 11:05:20AM +0100, Uwe Kleine-K�nig wrote:
> The switch name is emitted in the kernel log, so having the right name
> there is nice.
>
> Fixes: 1558727a1c1b ("net: dsa: mv88e6xxx: Add support for ethernet switch 88E6141")
> Signed-off-by: Uwe Kleine-K�nig <u.kleine-koenig@pengutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply
* Re: [PATCH 2/4] net: dsa: mv88e6xxx: fix typo in a comment
From: Andrew Lunn @ 2018-03-19 11:58 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Vivien Didelot, kernel, Florian Fainelli, netdev, Gregory CLEMENT
In-Reply-To: <20180319100523.24498-3-u.kleine-koenig@pengutronix.de>
On Mon, Mar 19, 2018 at 11:05:21AM +0100, Uwe Kleine-K�nig wrote:
> Signed-off-by: Uwe Kleine-K�nig <u.kleine-koenig@pengutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply
* Re: [PATCH 3/4] net: dsa: mv88e6xxx: fix interrupt name for g2 irq
From: Andrew Lunn @ 2018-03-19 11:59 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Vivien Didelot, kernel, Florian Fainelli, netdev, Gregory CLEMENT
In-Reply-To: <20180319100523.24498-4-u.kleine-koenig@pengutronix.de>
On Mon, Mar 19, 2018 at 11:05:22AM +0100, Uwe Kleine-K�nig wrote:
> This changes the respective line in /proc/interrupts from
>
> 49: x x mv88e6xxx-g1 7 Edge mv88e6xxx-g1
>
> to
>
> 49: x x mv88e6xxx-g1 7 Edge mv88e6xxx-g2
>
> which makes more sense.
>
> Signed-off-by: Uwe Kleine-K�nig <u.kleine-koenig@pengutronix.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply
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