Skip to content

Commit dd817f9

Browse files
committed
Merge branch 'android-4.19-stable' of https://android.googlesource.com/kernel/common into oos13.1
2 parents cbef154 + 079d4f3 commit dd817f9

File tree

23 files changed

+1060
-518
lines changed

23 files changed

+1060
-518
lines changed

Documentation/sphinx/kernel_include.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ def _run(self):
9494
# HINT: this is the only line I had to change / commented out:
9595
#path = utils.relative_path(None, path)
9696

97-
path = nodes.reprunicode(path)
9897
encoding = self.options.get(
9998
'encoding', self.state.document.settings.input_encoding)
10099
e_handler=self.state.document.settings.input_encoding_error_handler

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
VERSION = 4
33
PATCHLEVEL = 19
4-
SUBLEVEL = 314
4+
SUBLEVEL = 315
55
EXTRAVERSION =
66
NAME = "People's Front"
77

drivers/md/dm-core.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
#include "dm.h"
1919

2020
#define DM_RESERVED_MAX_IOS 1024
21+
#define DM_MAX_TARGETS 1048576
22+
#define DM_MAX_TARGET_PARAMS 1024
2123

2224
struct dm_kobject_holder {
2325
struct kobject kobj;

drivers/md/dm-ioctl.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1734,7 +1734,8 @@ static int copy_params(struct dm_ioctl __user *user, struct dm_ioctl *param_kern
17341734
if (copy_from_user(param_kernel, user, minimum_data_size))
17351735
return -EFAULT;
17361736

1737-
if (param_kernel->data_size < minimum_data_size)
1737+
if (unlikely(param_kernel->data_size < minimum_data_size) ||
1738+
unlikely(param_kernel->data_size > DM_MAX_TARGETS * DM_MAX_TARGET_PARAMS))
17381739
return -EINVAL;
17391740

17401741
secure_data = param_kernel->flags & DM_SECURE_DATA_FLAG;

drivers/md/dm-table.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,12 @@ static int alloc_targets(struct dm_table *t, unsigned int num)
190190
int dm_table_create(struct dm_table **result, fmode_t mode,
191191
unsigned num_targets, struct mapped_device *md)
192192
{
193-
struct dm_table *t = kzalloc(sizeof(*t), GFP_KERNEL);
193+
struct dm_table *t;
194+
195+
if (num_targets > DM_MAX_TARGETS)
196+
return -EOVERFLOW;
197+
198+
t = kzalloc(sizeof(*t), GFP_KERNEL);
194199

195200
if (!t)
196201
return -ENOMEM;
@@ -205,7 +210,7 @@ int dm_table_create(struct dm_table **result, fmode_t mode,
205210

206211
if (!num_targets) {
207212
kfree(t);
208-
return -ENOMEM;
213+
return -EOVERFLOW;
209214
}
210215

211216
if (alloc_targets(t, num_targets)) {

drivers/tty/serial/kgdboc.c

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/console.h>
1717
#include <linux/vt_kern.h>
1818
#include <linux/input.h>
19+
#include <linux/irq_work.h>
1920
#include <linux/module.h>
2021

2122
#define MAX_CONFIG_LEN 40
@@ -35,6 +36,25 @@ static int kgdboc_use_kms; /* 1 if we use kernel mode switching */
3536
static struct tty_driver *kgdb_tty_driver;
3637
static int kgdb_tty_line;
3738

39+
/*
40+
* When we leave the debug trap handler we need to reset the keyboard status
41+
* (since the original keyboard state gets partially clobbered by kdb use of
42+
* the keyboard).
43+
*
44+
* The path to deliver the reset is somewhat circuitous.
45+
*
46+
* To deliver the reset we register an input handler, reset the keyboard and
47+
* then deregister the input handler. However, to get this done right, we do
48+
* have to carefully manage the calling context because we can only register
49+
* input handlers from task context.
50+
*
51+
* In particular we need to trigger the action from the debug trap handler with
52+
* all its NMI and/or NMI-like oddities. To solve this the kgdboc trap exit code
53+
* (the "post_exception" callback) uses irq_work_queue(), which is NMI-safe, to
54+
* schedule a callback from a hardirq context. From there we have to defer the
55+
* work again, this time using schedule_work(), to get a callback using the
56+
* system workqueue, which runs in task context.
57+
*/
3858
#ifdef CONFIG_KDB_KEYBOARD
3959
static int kgdboc_reset_connect(struct input_handler *handler,
4060
struct input_dev *dev,
@@ -86,10 +106,17 @@ static void kgdboc_restore_input_helper(struct work_struct *dummy)
86106

87107
static DECLARE_WORK(kgdboc_restore_input_work, kgdboc_restore_input_helper);
88108

109+
static void kgdboc_queue_restore_input_helper(struct irq_work *unused)
110+
{
111+
schedule_work(&kgdboc_restore_input_work);
112+
}
113+
114+
static DEFINE_IRQ_WORK(kgdboc_restore_input_irq_work, kgdboc_queue_restore_input_helper);
115+
89116
static void kgdboc_restore_input(void)
90117
{
91118
if (likely(system_state == SYSTEM_RUNNING))
92-
schedule_work(&kgdboc_restore_input_work);
119+
irq_work_queue(&kgdboc_restore_input_irq_work);
93120
}
94121

95122
static int kgdboc_register_kbd(char **cptr)
@@ -120,6 +147,7 @@ static void kgdboc_unregister_kbd(void)
120147
i--;
121148
}
122149
}
150+
irq_work_sync(&kgdboc_restore_input_irq_work);
123151
flush_work(&kgdboc_restore_input_work);
124152
}
125153
#else /* ! CONFIG_KDB_KEYBOARD */

fs/btrfs/volumes.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2957,6 +2957,7 @@ static int btrfs_relocate_sys_chunks(struct btrfs_fs_info *fs_info)
29572957
* alignment and size).
29582958
*/
29592959
ret = -EUCLEAN;
2960+
mutex_unlock(&fs_info->delete_unused_bgs_mutex);
29602961
goto error;
29612962
}
29622963

include/linux/trace_events.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,8 +531,6 @@ extern int trace_event_raw_init(struct trace_event_call *call);
531531
extern int trace_define_field(struct trace_event_call *call, const char *type,
532532
const char *name, int offset, int size,
533533
int is_signed, int filter_type);
534-
extern int trace_add_event_call_nolock(struct trace_event_call *call);
535-
extern int trace_remove_event_call_nolock(struct trace_event_call *call);
536534
extern int trace_add_event_call(struct trace_event_call *call);
537535
extern int trace_remove_event_call(struct trace_event_call *call);
538536
extern int trace_event_get_offsets(struct trace_event_call *call);

include/net/dst_ops.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ struct dst_ops {
2424
void (*destroy)(struct dst_entry *);
2525
void (*ifdown)(struct dst_entry *,
2626
struct net_device *dev, int how);
27-
struct dst_entry * (*negative_advice)(struct dst_entry *);
27+
void (*negative_advice)(struct sock *sk, struct dst_entry *);
2828
void (*link_failure)(struct sk_buff *);
2929
void (*update_pmtu)(struct dst_entry *dst, struct sock *sk,
3030
struct sk_buff *skb, u32 mtu,

include/net/sock.h

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1966,19 +1966,12 @@ sk_dst_get(struct sock *sk)
19661966

19671967
static inline void dst_negative_advice(struct sock *sk)
19681968
{
1969-
struct dst_entry *ndst, *dst = __sk_dst_get(sk);
1969+
struct dst_entry *dst = __sk_dst_get(sk);
19701970

19711971
sk_rethink_txhash(sk);
19721972

1973-
if (dst && dst->ops->negative_advice) {
1974-
ndst = dst->ops->negative_advice(dst);
1975-
1976-
if (ndst != dst) {
1977-
rcu_assign_pointer(sk->sk_dst_cache, ndst);
1978-
sk_tx_queue_clear(sk);
1979-
WRITE_ONCE(sk->sk_dst_pending_confirm, 0);
1980-
}
1981-
}
1973+
if (dst && dst->ops->negative_advice)
1974+
dst->ops->negative_advice(sk, dst);
19821975
}
19831976

19841977
static inline void

0 commit comments

Comments
 (0)