Skip to content

Commit

Permalink
Merge tag 'v4.19.315' into 4.19-main
Browse files Browse the repository at this point in the history
This is the 4.19.315 stable release

# -----BEGIN PGP SIGNATURE-----
#
# iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAmZR8rkACgkQONu9yGCS
# aT7Tug//c7yA1gXNwxkSZTtI9CNy1/DFHiwbGocU+levnqMDAK31IT55z+RdJ8hs
# esTyXBMN48P5EDLj9DapNOTGfp4tu9JF/pZu2/LgHC2FU527yF28TAmCKX7rD+YB
# VSE6EcdJhtjoKiRGTo5ehmHX7vs5JYTvXwu+9PC29hixqm/vRRcPT8udMbvSsHrZ
# yBmk8C2Je2UxVzktAviXnwhtSnaJUXNBmxT2/2i9kET+0UeVJWmSXOimwQvA4Tda
# FTBGaG+RzthfT79qmGl77P/Xyn1Uyr4ClPKuSaaC2k1lIhah78GwUl9ObJbg0b1f
# a3DRBOjUvpHi26zkzzaQOOmrS8V1C45IHxNO3JzTPLgI8B2p99HNGoyWFTXeeAUn
# V9jy9yFVwLy+1wstqNcWOoO7dgMf0dOEm63GNpWYbVzNJbvY1FOfnYAujGE02JQi
# zb1jIm/1ZHtBuBUn8/Kon7aj6bwwSfDnK+P0/DJl4g2nGmhjtzWgY1XPp+sgGiBH
# 9j01S0+4PoZC6MxoWZ3HqVm7G1g+Lopcqsp2+7L5U3O2Ya/KCPOOAMqAMuqPD0r0
# xZzco4+SdQYoQZNcCCHnD49PQon8J7CNjh1XCvodZSFfvsSU9uO5yTwk8/kDSDkN
# 3GdOUphdCmdUqX/4AMtFMmpcycqU9ErBVPPEGqBzXZGjW5tcVlo=
# =R8J+
# -----END PGP SIGNATURE-----
# gpg: Signature made Sat May 25 16:16:25 2024 CEST
# gpg:                using RSA key 647F28654894E3BD457199BE38DBBDC86092693E
# gpg: Can't check signature: No public key
  • Loading branch information
frank-w committed Jun 8, 2024
2 parents 93f413d + 10cfa55 commit 17bcfea
Show file tree
Hide file tree
Showing 19 changed files with 1,050 additions and 471 deletions.
1 change: 0 additions & 1 deletion Documentation/sphinx/kernel_include.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ def _run(self):
# HINT: this is the only line I had to change / commented out:
#path = utils.relative_path(None, path)

path = nodes.reprunicode(path)
encoding = self.options.get(
'encoding', self.state.document.settings.input_encoding)
e_handler=self.state.document.settings.input_encoding_error_handler
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0
VERSION = 4
PATCHLEVEL = 19
SUBLEVEL = 314
SUBLEVEL = 315
EXTRAVERSION =
NAME = "People's Front"

Expand Down
2 changes: 2 additions & 0 deletions drivers/md/dm-core.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
#include "dm.h"

#define DM_RESERVED_MAX_IOS 1024
#define DM_MAX_TARGETS 1048576
#define DM_MAX_TARGET_PARAMS 1024

struct dm_kobject_holder {
struct kobject kobj;
Expand Down
3 changes: 2 additions & 1 deletion drivers/md/dm-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1734,7 +1734,8 @@ static int copy_params(struct dm_ioctl __user *user, struct dm_ioctl *param_kern
if (copy_from_user(param_kernel, user, minimum_data_size))
return -EFAULT;

if (param_kernel->data_size < minimum_data_size)
if (unlikely(param_kernel->data_size < minimum_data_size) ||
unlikely(param_kernel->data_size > DM_MAX_TARGETS * DM_MAX_TARGET_PARAMS))
return -EINVAL;

secure_data = param_kernel->flags & DM_SECURE_DATA_FLAG;
Expand Down
9 changes: 7 additions & 2 deletions drivers/md/dm-table.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,12 @@ static int alloc_targets(struct dm_table *t, unsigned int num)
int dm_table_create(struct dm_table **result, fmode_t mode,
unsigned num_targets, struct mapped_device *md)
{
struct dm_table *t = kzalloc(sizeof(*t), GFP_KERNEL);
struct dm_table *t;

if (num_targets > DM_MAX_TARGETS)
return -EOVERFLOW;

t = kzalloc(sizeof(*t), GFP_KERNEL);

if (!t)
return -ENOMEM;
Expand All @@ -202,7 +207,7 @@ int dm_table_create(struct dm_table **result, fmode_t mode,

if (!num_targets) {
kfree(t);
return -ENOMEM;
return -EOVERFLOW;
}

if (alloc_targets(t, num_targets)) {
Expand Down
30 changes: 29 additions & 1 deletion drivers/tty/serial/kgdboc.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/console.h>
#include <linux/vt_kern.h>
#include <linux/input.h>
#include <linux/irq_work.h>
#include <linux/module.h>

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

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

static DECLARE_WORK(kgdboc_restore_input_work, kgdboc_restore_input_helper);

static void kgdboc_queue_restore_input_helper(struct irq_work *unused)
{
schedule_work(&kgdboc_restore_input_work);
}

static DEFINE_IRQ_WORK(kgdboc_restore_input_irq_work, kgdboc_queue_restore_input_helper);

static void kgdboc_restore_input(void)
{
if (likely(system_state == SYSTEM_RUNNING))
schedule_work(&kgdboc_restore_input_work);
irq_work_queue(&kgdboc_restore_input_irq_work);
}

static int kgdboc_register_kbd(char **cptr)
Expand Down Expand Up @@ -120,6 +147,7 @@ static void kgdboc_unregister_kbd(void)
i--;
}
}
irq_work_sync(&kgdboc_restore_input_irq_work);
flush_work(&kgdboc_restore_input_work);
}
#else /* ! CONFIG_KDB_KEYBOARD */
Expand Down
1 change: 1 addition & 0 deletions fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -2957,6 +2957,7 @@ static int btrfs_relocate_sys_chunks(struct btrfs_fs_info *fs_info)
* alignment and size).
*/
ret = -EUCLEAN;
mutex_unlock(&fs_info->delete_unused_bgs_mutex);
goto error;
}

Expand Down
20 changes: 20 additions & 0 deletions include/linux/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -492,4 +492,24 @@ static inline void memcpy_and_pad(void *dest, size_t dest_len,
memcpy(dest, src, dest_len);
}

/**
* str_has_prefix - Test if a string has a given prefix
* @str: The string to test
* @prefix: The string to see if @str starts with
*
* A common way to test a prefix of a string is to do:
* strncmp(str, prefix, sizeof(prefix) - 1)
*
* But this can lead to bugs due to typos, or if prefix is a pointer
* and not a constant. Instead use str_has_prefix().
*
* Returns: 0 if @str does not start with @prefix
strlen(@prefix) if @str does start with @prefix
*/
static __always_inline size_t str_has_prefix(const char *str, const char *prefix)
{
size_t len = strlen(prefix);
return strncmp(str, prefix, len) == 0 ? len : 0;
}

#endif /* _LINUX_STRING_H_ */
2 changes: 0 additions & 2 deletions include/linux/trace_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,6 @@ extern int trace_event_raw_init(struct trace_event_call *call);
extern int trace_define_field(struct trace_event_call *call, const char *type,
const char *name, int offset, int size,
int is_signed, int filter_type);
extern int trace_add_event_call_nolock(struct trace_event_call *call);
extern int trace_remove_event_call_nolock(struct trace_event_call *call);
extern int trace_add_event_call(struct trace_event_call *call);
extern int trace_remove_event_call(struct trace_event_call *call);
extern int trace_event_get_offsets(struct trace_event_call *call);
Expand Down
4 changes: 4 additions & 0 deletions kernel/trace/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,9 @@ config BPF_EVENTS
help
This allows the user to attach BPF programs to kprobe events.

config DYNAMIC_EVENTS
def_bool n

config PROBE_EVENTS
def_bool n

Expand Down Expand Up @@ -630,6 +633,7 @@ config HIST_TRIGGERS
depends on ARCH_HAVE_NMI_SAFE_CMPXCHG
select TRACING_MAP
select TRACING
select DYNAMIC_EVENTS
default n
help
Hist triggers allow one or more arbitrary trace event fields
Expand Down
1 change: 1 addition & 0 deletions kernel/trace/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ endif
ifeq ($(CONFIG_TRACING),y)
obj-$(CONFIG_KGDB_KDB) += trace_kdb.o
endif
obj-$(CONFIG_DYNAMIC_EVENTS) += trace_dynevent.o
obj-$(CONFIG_PROBE_EVENTS) += trace_probe.o
obj-$(CONFIG_UPROBE_EVENTS) += trace_uprobe.o

Expand Down
26 changes: 24 additions & 2 deletions kernel/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -4470,7 +4470,7 @@ static int trace_set_options(struct trace_array *tr, char *option)

cmp = strstrip(option);

if (strncmp(cmp, "no", 2) == 0) {
if (str_has_prefix(cmp, "no")) {
neg = 1;
cmp += 2;
}
Expand Down Expand Up @@ -4665,6 +4665,10 @@ static const char readme_msg[] =
"\t\t\t traces\n"
#endif
#endif /* CONFIG_STACK_TRACER */
#ifdef CONFIG_DYNAMIC_EVENTS
" dynamic_events\t\t- Add/remove/show the generic dynamic events\n"
"\t\t\t Write into this file to define/undefine new trace events.\n"
#endif
#ifdef CONFIG_KPROBE_EVENTS
" kprobe_events\t\t- Add/remove/show the kernel dynamic events\n"
"\t\t\t Write into this file to define/undefine new trace events.\n"
Expand All @@ -4677,6 +4681,9 @@ static const char readme_msg[] =
"\t accepts: event-definitions (one definition per line)\n"
"\t Format: p[:[<group>/]<event>] <place> [<args>]\n"
"\t r[maxactive][:[<group>/]<event>] <place> [<args>]\n"
#ifdef CONFIG_HIST_TRIGGERS
"\t s:[synthetic/]<event> <field> [<field>]\n"
#endif
"\t -:[<group>/]<event>\n"
#ifdef CONFIG_KPROBE_EVENTS
"\t place: [<module>:]<symbol>[+<offset>]|<memaddr>\n"
Expand All @@ -4690,6 +4697,11 @@ static const char readme_msg[] =
"\t $stack<index>, $stack, $retval, $comm\n"
"\t type: s8/16/32/64, u8/16/32/64, x8/16/32/64, string,\n"
"\t b<bit-width>@<bit-offset>/<container-size>\n"
#ifdef CONFIG_HIST_TRIGGERS
"\t field: <stype> <name>;\n"
"\t stype: u8/u16/u32/u64, s8/s16/s32/s64, pid_t,\n"
"\t [unsigned] char/int/long\n"
#endif
#endif
" events/\t\t- Directory containing all trace event subsystems:\n"
" enable\t\t- Write 0/1 to enable/disable tracing of all events\n"
Expand Down Expand Up @@ -4742,6 +4754,7 @@ static const char readme_msg[] =
"\t [:size=#entries]\n"
"\t [:pause][:continue][:clear]\n"
"\t [:name=histname1]\n"
"\t [:<handler>.<action>]\n"
"\t [if <filter>]\n\n"
"\t Note, special fields can be used as well:\n"
"\t common_timestamp - to record current timestamp\n"
Expand Down Expand Up @@ -4787,7 +4800,16 @@ static const char readme_msg[] =
"\t The enable_hist and disable_hist triggers can be used to\n"
"\t have one event conditionally start and stop another event's\n"
"\t already-attached hist trigger. The syntax is analagous to\n"
"\t the enable_event and disable_event triggers.\n"
"\t the enable_event and disable_event triggers.\n\n"
"\t Hist trigger handlers and actions are executed whenever a\n"
"\t a histogram entry is added or updated. They take the form:\n\n"
"\t <handler>.<action>\n\n"
"\t The available handlers are:\n\n"
"\t onmatch(matching.event) - invoke on addition or update\n"
"\t onmax(var) - invoke if var exceeds current max\n\n"
"\t The available actions are:\n\n"
"\t <synthetic_event>(param list) - generate synthetic event\n"
"\t save(field,...) - save current event fields\n"
#endif
;

Expand Down
Loading

0 comments on commit 17bcfea

Please sign in to comment.