Skip to content

Commit 1ee2dcc

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: "Mostly these are fixes for fallout due to merge window changes, as well as cures for problems that have been with us for a much longer period of time" 1) Johannes Berg noticed two major deficiencies in our genetlink registration. Some genetlink protocols we passing in constant counts for their ops array rather than something like ARRAY_SIZE(ops) or similar. Also, some genetlink protocols were using fixed IDs for their multicast groups. We have to retain these fixed IDs to keep existing userland tools working, but reserve them so that other multicast groups used by other protocols can not possibly conflict. In dealing with these two problems, we actually now use less state management for genetlink operations and multicast groups. 2) When configuring interface hardware timestamping, fix several drivers that simply do not validate that the hwtstamp_config value is one the driver actually supports. From Ben Hutchings. 3) Invalid memory references in mwifiex driver, from Amitkumar Karwar. 4) In dev_forward_skb(), set the skb->protocol in the right order relative to skb_scrub_packet(). From Alexei Starovoitov. 5) Bridge erroneously fails to use the proper wrapper functions to make calls to netdev_ops->ndo_vlan_rx_{add,kill}_vid. Fix from Toshiaki Makita. 6) When detaching a bridge port, make sure to flush all VLAN IDs to prevent them from leaking, also from Toshiaki Makita. 7) Put in a compromise for TCP Small Queues so that deep queued devices that delay TX reclaim non-trivially don't have such a performance decrease. One particularly problematic area is 802.11 AMPDU in wireless. From Eric Dumazet. 8) Fix crashes in tcp_fastopen_cache_get(), we can see NULL socket dsts here. Fix from Eric Dumzaet, reported by Dave Jones. 9) Fix use after free in ipv6 SIT driver, from Willem de Bruijn. 10) When computing mergeable buffer sizes, virtio-net fails to take the virtio-net header into account. From Michael Dalton. 11) Fix seqlock deadlock in ip4_datagram_connect() wrt. statistic bumping, this one has been with us for a while. From Eric Dumazet. 12) Fix NULL deref in the new TIPC fragmentation handling, from Erik Hugne. 13) 6lowpan bit used for traffic classification was wrong, from Jukka Rissanen. 14) macvlan has the same issue as normal vlans did wrt. propagating LRO disabling down to the real device, fix it the same way. From Michal Kubecek. 15) CPSW driver needs to soft reset all slaves during suspend, from Daniel Mack. 16) Fix small frame pacing in FQ packet scheduler, from Eric Dumazet. 17) The xen-netfront RX buffer refill timer isn't properly scheduled on partial RX allocation success, from Ma JieYue. 18) When ipv6 ping protocol support was added, the AF_INET6 protocol initialization cleanup path on failure was borked a little. Fix from Vlad Yasevich. 19) If a socket disconnects during a read/recvmsg/recvfrom/etc that blocks we can do the wrong thing with the msg_name we write back to userspace. From Hannes Frederic Sowa. There is another fix in the works from Hannes which will prevent future problems of this nature. 20) Fix route leak in VTI tunnel transmit, from Fan Du. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (106 commits) genetlink: make multicast groups const, prevent abuse genetlink: pass family to functions using groups genetlink: add and use genl_set_err() genetlink: remove family pointer from genl_multicast_group genetlink: remove genl_unregister_mc_group() hsr: don't call genl_unregister_mc_group() quota/genetlink: use proper genetlink multicast APIs drop_monitor/genetlink: use proper genetlink multicast APIs genetlink: only pass array to genl_register_family_with_ops() tcp: don't update snd_nxt, when a socket is switched from repair mode atm: idt77252: fix dev refcnt leak xfrm: Release dst if this dst is improper for vti tunnel netlink: fix documentation typo in netlink_set_err() be2net: Delete secondary unicast MAC addresses during be_close be2net: Fix unconditional enabling of Rx interface options net, virtio_net: replace the magic value ping: prevent NULL pointer dereference on write to msg_name bnx2x: Prevent "timeout waiting for state X" bnx2x: prevent CFC attention bnx2x: Prevent panic during DMAE timeout ...
2 parents 4457e6f + 091e066 commit 1ee2dcc

129 files changed

Lines changed: 1437 additions & 1432 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/networking/ip-sysctl.txt‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -577,9 +577,6 @@ tcp_limit_output_bytes - INTEGER
577577
typical pfifo_fast qdiscs.
578578
tcp_limit_output_bytes limits the number of bytes on qdisc
579579
or device to reduce artificial RTT/cwnd and reduce bufferbloat.
580-
Note: For GSO/TSO enabled flows, we try to have at least two
581-
packets in flight. Reducing tcp_limit_output_bytes might also
582-
reduce the size of individual GSO packet (64KB being the max)
583580
Default: 131072
584581

585582
tcp_challenge_ack_limit - INTEGER

‎MAINTAINERS‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2468,7 +2468,7 @@ S: Maintained
24682468
F: drivers/media/dvb-frontends/cxd2820r*
24692469

24702470
CXGB3 ETHERNET DRIVER (CXGB3)
2471-
M: Divy Le Ray <divy@chelsio.com>
2471+
M: Santosh Raspatur <santosh@chelsio.com>
24722472
L: netdev@vger.kernel.org
24732473
W: http://www.chelsio.com
24742474
S: Supported
@@ -8960,8 +8960,8 @@ USB PEGASUS DRIVER
89608960
M: Petko Manolov <petkan@nucleusys.com>
89618961
L: linux-usb@vger.kernel.org
89628962
L: netdev@vger.kernel.org
8963-
T: git git://git.code.sf.net/p/pegasus2/git
8964-
W: http://pegasus2.sourceforge.net/
8963+
T: git git://github.com/petkan/pegasus.git
8964+
W: https://github.com/petkan/pegasus
89658965
S: Maintained
89668966
F: drivers/net/usb/pegasus.*
89678967

@@ -8982,8 +8982,8 @@ USB RTL8150 DRIVER
89828982
M: Petko Manolov <petkan@nucleusys.com>
89838983
L: linux-usb@vger.kernel.org
89848984
L: netdev@vger.kernel.org
8985-
T: git git://git.code.sf.net/p/pegasus2/git
8986-
W: http://pegasus2.sourceforge.net/
8985+
T: git git://github.com/petkan/rtl8150.git
8986+
W: https://github.com/petkan/rtl8150
89878987
S: Maintained
89888988
F: drivers/net/usb/rtl8150.c
89898989

‎drivers/acpi/event.c‎

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,17 @@ enum {
7878
#define ACPI_GENL_VERSION 0x01
7979
#define ACPI_GENL_MCAST_GROUP_NAME "acpi_mc_group"
8080

81+
static const struct genl_multicast_group acpi_event_mcgrps[] = {
82+
{ .name = ACPI_GENL_MCAST_GROUP_NAME, },
83+
};
84+
8185
static struct genl_family acpi_event_genl_family = {
8286
.id = GENL_ID_GENERATE,
8387
.name = ACPI_GENL_FAMILY_NAME,
8488
.version = ACPI_GENL_VERSION,
8589
.maxattr = ACPI_GENL_ATTR_MAX,
86-
};
87-
88-
static struct genl_multicast_group acpi_event_mcgrp = {
89-
.name = ACPI_GENL_MCAST_GROUP_NAME,
90+
.mcgrps = acpi_event_mcgrps,
91+
.n_mcgrps = ARRAY_SIZE(acpi_event_mcgrps),
9092
};
9193

9294
int acpi_bus_generate_netlink_event(const char *device_class,
@@ -141,26 +143,15 @@ int acpi_bus_generate_netlink_event(const char *device_class,
141143
return result;
142144
}
143145

144-
genlmsg_multicast(skb, 0, acpi_event_mcgrp.id, GFP_ATOMIC);
146+
genlmsg_multicast(&acpi_event_genl_family, skb, 0, 0, GFP_ATOMIC);
145147
return 0;
146148
}
147149

148150
EXPORT_SYMBOL(acpi_bus_generate_netlink_event);
149151

150152
static int acpi_event_genetlink_init(void)
151153
{
152-
int result;
153-
154-
result = genl_register_family(&acpi_event_genl_family);
155-
if (result)
156-
return result;
157-
158-
result = genl_register_mc_group(&acpi_event_genl_family,
159-
&acpi_event_mcgrp);
160-
if (result)
161-
genl_unregister_family(&acpi_event_genl_family);
162-
163-
return result;
154+
return genl_register_family(&acpi_event_genl_family);
164155
}
165156

166157
#else

‎drivers/atm/idt77252.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3511,7 +3511,7 @@ static int init_card(struct atm_dev *dev)
35113511
tmp = dev_get_by_name(&init_net, tname); /* jhs: was "tmp = dev_get(tname);" */
35123512
if (tmp) {
35133513
memcpy(card->atmdev->esi, tmp->dev_addr, 6);
3514-
3514+
dev_put(tmp);
35153515
printk("%s: ESI %pM\n", card->name, card->atmdev->esi);
35163516
}
35173517
/*

‎drivers/connector/cn_proc.c‎

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,23 @@
3232
#include <linux/atomic.h>
3333
#include <linux/pid_namespace.h>
3434

35-
#include <asm/unaligned.h>
36-
3735
#include <linux/cn_proc.h>
3836

39-
#define CN_PROC_MSG_SIZE (sizeof(struct cn_msg) + sizeof(struct proc_event))
37+
/*
38+
* Size of a cn_msg followed by a proc_event structure. Since the
39+
* sizeof struct cn_msg is a multiple of 4 bytes, but not 8 bytes, we
40+
* add one 4-byte word to the size here, and then start the actual
41+
* cn_msg structure 4 bytes into the stack buffer. The result is that
42+
* the immediately following proc_event structure is aligned to 8 bytes.
43+
*/
44+
#define CN_PROC_MSG_SIZE (sizeof(struct cn_msg) + sizeof(struct proc_event) + 4)
45+
46+
/* See comment above; we test our assumption about sizeof struct cn_msg here. */
47+
static inline struct cn_msg *buffer_to_cn_msg(__u8 *buffer)
48+
{
49+
BUILD_BUG_ON(sizeof(struct cn_msg) != 20);
50+
return (struct cn_msg *)(buffer + 4);
51+
}
4052

4153
static atomic_t proc_event_num_listeners = ATOMIC_INIT(0);
4254
static struct cb_id cn_proc_event_id = { CN_IDX_PROC, CN_VAL_PROC };
@@ -56,19 +68,19 @@ void proc_fork_connector(struct task_struct *task)
5668
{
5769
struct cn_msg *msg;
5870
struct proc_event *ev;
59-
__u8 buffer[CN_PROC_MSG_SIZE];
71+
__u8 buffer[CN_PROC_MSG_SIZE] __aligned(8);
6072
struct timespec ts;
6173
struct task_struct *parent;
6274

6375
if (atomic_read(&proc_event_num_listeners) < 1)
6476
return;
6577

66-
msg = (struct cn_msg *)buffer;
78+
msg = buffer_to_cn_msg(buffer);
6779
ev = (struct proc_event *)msg->data;
6880
memset(&ev->event_data, 0, sizeof(ev->event_data));
6981
get_seq(&msg->seq, &ev->cpu);
7082
ktime_get_ts(&ts); /* get high res monotonic timestamp */
71-
put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns);
83+
ev->timestamp_ns = timespec_to_ns(&ts);
7284
ev->what = PROC_EVENT_FORK;
7385
rcu_read_lock();
7486
parent = rcu_dereference(task->real_parent);
@@ -91,17 +103,17 @@ void proc_exec_connector(struct task_struct *task)
91103
struct cn_msg *msg;
92104
struct proc_event *ev;
93105
struct timespec ts;
94-
__u8 buffer[CN_PROC_MSG_SIZE];
106+
__u8 buffer[CN_PROC_MSG_SIZE] __aligned(8);
95107

96108
if (atomic_read(&proc_event_num_listeners) < 1)
97109
return;
98110

99-
msg = (struct cn_msg *)buffer;
111+
msg = buffer_to_cn_msg(buffer);
100112
ev = (struct proc_event *)msg->data;
101113
memset(&ev->event_data, 0, sizeof(ev->event_data));
102114
get_seq(&msg->seq, &ev->cpu);
103115
ktime_get_ts(&ts); /* get high res monotonic timestamp */
104-
put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns);
116+
ev->timestamp_ns = timespec_to_ns(&ts);
105117
ev->what = PROC_EVENT_EXEC;
106118
ev->event_data.exec.process_pid = task->pid;
107119
ev->event_data.exec.process_tgid = task->tgid;
@@ -117,14 +129,14 @@ void proc_id_connector(struct task_struct *task, int which_id)
117129
{
118130
struct cn_msg *msg;
119131
struct proc_event *ev;
120-
__u8 buffer[CN_PROC_MSG_SIZE];
132+
__u8 buffer[CN_PROC_MSG_SIZE] __aligned(8);
121133
struct timespec ts;
122134
const struct cred *cred;
123135

124136
if (atomic_read(&proc_event_num_listeners) < 1)
125137
return;
126138

127-
msg = (struct cn_msg *)buffer;
139+
msg = buffer_to_cn_msg(buffer);
128140
ev = (struct proc_event *)msg->data;
129141
memset(&ev->event_data, 0, sizeof(ev->event_data));
130142
ev->what = which_id;
@@ -145,7 +157,7 @@ void proc_id_connector(struct task_struct *task, int which_id)
145157
rcu_read_unlock();
146158
get_seq(&msg->seq, &ev->cpu);
147159
ktime_get_ts(&ts); /* get high res monotonic timestamp */
148-
put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns);
160+
ev->timestamp_ns = timespec_to_ns(&ts);
149161

150162
memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id));
151163
msg->ack = 0; /* not used */
@@ -159,17 +171,17 @@ void proc_sid_connector(struct task_struct *task)
159171
struct cn_msg *msg;
160172
struct proc_event *ev;
161173
struct timespec ts;
162-
__u8 buffer[CN_PROC_MSG_SIZE];
174+
__u8 buffer[CN_PROC_MSG_SIZE] __aligned(8);
163175

164176
if (atomic_read(&proc_event_num_listeners) < 1)
165177
return;
166178

167-
msg = (struct cn_msg *)buffer;
179+
msg = buffer_to_cn_msg(buffer);
168180
ev = (struct proc_event *)msg->data;
169181
memset(&ev->event_data, 0, sizeof(ev->event_data));
170182
get_seq(&msg->seq, &ev->cpu);
171183
ktime_get_ts(&ts); /* get high res monotonic timestamp */
172-
put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns);
184+
ev->timestamp_ns = timespec_to_ns(&ts);
173185
ev->what = PROC_EVENT_SID;
174186
ev->event_data.sid.process_pid = task->pid;
175187
ev->event_data.sid.process_tgid = task->tgid;
@@ -186,17 +198,17 @@ void proc_ptrace_connector(struct task_struct *task, int ptrace_id)
186198
struct cn_msg *msg;
187199
struct proc_event *ev;
188200
struct timespec ts;
189-
__u8 buffer[CN_PROC_MSG_SIZE];
201+
__u8 buffer[CN_PROC_MSG_SIZE] __aligned(8);
190202

191203
if (atomic_read(&proc_event_num_listeners) < 1)
192204
return;
193205

194-
msg = (struct cn_msg *)buffer;
206+
msg = buffer_to_cn_msg(buffer);
195207
ev = (struct proc_event *)msg->data;
196208
memset(&ev->event_data, 0, sizeof(ev->event_data));
197209
get_seq(&msg->seq, &ev->cpu);
198210
ktime_get_ts(&ts); /* get high res monotonic timestamp */
199-
put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns);
211+
ev->timestamp_ns = timespec_to_ns(&ts);
200212
ev->what = PROC_EVENT_PTRACE;
201213
ev->event_data.ptrace.process_pid = task->pid;
202214
ev->event_data.ptrace.process_tgid = task->tgid;
@@ -221,17 +233,17 @@ void proc_comm_connector(struct task_struct *task)
221233
struct cn_msg *msg;
222234
struct proc_event *ev;
223235
struct timespec ts;
224-
__u8 buffer[CN_PROC_MSG_SIZE];
236+
__u8 buffer[CN_PROC_MSG_SIZE] __aligned(8);
225237

226238
if (atomic_read(&proc_event_num_listeners) < 1)
227239
return;
228240

229-
msg = (struct cn_msg *)buffer;
241+
msg = buffer_to_cn_msg(buffer);
230242
ev = (struct proc_event *)msg->data;
231243
memset(&ev->event_data, 0, sizeof(ev->event_data));
232244
get_seq(&msg->seq, &ev->cpu);
233245
ktime_get_ts(&ts); /* get high res monotonic timestamp */
234-
put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns);
246+
ev->timestamp_ns = timespec_to_ns(&ts);
235247
ev->what = PROC_EVENT_COMM;
236248
ev->event_data.comm.process_pid = task->pid;
237249
ev->event_data.comm.process_tgid = task->tgid;
@@ -248,18 +260,18 @@ void proc_coredump_connector(struct task_struct *task)
248260
{
249261
struct cn_msg *msg;
250262
struct proc_event *ev;
251-
__u8 buffer[CN_PROC_MSG_SIZE];
263+
__u8 buffer[CN_PROC_MSG_SIZE] __aligned(8);
252264
struct timespec ts;
253265

254266
if (atomic_read(&proc_event_num_listeners) < 1)
255267
return;
256268

257-
msg = (struct cn_msg *)buffer;
269+
msg = buffer_to_cn_msg(buffer);
258270
ev = (struct proc_event *)msg->data;
259271
memset(&ev->event_data, 0, sizeof(ev->event_data));
260272
get_seq(&msg->seq, &ev->cpu);
261273
ktime_get_ts(&ts); /* get high res monotonic timestamp */
262-
put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns);
274+
ev->timestamp_ns = timespec_to_ns(&ts);
263275
ev->what = PROC_EVENT_COREDUMP;
264276
ev->event_data.coredump.process_pid = task->pid;
265277
ev->event_data.coredump.process_tgid = task->tgid;
@@ -275,18 +287,18 @@ void proc_exit_connector(struct task_struct *task)
275287
{
276288
struct cn_msg *msg;
277289
struct proc_event *ev;
278-
__u8 buffer[CN_PROC_MSG_SIZE];
290+
__u8 buffer[CN_PROC_MSG_SIZE] __aligned(8);
279291
struct timespec ts;
280292

281293
if (atomic_read(&proc_event_num_listeners) < 1)
282294
return;
283295

284-
msg = (struct cn_msg *)buffer;
296+
msg = buffer_to_cn_msg(buffer);
285297
ev = (struct proc_event *)msg->data;
286298
memset(&ev->event_data, 0, sizeof(ev->event_data));
287299
get_seq(&msg->seq, &ev->cpu);
288300
ktime_get_ts(&ts); /* get high res monotonic timestamp */
289-
put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns);
301+
ev->timestamp_ns = timespec_to_ns(&ts);
290302
ev->what = PROC_EVENT_EXIT;
291303
ev->event_data.exit.process_pid = task->pid;
292304
ev->event_data.exit.process_tgid = task->tgid;
@@ -312,18 +324,18 @@ static void cn_proc_ack(int err, int rcvd_seq, int rcvd_ack)
312324
{
313325
struct cn_msg *msg;
314326
struct proc_event *ev;
315-
__u8 buffer[CN_PROC_MSG_SIZE];
327+
__u8 buffer[CN_PROC_MSG_SIZE] __aligned(8);
316328
struct timespec ts;
317329

318330
if (atomic_read(&proc_event_num_listeners) < 1)
319331
return;
320332

321-
msg = (struct cn_msg *)buffer;
333+
msg = buffer_to_cn_msg(buffer);
322334
ev = (struct proc_event *)msg->data;
323335
memset(&ev->event_data, 0, sizeof(ev->event_data));
324336
msg->seq = rcvd_seq;
325337
ktime_get_ts(&ts); /* get high res monotonic timestamp */
326-
put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns);
338+
ev->timestamp_ns = timespec_to_ns(&ts);
327339
ev->cpu = -1;
328340
ev->what = PROC_EVENT_NONE;
329341
ev->event_data.ack.err = err;

‎drivers/isdn/isdnloop/isdnloop.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,8 +1083,10 @@ isdnloop_start(isdnloop_card *card, isdnloop_sdef *sdefp)
10831083
spin_unlock_irqrestore(&card->isdnloop_lock, flags);
10841084
return -ENOMEM;
10851085
}
1086-
for (i = 0; i < 3; i++)
1087-
strcpy(card->s0num[i], sdef.num[i]);
1086+
for (i = 0; i < 3; i++) {
1087+
strlcpy(card->s0num[i], sdef.num[i],
1088+
sizeof(card->s0num[0]));
1089+
}
10881090
break;
10891091
case ISDN_PTYPE_1TR6:
10901092
if (isdnloop_fake(card, "DRV1.04TC-1TR6-CAPI-CNS-BASIS-29.11.95",
@@ -1097,7 +1099,7 @@ isdnloop_start(isdnloop_card *card, isdnloop_sdef *sdefp)
10971099
spin_unlock_irqrestore(&card->isdnloop_lock, flags);
10981100
return -ENOMEM;
10991101
}
1100-
strcpy(card->s0num[0], sdef.num[0]);
1102+
strlcpy(card->s0num[0], sdef.num[0], sizeof(card->s0num[0]));
11011103
card->s0num[1][0] = '\0';
11021104
card->s0num[2][0] = '\0';
11031105
break;

0 commit comments

Comments
 (0)