5.15.226-rc1 review
Subsystems (7)
Greg Kroah-Hartman
maintainerPATCH 2191/2214 watch_queue: keep info_id separate from rcu_head
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhiyu Zhang <[email protected]>
[ Upstream commit 53d72818f9e2aeb03a6053544ee6efa4eb2a3988 ]
struct watch overlays info_id with rcu_head. A notification poster reads info_id under rcu_read_lock(), but a concurrent final put can enqueue the watch with call_rcu(). Enqueueing the callback writes rcu_head before the grace period has elapsed, so it can corrupt info_id while the object remains legally visible to the reader.
__post_watch_notification() then merges that value into the notification info word without masking it. Pointer bits can corrupt WATCH_INFO_LENGTH and make post_one_notification() copy beyond the posting task's stack record.
Give info_id storage separate from rcu_head so RCU enqueueing cannot modify it. Place it after the kref, which uses existing tail padding on x86-64. Mask info_id with WATCH_INFO_ID at the point of use as an additional invariant check.
An unprivileged shell and keyctl reproducer was run for 30 seconds in QEMU. The vulnerable baseline produced malformed notification lengths, while this change completed with 288631 key notifications and no malformed record.
--- include/linux/watch_queue.h | 6 ++---- kernel/watch_queue.c | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-)
include/linux/watch_queue.h +2 -4
@@ -53,10 +53,7 @@ struct watch_queue {* Representation of a watch on an object. */ struct watch { -union { -struct rcu_head rcu; -u32 info_id;/* ID to be OR'd in to info field */ - }; +struct rcu_head rcu;struct watch_queue __rcu *queue;/* Queue to post events to */ struct hlist_node queue_node;/* Link in queue->watches */ struct watch_list __rcu *watch_list;
@@ -65,6 +62,7 @@ struct watch {void *private;/* Private data for the watched object */ u64 id;/* Internal identifier */ struct kref usage;/* Object usage count */ +u32 info_id;/* ID to be OR'd in to info field */ };/*
kernel/watch_queue.c +1 -1
@@ -217,7 +217,7 @@ void __post_watch_notification(struct watch_list *wlist,if (watch->id != id)continue ; n->info &= ~WATCH_INFO_ID ; - n->info |= watch->info_id; + n->info |= watch->info_id &WATCH_INFO_ID ; wqueue =rcu_dereference (watch->queue); wf =rcu_dereference (wqueue->filter);
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 2192/2214 splice: retry tee() instead of returning 0 when it races
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nickolai Zeldovich <[email protected]>
[ Upstream commit b2aa970a0a03c117306f48d75a4c3125a8cc9957 ]
tee() can return 0 while the input pipe still has writers, when another task reads the input pipe or fills the output pipe at the same time. tee(2) documents 0 as "no data was copied" because the input pipe has no writers, and loops built on it (the man page example breaks out on 0) stop early. In a test with one thread writing 1 byte at a time to the input pipe, one reading it and one draining the output pipe, about one tee() call in 150 returned 0.
do_tee() runs ipipe_prep() and opipe_prep() to wait for data and room, each under its own pipe lock, and only then takes both locks in link_pipe(). If the input pipe was emptied or the output pipe filled in between, link_pipe() finds nothing to do and returns 0. splice_pipe_to_pipe(), which was modelled on tee(), handles the same race by dropping both locks and going back to the prep steps ("A zero return value means EOF, so retry instead"), and returns -EAGAIN for SPLICE_F_NONBLOCK.
Do the same in link_pipe(): move the prep steps into it and retry when nothing was linked although the input pipe still has writers.
Tested under QEMU (x86_64) with the program in the notes: 154 of 22698 tee() calls returned 0 before the change, none of 34429 after it.
--- fs/splice.c | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-)
fs/splice.c +31 -12
@@ -1621,6 +1621,15 @@ static int link_pipe(struct pipe_inode_info *ipipe,unsigned int i_mask, o_mask;int ret =0 ; +retry: + ret =ipipe_prep (ipipe, flags); +if (ret) +return ret; + + ret =opipe_prep (opipe, flags); +if (ret) +return ret; +/* * Potential ABBA deadlock, work around it by ordering lock * grabbing by pipe info address. Otherwise two different processes
@@ -1644,13 +1653,32 @@ static int link_pipe(struct pipe_inode_info *ipipe, i_head = ipipe->head; o_tail = opipe->tail; +if (pipe_empty (i_head, i_tail) && !ipipe->writers) +break ; +/* * If we have iterated all input buffers or run out of * output room, break. */ if (pipe_empty (i_head, i_tail) || -pipe_full (o_head, o_tail, opipe->max_usage)) -break ; +pipe_full (o_head, o_tail, opipe->max_usage)) { +if (ret) +break ; + +if (flags &SPLICE_F_NONBLOCK ) { + ret = -EAGAIN ; +break ; + } + +/* +* We raced with another reader/writer and haven't +* linked any buffers. A zero return value means EOF, +* so retry instead. +*/ +pipe_unlock (ipipe); +pipe_unlock (opipe); + goto retry; + } ibuf = &ipipe->bufs[i_tail & i_mask]; obuf = &opipe->bufs[o_head & o_mask];
@@ -1720,16 +1748,7 @@ long do_tee(struct file *in, struct file *out, size_t len, unsigned int flags)if ((in->f_flags | out->f_flags) &O_NONBLOCK ) flags |=SPLICE_F_NONBLOCK ; -/* -* Keep going, unless we encounter an error. The ipipe/opipe -* ordering doesn't really matter. -*/ - ret =ipipe_prep (ipipe, flags); -if (!ret) { - ret =opipe_prep (opipe, flags); -if (!ret) - ret =link_pipe (ipipe, opipe, len, flags); - } + ret =link_pipe (ipipe, opipe, len, flags); }if (ret >0 ) {
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 2193/2214 ucount: read the parent ucounts before dropping the rlimit count
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nickolai Zeldovich <[email protected]>
[ Upstream commit 38bf603d1ea5d5a65a9cb277df75327ffec01ff1 ]
do_dec_rlimit_put_ucounts() drops its share of iter->rlimit[type] and only then loads iter->ns->ucounts. If the decrement leaves the count non-zero, a concurrent caller can take it to zero and put the last reference, which frees the ucounts and possibly its user namespace with kfree_rcu(). An exiting task frees its pending signals without siglock or any RCU read-side section, so when it is preempted between the decrement and the load for a grace period it reads freed memory and then decrements a counter through the pointer it found there.
A pending signal holds no reference on its ucounts: the reference is taken by whoever moves the count from 0 to 1 and dropped by whoever moves it back to 0, so the caller's share of the count is all that keeps iter alive, and only until it is dropped.
Load the parent first; it stays pinned by the caller's share of its own count.
--- kernel/ucount.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
kernel/ucount.c +5 -2
@@ -288,9 +288,12 @@ static void do_dec_rlimit_put_ucounts(struct ucounts *ucounts, {struct ucounts *iter, *next;for (iter = ucounts; iter != last; iter = next) { -long dec =atomic_long_sub_return (1 , &iter->rlimit[type]); -WARN_ON_ONCE (dec <0 ); +long dec; + +/* Our count pins @iter; once it is dropped @iter may be freed. */ next = iter->ns->ucounts; + dec =atomic_long_sub_return (1 , &iter->rlimit[type]); +WARN_ON_ONCE (dec <0 );if (dec ==0 )put_ucounts (iter); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 2194/2214 rtc: ds1685: arm the wake-up alarm at power-off only if an alarm is set
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Imre Kaloz <[email protected]>
[ Upstream commit c2373bcd50d9654b76eac585c7c98105665b3321 ]
ds1685_rtc_poweroff() always sets WIE. The wake-up alarm then compares the time-of-day and date alarm registers, which hold whatever was last written to them, and a match powers the machine straight back on.
Set WIE only when AIE is set in Control B, and clear it otherwise.
--- drivers/rtc/rtc-ds1685.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
drivers/rtc/rtc-ds1685.c +12 -6
@@ -1376,7 +1376,7 @@ module_platform_driver(ds1685_rtc_driver);void __noreturn ds1685_rtc_poweroff (struct platform_device *pdev) { -u8 ctrla, ctrl4a, ctrl4b; +u8 ctrla, ctrlb, ctrl4a, ctrl4b;struct ds1685_priv *rtc;/* Check for valid RTC data, else, spin forever. */
@@ -1403,6 +1403,8 @@ ds1685_rtc_poweroff(struct platform_device *pdev) ctrla &= ~(RTC_CTRL_A_DV2 ); rtc->write (rtc,RTC_CTRL_A , ctrla); + ctrlb = rtc->read (rtc,RTC_CTRL_B ); +/* * Read Control 4A and check the status of the auxillary * battery. This must be present and working (VRT2 = 1)
@@ -1417,13 +1419,17 @@ ds1685_rtc_poweroff(struct platform_device *pdev)/* * The auxillary battery is present and working. -* Enable extended functions (ABE=1), enable -* wake-up (WIE=1), and enable kickstart (KSE=1) -* in Control 4B. +* Enable extended functions (ABE=1) and kickstart +* (KSE=1) in Control 4B. Enable wake-up (WIE=1) only +* if an alarm is set, else stale alarm registers +* can power the system back on. */ ctrl4b = rtc->read (rtc,RTC_EXT_CTRL_4B ); - ctrl4b |= (RTC_CTRL_4B_ABE |RTC_CTRL_4B_WIE | -RTC_CTRL_4B_KSE ); + ctrl4b |= (RTC_CTRL_4B_ABE |RTC_CTRL_4B_KSE ); +if (ctrlb &RTC_CTRL_B_AIE ) + ctrl4b |=RTC_CTRL_4B_WIE ; +else + ctrl4b &= ~(RTC_CTRL_4B_WIE ); rtc->write (rtc,RTC_EXT_CTRL_4B , ctrl4b); }
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 2195/2214 rtc: ds1685: do not sleep in the power-off handler
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Imre Kaloz <[email protected]>
[ Upstream commit 21a829af60a7f5c7456f1f0ff9b6b0eff0ceb738 ]
Power-off handlers run from an atomic notifier chain and must not sleep. Use mdelay() for the delay before setting PAB.
--- drivers/rtc/rtc-ds1685.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-ds1685.c +1 -1
@@ -1435,7 +1435,7 @@ ds1685_rtc_poweroff(struct platform_device *pdev)/* Set PAB to 1 in Control 4A to power the system down. */ dev_warn (&pdev->dev,"Powerdown.\n" ); -msleep (20 ); +mdelay (20 ); rtc->write (rtc,RTC_EXT_CTRL_4A , (ctrl4a |RTC_CTRL_4A_PAB ));
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 2196/2214 libbpf: fix cross-endian build with newer libbpf
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dominique Martinet <[email protected]>
commit 087f3964f4b3 ("libbpf: Support layout section handling in BTF") added extra data to the BTF header.
This extra data is ignored in the native case, but when building with different endianness the bswap code in old libbpf would check for strict size equality, leading to build failures such as this when BTF data is generated with a newer version of libbpf (through pahole)
BTFIDS vmlinux.unstripped
libbpf: Can't load BTF with non-native endianness due to unsupported header length 32
FAILED: load BTF from vmlinux.unstripped: Operation not supported make[2]: *** [../scripts/Makefile.vmlinux:72: vmlinux.unstripped] Error 255
Newer libbpf versions also properly ignore trailing data in the bswap case, but the patch is too intrusive to backport, so take the header length comparison fix from it instead.
--- tools/lib/bpf/btf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/lib/bpf/btf.c +2 -2
@@ -217,14 +217,14 @@ static int btf_parse_hdr(struct btf *btf)struct btf_header *hdr = btf->hdr;__u32 meta_left; -if (btf->raw_size <sizeof (struct btf_header )) { + if (btf->raw_size < offsetofend(struct btf_header, str_len)) {pr_debug ("BTF header not found\n" );return -EINVAL ; }if (hdr->magic ==bswap_16 (BTF_MAGIC )) { btf->swapped_endian = true; -if (bswap_32 (hdr->hdr_len) !=sizeof (struct btf_header )) { + if (bswap_32(hdr->hdr_len) < offsetofend(struct btf_header, str_len)) {pr_warn ("Can't load BTF with non-native endianness due to unsupported header length %u\n" ,bswap_32 (hdr->hdr_len));return -ENOTSUP ;
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 2197/2214 PCI/sysfs: Decouple acpi_index from the optional device name element
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Wilczyński <[email protected]>
[ Upstream commit 337bdf853101a0ee66eadf668f0fef21f8276b52 ]
The "_DSM for Naming a PCI or PCI Express Device Under Operating Systems" (PCI Firmware r3.3, sec 4.6.7) returns a package of two elements:
1) Instance number (mandatory Integer)
2) String name (optional String, null string if not populated)
These are exposed as sysfs 'acpi_index' and 'label'. Previously, if the name was malformed, reads of 'acpi_index' failed unnecessarily.
Validate each element only for the attribute that exports it. So "acpi_index" now depends on the instance number alone, and "label" reads fail with -EIO when the name element is neither a string nor a buffer. The package elements pointer is read only after the object type has been checked.
On platforms with a valid instance number and a malformed name element the "acpi_index" attribute starts returning data. Because udev derives the onboard interface name from "acpi_index", an interface on such a platform may be renamed once, on the first boot after this change. That is the attribute assuming the value the firmware always provided.
--- drivers/pci/pci-label.c | 53 +++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 20 deletions(-)
drivers/pci/pci-label.c +33 -20
@@ -157,7 +157,7 @@ static int dsm_get_label(struct device *dev, char *buf, {acpi_handle handle =ACPI_HANDLE (dev);union acpi_object *obj, *tmp; -int len =0 ; +int len;if (!handle)return -ENODEV ;
@@ -167,30 +167,43 @@ static int dsm_get_label(struct device *dev, char *buf,if (!obj)return -EIO ; +if (obj->type !=ACPI_TYPE_PACKAGE || obj->package.count !=2 ) { + len = -EIO ; + goto out; + } + tmp = obj->package.elements; -if (obj->type ==ACPI_TYPE_PACKAGE && obj->package.count ==2 && - tmp[0 ].type ==ACPI_TYPE_INTEGER && - (tmp[1 ].type ==ACPI_TYPE_STRING || - tmp[1 ].type ==ACPI_TYPE_BUFFER )) { -/* -* The second string element is optional even when -* this _DSM is implemented; when not implemented, -* this entry must return a null string. -*/ -if (attr ==ACPI_ATTR_INDEX_SHOW ) { - len =sysfs_emit (buf,"%llu\n" , tmp->integer.value); - }else if (attr ==ACPI_ATTR_LABEL_SHOW ) { -if (tmp[1 ].type ==ACPI_TYPE_STRING ) - len =sysfs_emit (buf,"%s\n" , - tmp[1 ].string.pointer); -else if (tmp[1 ].type ==ACPI_TYPE_BUFFER ) - len =dsm_label_utf16s_to_utf8s (tmp +1 , buf); - } +if (tmp[0 ].type !=ACPI_TYPE_INTEGER ) { + len = -EIO ; + goto out; } +if (attr ==ACPI_ATTR_INDEX_SHOW ) { + len =sysfs_emit (buf,"%llu\n" , tmp[0 ].integer.value); + goto out; + } + +/* +* Per PCI Firmware r3.3, sec 4.6.7, the device name is optional +* even when this _DSM is implemented. When not implemented, this +* entry must return a NULL string. +*/ +switch (tmp[1 ].type) { +case ACPI_TYPE_STRING : + len =sysfs_emit (buf,"%s\n" , tmp[1 ].string.pointer); +break ; +case ACPI_TYPE_BUFFER : + len =dsm_label_utf16s_to_utf8s (&tmp[1 ], buf); +break ; +default : + len = -EIO ; +break ; + } + +out:ACPI_FREE (obj); -return len >0 ? len : -EIO ; +return len; } static ssize_t label_show(struct device *dev, struct device_attribute *attr,
Signature · 1 line
2.53.0
Greg Kroah-Hartman
maintainerPATCH 2198/2214 irqchip/gic-v3-its: Fix over allocation in itt_alloc_pool()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Price <[email protected]>
commit bc88d44bd7e45b992cf8c2c2ffbc7bb3e24db4a7 upstream.
itt_alloc_pool() calls its_alloc_pages_node() to allocate an individual page to add to the pool (for allocations <PAGE_SIZE). However the final argument of its_alloc_pages_node() is the page order not the number of pages. Currently it allocates two pages and leaks the second page. Fix it by passing 0 instead (1 << 0 = 1 page).
--- drivers/irqchip/irq-gic-v3-its.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/irqchip/irq-gic-v3-its.c +1 -1
@@ -264,7 +264,7 @@ static void *itt_alloc_pool(int node, inif (addr)break ; - page =its_alloc_pages_node (node,GFP_KERNEL | __GFP_ZERO,1 ); + page =its_alloc_pages_node (node,GFP_KERNEL | __GFP_ZERO,0 );if (!page)break ;
Greg Kroah-Hartman
maintainerPATCH 2199/2214 tracing/histogram: Wrap remaining shell snippets in code blocks
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bagas Sanjaya <[email protected]>
commit a2ff84a5d1e65c7d1178f24ecf39fc55283fbd14 upstream.
Most shell command snippets (echo/cat) and their output are already in literal code blocks. However a few still isn't wrapped, in which the htmldocs output is ugly.
Wrap the remaining unwrapped snippets, while also fix recent kernel test robot warnings.
--- Documentation/trace/histogram.rst | 103 +++++++++++++++++++------------------- 1 file changed, 52 insertions(+), 51 deletions(-)
Documentation/trace/histogram.rst +52 -51
@@ -1863,7 +1863,7 @@ A histogram can now be defined for the n The above shows the latency "lat" in a power of 2 grouping. Like any other event, once a histogram is enabled for the event, the -output can be displayed by reading the event's 'hist' file. +output can be displayed by reading the event's 'hist' file:: # cat /sys/kernel/debug/tracing/events/synthetic/wakeup_latency/hist
@@ -1910,7 +1910,7 @@ output can be displayed by reading the e The latency values can also be grouped linearly by a given size with -the ".buckets" modifier and specify a size (in this case groups of 10). +the ".buckets" modifier and specify a size (in this case groups of 10):: # echo 'hist:keys=pid,prio,lat.buckets=10:sort=lat' >> \ /sys/kernel/debug/tracing/events/synthetic/wakeup_latency/trigger
@@ -1947,7 +1947,7 @@ that range ends and can be smaller than To save stacktraces, create a synthetic event with a field of type "unsigned long[]" or even just "long[]". For example, to see how long a task is blocked in an -uninterruptible state: +uninterruptible state:: # cd /sys/kernel/tracing # echo 's:block_lat pid_t pid; u64 delta; unsigned long[] stack;' > dynamic_events
@@ -1992,7 +1992,8 @@ uninterruptible state: => kthread+0xe9/0x110 => ret_from_fork+0x2c/0x50 -A synthetic event that has a stacktrace field may use it as a key in histogram: +A synthetic event that has a stacktrace field may use it as a key in +histogram:: # echo 'hist:delta.buckets=100,stack.stacktrace:sort=delta' > events/synthetic/block_lat/trigger # cat events/synthetic/block_lat/hist
@@ -2185,11 +2186,11 @@ The following commonly-used handler.acti wakeup_new_test($testpid) if comm=="cyclictest"' >> \ /sys/kernel/debug/tracing/events/sched/sched_wakeup_new/trigger - Or, equivalently, using the 'trace' keyword syntax: + Or, equivalently, using the 'trace' keyword syntax:: - # echo 'hist:keys=$testpid:testpid=pid:onmatch(sched.sched_wakeup_new).\ - trace(wakeup_new_test,$testpid) if comm=="cyclictest"' >> \ - /sys/kernel/debug/tracing/events/sched/sched_wakeup_new/trigger + # echo 'hist:keys=$testpid:testpid=pid:onmatch(sched.sched_wakeup_new).\ + trace(wakeup_new_test,$testpid) if comm=="cyclictest"' >> \ + /sys/kernel/debug/tracing/events/sched/sched_wakeup_new/trigger Creating and displaying a histogram based on those events is now just a matter of using the fields and new synthetic event in the
@@ -2322,48 +2323,48 @@ The following commonly-used handler.acti resulting latency, stored in wakeup_lat, exceeds the current maximum latency, a snapshot is taken. As part of the setup, all the scheduler events are also enabled, which are the events that - will show up in the snapshot when it is taken at some point: + will show up in the snapshot when it is taken at some point:: - # echo 1 > /sys/kernel/debug/tracing/events/sched/enable + # echo 1 > /sys/kernel/debug/tracing/events/sched/enable - # echo 'hist:keys=pid:ts0=common_timestamp.usecs \ - if comm=="cyclictest"' >> \ - /sys/kernel/debug/tracing/events/sched/sched_waking/trigger - - # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0: \ - onmax($wakeup_lat).save(next_prio,next_comm,prev_pid,prev_prio, \ - prev_comm):onmax($wakeup_lat).snapshot() \ - if next_comm=="cyclictest"' >> \ - /sys/kernel/debug/tracing/events/sched/sched_switch/trigger + # echo 'hist:keys=pid:ts0=common_timestamp.usecs \ + if comm=="cyclictest"' >> \ + /sys/kernel/debug/tracing/events/sched/sched_waking/trigger + + # echo 'hist:keys=next_pid:wakeup_lat=common_timestamp.usecs-$ts0: \ + onmax($wakeup_lat).save(next_prio,next_comm,prev_pid,prev_prio, \ + prev_comm):onmax($wakeup_lat).snapshot() \ + if next_comm=="cyclictest"' >> \ + /sys/kernel/debug/tracing/events/sched/sched_switch/trigger When the histogram is displayed, for each bucket the max value and the saved values corresponding to the max are displayed following the rest of the fields. If a snapshot was taken, there is also a message indicating that, - along with the value and event that triggered the global maximum: + along with the value and event that triggered the global maximum:: - # cat /sys/kernel/debug/tracing/events/sched/sched_switch/hist - { next_pid: 2101 } hitcount: 200 - max: 52 next_prio: 120 next_comm: cyclictest \ - prev_pid: 0 prev_prio: 120 prev_comm: swapper/6 - - { next_pid: 2103 } hitcount: 1326 - max: 572 next_prio: 19 next_comm: cyclictest \ - prev_pid: 0 prev_prio: 120 prev_comm: swapper/1 - - { next_pid: 2102 } hitcount: 1982 \ - max: 74 next_prio: 19 next_comm: cyclictest \ - prev_pid: 0 prev_prio: 120 prev_comm: swapper/5 - - Snapshot taken (see tracing/snapshot). Details: - triggering value { onmax($wakeup_lat) }: 572 \ - triggered by event with key: { next_pid: 2103 } - - Totals: - Hits: 3508 - Entries: 3 - Dropped: 0 + # cat /sys/kernel/debug/tracing/events/sched/sched_switch/hist + { next_pid: 2101 } hitcount: 200 + max: 52 next_prio: 120 next_comm: cyclictest \ + prev_pid: 0 prev_prio: 120 prev_comm: swapper/6 + + { next_pid: 2103 } hitcount: 1326 + max: 572 next_prio: 19 next_comm: cyclictest \ + prev_pid: 0 prev_prio: 120 prev_comm: swapper/1 + + { next_pid: 2102 } hitcount: 1982 \ + max: 74 next_prio: 19 next_comm: cyclictest \ + prev_pid: 0 prev_prio: 120 prev_comm: swapper/5 + + Snapshot taken (see tracing/snapshot). Details: + triggering value { onmax($wakeup_lat) }: 572 \ + triggered by event with key: { next_pid: 2103 } + + Totals: + Hits: 3508 + Entries: 3 + Dropped: 0 In the above case, the event that triggered the global maximum has the key with next_pid == 2103. If you look at the bucket that has
@@ -2441,15 +2442,15 @@ The following commonly-used handler.acti $cwnd variable. If the value has changed, a snapshot is taken. As part of the setup, all the scheduler and tcp events are also enabled, which are the events that will show up in the snapshot - when it is taken at some point: + when it is taken at some point:: - # echo 1 > /sys/kernel/debug/tracing/events/sched/enable - # echo 1 > /sys/kernel/debug/tracing/events/tcp/enable + # echo 1 > /sys/kernel/debug/tracing/events/sched/enable + # echo 1 > /sys/kernel/debug/tracing/events/tcp/enable - # echo 'hist:keys=dport:cwnd=snd_cwnd: \ - onchange($cwnd).save(snd_wnd,srtt,rcv_wnd): \ - onchange($cwnd).snapshot()' >> \ - /sys/kernel/debug/tracing/events/tcp/tcp_probe/trigger + # echo 'hist:keys=dport:cwnd=snd_cwnd: \ + onchange($cwnd).save(snd_wnd,srtt,rcv_wnd): \ + onchange($cwnd).snapshot()' >> \ + /sys/kernel/debug/tracing/events/tcp/tcp_probe/trigger When the histogram is displayed, for each bucket the tracked value and the saved values corresponding to that value are displayed
@@ -2472,10 +2473,10 @@ The following commonly-used handler.acti { dport: 443 } hitcount: 211 changed: 10 snd_wnd: 26960 srtt: 17379 rcv_wnd: 28800 - Snapshot taken (see tracing/snapshot). Details:: + Snapshot taken (see tracing/snapshot). Details: - triggering value { onchange($cwnd) }: 10 - triggered by event with key: { dport: 80 } + triggering value { onchange($cwnd) }: 10 + triggered by event with key: { dport: 80 } Totals: Hits: 414
Greg Kroah-Hartman
maintainerPATCH 2200/2214 selftests/net: fix typo in tcp_mmap
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
commit 905a9eb5f636f3312964b162362e4d6ca4e37378 upstream.
kernel test robot reported the following warning:
All warnings (new ones prefixed by >>):
tcp_mmap.c: In function 'child_thread':
Quoted 1 line
Quoted 1 line
tcp_mmap.c:211:61: warning: 'lu' may be used uninitialized in this function [-Wmaybe-uninitialized]
211 | zc.length = min(chunk_size, FILE_SZ - lu);
We want to read FILE_SZ bytes, so the correct expression should be (FILE_SZ - total)
--- tools/testing/selftests/net/tcp_mmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/net/tcp_mmap.c +1 -1
@@ -206,7 +206,7 @@ void *child_thread(void *arg)memset (&zc,0 ,sizeof (zc)); zc.address = (__u64)((unsigned long )addr); - zc.length =min (chunk_size,FILE_SZ - lu); + zc.length =min (chunk_size,FILE_SZ - total); res =getsockopt (fd,IPPROTO_TCP ,TCP_ZEROCOPY_RECEIVE , &zc, &zc_len);
Greg Kroah-Hartman
maintainerPATCH 2201/2214 dmaengine: ste_dma40: use correct print specfier for resource_size_t
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vinod Koul <[email protected]>
commit ef1e1c41a11d37069029bc0563c2fa6915d9880b upstream.
We should use %pR for printing resource_size_t, so update that fixing the warning:
drivers/dma/ste_dma40.c:3556:25: warning: format specifies type 'unsigned int' but the argument has type 'resource_size_t' (aka 'unsigned long long') [-Wformat]
--- drivers/dma/ste_dma40.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/dma/ste_dma40.c +2 -2
@@ -3644,8 +3644,8 @@ static int __init d40_probe(struct platf } base->lcpa_size =resource_size (&res_lcpa); base->phy_lcpa = res_lcpa.start; -dev_info (dev,"found LCPA SRAM at 0x%08x, size 0x%08x\n" , - (u32 )base->phy_lcpa, base->lcpa_size); +dev_info (dev,"found LCPA SRAM at 0x%08x, size %pR\n" , + (u32 )base->phy_lcpa, &base->lcpa_size);/* We make use of ESRAM memory for this. */ val =readl (base->virtbase +D40_DREG_LCPA );
Greg Kroah-Hartman
maintainerPATCH 2202/2214 dmaengine: ste_dma40: use proper format string for resource_size_t
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
commit 41be14c71bae05c8daa3de5ae7fd7c2a7bc0d057 upstream.
A fixup for a printk format string warning causes an out-of-bounds variable access as the %pR string expects a struct resource instead of a plain resource_size_t.
Change both to the special %pap and %pap helpers for these types.
--- drivers/dma/ste_dma40.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/dma/ste_dma40.c +2 -2
@@ -3644,8 +3644,8 @@ static int __init d40_probe(struct platf } base->lcpa_size =resource_size (&res_lcpa); base->phy_lcpa = res_lcpa.start; -dev_info (dev,"found LCPA SRAM at 0x%08x, size %pR\n" , - (u32 )base->phy_lcpa, &base->lcpa_size); +dev_info (dev,"found LCPA SRAM at %pad, size %pa\n" , + &base->phy_lcpa, &base->lcpa_size);/* We make use of ESRAM memory for this. */ val =readl (base->virtbase +D40_DREG_LCPA );
Greg Kroah-Hartman
maintainerPATCH 2203/2214 kconfig: initialize sym->curr.tri to no for all symbol types again
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Masahiro Yamada <[email protected]>
commit bfef491df67022c56aab3b831044f8d259f9441f upstream.
Geert Uytterhoeven reported that commit 4e244c10eab3 ("kconfig: remove unneeded symbol_empty variable") changed the default value of CONFIG_LOG_CPU_MAX_BUF_SHIFT from 12 to 0.
As it turned out, this is an undefined behavior because sym_calc_value() stopped setting the sym->curr.tri field for 'int', 'hex', and 'string' symbols.
This commit restores the original behavior, where 'int', 'hex', 'string' symbols are interpreted as false if used in boolean contexts.
CONFIG_LOG_CPU_MAX_BUF_SHIFT will default to 12 again, irrespective of CONFIG_BASE_SMALL. Presumably, this is not the intended behavior, as already reported [1], but this is another issue that should be addressed by a separate patch.
[1]: https://lore.kernel.org/all/[email protected]/
--- scripts/kconfig/symbol.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
scripts/kconfig/symbol.c +3 -1
@@ -364,6 +364,8 @@ void sym_calc_value(struct symbol *sym) oldval = sym->curr; + newval.tri = no; +switch (sym->type) {case S_INT : newval.val ="0" ;
@@ -376,7 +378,7 @@ void sym_calc_value(struct symbol *sym)break ;case S_BOOLEAN :case S_TRISTATE : - newval = symbol_no.curr; + newval.val ="n" ;break ;default : sym->curr.val = sym->name;
Greg Kroah-Hartman
maintainerPATCH 2204/2214 irqchip/gic-v3-its: Restore quirk probing for ACPI-based systems
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Zyngier <[email protected]>
commit 8b02da04ad978827e5ccd675acf170198f747a7a upstream.
While refactoring the way the ITSs are probed, the handling of quirks applicable to ACPI-based platforms was lost. As a result, systems such as HIP07 lose their GICv4 functionnality, and some other may even fail to boot, unless they are configured to boot with DT.
Move the enabling of quirks into its_probe_one(), making it common to all firmware implementations.
--- drivers/irqchip/irq-gic-v3-its.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/irqchip/irq-gic-v3-its.c +2 -1
@@ -5137,6 +5137,8 @@ static int __init its_probe_one(struct iu32 ctlr;int err; +its_enable_quirks (its); +if (is_v4 (its)) {if (!(its->typer &GITS_TYPER_VMOVP )) { err =its_compute_its_list_map (its);
@@ -5476,7 +5478,6 @@ static int __init its_of_probe(struct deif (!its)return -ENOMEM ; -its_enable_quirks (its); err =its_probe_one (its);if (err) {its_node_destroy (its);
Greg Kroah-Hartman
maintainerPATCH 2205/2214 nvmet: do not return reserved for empty TSAS values
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hannes Reinecke <[email protected]>
commit f31e85a4d7c6ac4a3e014129c9cdc31592ea29f3 upstream.
The 'TSAS' value is only defined for TCP and RDMA, but returning 'reserved' for undefined values tricked nvmetcli to try to write 'reserved' when restoring from a config file. This caused an error and the configuration would not be applied.
--- drivers/nvme/target/configfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/configfs.c +1 -1
@@ -371,7 +371,7 @@ static ssize_t nvmet_addr_tsas_show(strureturn sprintf (page,"%s\n" , nvmet_addr_tsas_rdma[i].name); } } -return sprintf (page,"reserved\n" ); +return sprintf (page,"\n" ); } static ssize_t nvmet_addr_tsas_store(struct config_item *item,
Greg Kroah-Hartman
maintainerPATCH 2206/2214 selftests/net: fix EVP_MD_CTX leak in tcp_mmap
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wang Yan <[email protected]>
commit f4ef35efbb49527293309f668ea73ec5de9b8e7a upstream.
In tcp_mmap.c, both child_thread() and main() allocate an EVP_MD_CTX via EVP_MD_CTX_new() when integrity checking is enabled, but neither function releases the context. child_thread() misses the free in its common cleanup block, and main() returns without freeing the context.
This results in a SHA256 context leak on every run that uses the ‑i (integrity) option. Add the missing EVP_MD_CTX_free() calls to the appropriate cleanup paths to fix the leak.
--- tools/testing/selftests/net/tcp_mmap.c | 4 ++++ 1 file changed, 4 insertions(+)
tools/testing/selftests/net/tcp_mmap.c +4 -0
@@ -297,6 +297,8 @@ end: ru.ru_nvcsw); } error: +if (ctx) +EVP_MD_CTX_free (ctx);munmap (buffer, buffer_sz);close (fd);if (zflg)
@@ -587,6 +589,8 @@ int main(int argc, char *argv[])EVP_DigestFinal_ex (ctx, digest, &digest_len);send (fd, digest, (size_t )SHA256_DIGEST_LENGTH ,0 ); } +if (ctx) +EVP_MD_CTX_free (ctx);close (fd);munmap (buffer, buffer_sz);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 2207/2214 irqchip/gic-v3-its: Fix its node leak in gic_acpi_parse_madt_its()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kemeng Shi <[email protected]>
commit 698a8648ca8051d34722b09b8a8088c741120ac3 upstream.
Fix its node leak when its_probe_one() failed ingic_acpi_parse_madt_its().
--- drivers/irqchip/irq-gic-v3-its.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/irqchip/irq-gic-v3-its.c +6 -2
@@ -5627,9 +5627,13 @@ static int __init gic_acpi_parse_madt_it } err =its_probe_one (its); -if (!err) -return 0 ; +if (err) + goto probe_err; +return 0 ; + +probe_err: +its_node_destroy (its); node_err:iort_deregister_domain_token (its_entry->translation_id); dom_err:
Greg Kroah-Hartman
maintainerPATCH 2208/2214 dmaengine: dw-axi-dmac: Fix uninitialized variable in axi_chan_block_xfer_start()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tim Gardner <[email protected]>
commit 885633075847f475f26a29249d772cc0da85d8cd upstream.
Coverity complains of an uninitialized variable:
5. uninit_use_in_call: Using uninitialized value config.dst_per when calling axi_chan_config_write. [show details]
6. uninit_use_in_call: Using uninitialized value config.hs_sel_src when calling axi_chan_config_write. [show details] CID 121164 (#1-3 of 3): Uninitialized scalar variable (UNINIT)
7. uninit_use_in_call: Using uninitialized value config.src_per when calling axi_chan_config_write. [show details]
418 axi_chan_config_write(chan, &config);
Fix this by initializing the structure to 0 which should at least be benign in axi_chan_config_write(). Also fix what looks like a cut-n-paste error when initializing config.hs_sel_dst.
--- drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +2 -2
@@ -375,7 +375,7 @@ static void axi_chan_block_xfer_start(st struct axi_dma_desc *first) {u32 priority = chan->chip->dw->hdata->priority[chan->id]; -struct axi_dma_chan_config config; +struct axi_dma_chan_config config = {};u32 irq_mask;u8 lms =0 ;/* Select AXI0 master for LLI fetching */
@@ -393,7 +393,7 @@ static void axi_chan_block_xfer_start(st config.tt_fc =DWAXIDMAC_TT_FC_MEM_TO_MEM_DMAC ; config.prior = priority; config.hs_sel_dst =DWAXIDMAC_HS_SEL_HW ; - config.hs_sel_dst =DWAXIDMAC_HS_SEL_HW ; + config.hs_sel_src =DWAXIDMAC_HS_SEL_HW ;switch (chan->direction) {case DMA_MEM_TO_DEV :dw_axi_dma_set_byte_halfword (chan, true);
Greg Kroah-Hartman
maintainerPATCH 2209/2214 tracing/histogram: Fix documentation inline emphasis warning
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kalesh Singh <[email protected]>
commit 93d76e4a0e0112b320c4f0e2a3930ad634628c58 upstream.
This fixes the warning:
Documentation/trace/histogram.rst:1766: WARNING: Inline emphasis start-string without end-string
The issue was caused by an unescaped '*' character.
--- Documentation/trace/histogram.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/trace/histogram.rst +1 -1
@@ -1773,7 +1773,7 @@ using the same key and variable from yet # echo 'hist:key=pid:wakeupswitch_lat=$wakeup_lat+$switchtime_lat ...' >> event3/trigger Expressions support the use of addition, subtraction, multiplication and -division operators (+-*/). +division operators (+-\*/). Note that division by zero always returns -1.
Greg Kroah-Hartman
maintainerPATCH 2210/2214 docs/process/howto: Replace C89 with C11
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Akira Yokosawa <[email protected]>
commit 2f3f53d62307262f0086804ea7cea99b0e085450 upstream.
Commit e8c07082a810 ("Kbuild: move to -std=gnu11") updated process/programming-language.rst, but failed to update process/howto.rst.
Update howto.rst and resolve the inconsistency.
--- Documentation/process/howto.rst | 2 +- Documentation/translations/it_IT/process/howto.rst | 2 +- Documentation/translations/ja_JP/howto.rst | 2 +- Documentation/translations/ko_KR/howto.rst | 2 +- Documentation/translations/zh_CN/process/howto.rst | 2 +- Documentation/translations/zh_TW/process/howto.rst | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-)
Documentation/process/howto.rst +1 -1
@@ -36,7 +36,7 @@ experience, the following books are good - "C: A Reference Manual" by Harbison and Steele [Prentice Hall] The kernel is written using GNU C and the GNU toolchain. While it -adheres to the ISO C89 standard, it uses a number of extensions that are +adheres to the ISO C11 standard, it uses a number of extensions that are not featured in the standard. The kernel is a freestanding C environment, with no reliance on the standard C library, so some portions of the C standard are not supported. Arbitrary long long
Documentation/translations/it_IT/process/howto.rst +1 -1
@@ -44,7 +44,7 @@ altro, utili riferimenti: - "C: A Reference Manual" di Harbison and Steele [Prentice Hall] Il kernel è stato scritto usando GNU C e la toolchain GNU. -Sebbene si attenga allo standard ISO C89, esso utilizza una serie di +Sebbene si attenga allo standard ISO C11, esso utilizza una serie di estensioni che non sono previste in questo standard. Il kernel è un ambiente C indipendente, che non ha alcuna dipendenza dalle librerie C standard, così alcune parti del C standard non sono supportate.
Documentation/translations/ja_JP/howto.rst +1 -1
@@ -65,7 +65,7 @@ Linux カーネル開発のやり方 - 『新・詳説 C 言語 H&S リファレンス』 (サミュエル P ハービソン/ガイ L スティール共著 斉藤 信男監訳)[ソフトバンク] カーネルは GNU C と GNU ツールチェインを使って書かれています。カーネル -は ISO C89 仕様に準拠して書く一方で、標準には無い言語拡張を多く使って +は ISO C11 仕様に準拠して書く一方で、標準には無い言語拡張を多く使って います。カーネルは標準 C ライブラリに依存しない、C 言語非依存環境です。 そのため、C の標準の中で使えないものもあります。特に任意の long long の除算や浮動小数点は使えません。カーネルがツールチェインや C 言語拡張
Documentation/translations/ko_KR/howto.rst +1 -1
@@ -62,7 +62,7 @@ Documentation/process/howto.rst - "Practical C Programming" by Steve Oualline [O'Reilly] - "C: A Reference Manual" by Harbison and Steele [Prentice Hall] -커널은 GNU C와 GNU 툴체인을 사용하여 작성되었다. 이 툴들은 ISO C89 표준을 +커널은 GNU C와 GNU 툴체인을 사용하여 작성되었다. 이 툴들은 ISO C11 표준을 따르는 반면 표준에 있지 않은 많은 확장기능도 가지고 있다. 커널은 표준 C 라이브러리와는 관계없이 freestanding C 환경이어서 C 표준의 일부는 지원되지 않는다. 임의의 long long 나누기나 floating point는 지원되지 않는다.
Documentation/translations/zh_CN/process/howto.rst +1 -1
@@ -45,7 +45,7 @@ Linux内核大部分是由C语言写成� - "C: A Reference Manual" by Harbison and Steele [Prentice Hall] 《C语言参考手册(原书第5版)》(邱仲潘 等译)[机械工业出版社] -Linux内核使用GNU C和GNU工具链开发。虽然它遵循ISO C89标准,但也用到了一些 +Linux内核使用GNU C和GNU工具链开发。虽然它遵循ISO C11标准,但也用到了一些 标准中没有定义的扩展。内核是自给自足的C环境,不依赖于标准C库的支持,所以 并不支持C标准中的部分定义。比如long long类型的大数除法和浮点运算就不允许 使用。有时候确实很难弄清楚内核对工具链的要求和它所使用的扩展,不幸的是目
Documentation/translations/zh_TW/process/howto.rst +1 -1
@@ -48,7 +48,7 @@ Linux內核大部分是由C語言寫成� - "C: A Reference Manual" by Harbison and Steele [Prentice Hall] 《C語言參考手冊(原書第5版)》(邱仲潘 等譯)[機械工業出版社] -Linux內核使用GNU C和GNU工具鏈開發。雖然它遵循ISO C89標準,但也用到了一些 +Linux內核使用GNU C和GNU工具鏈開發。雖然它遵循ISO C11標準,但也用到了一些 標準中沒有定義的擴展。內核是自給自足的C環境,不依賴於標準C庫的支持,所以 並不支持C標準中的部分定義。比如long long類型的大數除法和浮點運算就不允許 使用。有時候確實很難弄清楚內核對工具鏈的要求和它所使用的擴展,不幸的是目
Greg Kroah-Hartman
maintainerPATCH 2211/2214 seq_buf: Make DECLARE_SEQ_BUF() usable
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nathan Lynch <[email protected]>
commit 7a8e9cdf9405819105ae7405cd91e482bf574b01 upstream.
Using the address operator on the array doesn't work:
./include/linux/seq_buf.h:27:27: error: initialization of ‘char *’
from incompatible pointer type ‘char (*)[128]’ [-Werror=incompatible-pointer-types]
27 | .buffer = &__ ## NAME ## _buffer, \
| ^
Apart from fixing that, we can improve DECLARE_SEQ_BUF() by using a compound literal to define the buffer array without attaching a name to it. This makes the macro a single statement, allowing constructs such as:
static DECLARE_SEQ_BUF(my_seq_buf, MYSB_SIZE);
to work as intended.
--- include/linux/seq_buf.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
include/linux/seq_buf.h +1 -2
@@ -22,9 +22,8 @@ struct seq_buf { };#define DECLARE_SEQ_BUF (NAME ,SIZE ) \ - char __ ## NAME ## _buffer[SIZE] = ""; \ struct seq_buf NAME = { \ - .buffer = &__ ## NAME ## _buffer, \ + .buffer = (char[SIZE]) { 0 }, \ .size = SIZE, \ }
Greg Kroah-Hartman
maintainerPATCH 2212/2214 printk: Fix LOG_CPU_MAX_BUF_SHIFT when BASE_SMALL is enabled
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yoann Congal <[email protected]>
commit 320bf43190514be5c00e11f47ec2160dd3993844 upstream.
LOG_CPU_MAX_BUF_SHIFT default value depends on BASE_SMALL:
config LOG_CPU_MAX_BUF_SHIFT
default 12 if !BASE_SMALL
default 0 if BASE_SMALL
But, BASE_SMALL is a config of type int and "!BASE_SMALL" is always evaluated to true whatever is the value of BASE_SMALL.
This patch fixes this by using the correct conditional operator for int type : BASE_SMALL != 0.
Note: This changes CONFIG_LOG_CPU_MAX_BUF_SHIFT=12 to CONFIG_LOG_CPU_MAX_BUF_SHIFT=0 for BASE_SMALL defconfigs, but that will not be a big impact due to this code in kernel/printk/printk.c:
/* by default this will only continue through for large > 64 CPUs */ if (cpu_extra <= __LOG_BUF_LEN / 2)
return;
Systems using CONFIG_BASE_SMALL and having 64+ CPUs should be quite rare.
Quoted 4 lines · John Ogness <[email protected]> (printk reviewer) wrote:
For printk this will mean that
BASE_SMALLsystems were probably previously allocating/using the dynamic ringbuffer and now they will just continue to use the static ringbuffer. Which is fine and saves memory (as it should).
Quoted 4 lines · Petr Mladek <[email protected]> (printk maintainer) wrote:
More precisely, it allocated the buffer dynamically when the sum of per-CPU-extra space exceeded half of the default static ring buffer. This happened for systems with more than 64 CPUs with the default config values.
--- init/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
init/Kconfig +2 -2
@@ -742,8 +742,8 @@ config LOG_CPU_MAX_BUF_SHIFT int "CPU kernel log buffer size contribution (13 => 8 KB, 17 => 128KB)" depends on SMP range 0 21 - default 12 if !BASE_SMALL - default 0 if BASE_SMALL + default 0 if BASE_SMALL != 0 + default 12 depends on PRINTK help This option allows to increase the default ring buffer size
Greg Kroah-Hartman
maintainerPATCH 2213/2214 seq_buf: Do not print an empty line from an overflowed seq_buf_do_printk()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <[email protected]>
commit a09fb764832dd7dbb9ccc38a9830f7294889c8ae upstream.
seq_buf_do_printk() prints a buffer line by line, then prints whatever follows the last newline. When a string has overflowed at exactly a newline, an empty line is printed since the pointer hasn't reached the overflow mark of the seq_buf. Switch to just check if the string is already empty and only print if not.
The only caller is the memory cgroup OOM report, so this could only ever add a blank line to a report whose statistics already did not fit.
Add a test that registers a console to count the records that seq_buf_do_printk() emits. It counts the records carrying the test's marker, and the records holding nothing but a line feed that arrive after one, so that unrelated kernel messages do not disturb it. Both states that reach the flaw are covered: exactly full, and overflowed.
Tests passed under qemu on ARCH=x86_64 with GCC 16.2.0 and CONFIG_KASAN=y, and on big-endian ARCH=s390 with GCC s390x-linux-gnu 16.2.0.
--- lib/seq_buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/seq_buf.c +1 -1
@@ -118,7 +118,7 @@ void seq_buf_do_printk(struct seq_buf *s }/* No trailing LF */ -if (start < s->buffer + s->len) +if (*start)printk ("%s%s\n" , lvl, start); }EXPORT_SYMBOL_GPL (seq_buf_do_printk);
Greg Kroah-Hartman
maintainerPATCH 2214/2214 ASoC: mediatek: mt8195: Fix tuner clock error handling
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: bui duc phuc <[email protected]>
commit 8e5a2eabb0d7cbd6db0b94f7f30e1ca2c0a8994f upstream.
Check and propagate errors from mt8195_afe_enable_clk(). If enabling the tuner clock fails, disable the previously enabled APLL clock.
--- sound/soc/mediatek/mt8195/mt8195-afe-clk.c | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-)
sound/soc/mediatek/mt8195/mt8195-afe-clk.c +19 -5
@@ -241,21 +241,35 @@ static int mt8195_afe_enable_tuner_clk(s unsigned int id) {struct mt8195_afe_private *afe_priv = afe->platform_priv; +int ret;switch (id) {case MT8195_AUD_PLL1 : -mt8195_afe_enable_clk (afe, afe_priv->clk[MT8195_CLK_AUD_APLL ]); -mt8195_afe_enable_clk (afe, afe_priv->clk[MT8195_CLK_AUD_APLL1_TUNER ]); + ret =mt8195_afe_enable_clk (afe, afe_priv->clk[MT8195_CLK_AUD_APLL ]); +if (ret) +return ret; + ret =mt8195_afe_enable_clk (afe, afe_priv->clk[MT8195_CLK_AUD_APLL1_TUNER ]); +if (ret) { +mt8195_afe_disable_clk (afe, afe_priv->clk[MT8195_CLK_AUD_APLL ]); +return ret; + }break ;case MT8195_AUD_PLL2 : -mt8195_afe_enable_clk (afe, afe_priv->clk[MT8195_CLK_AUD_APLL2 ]); -mt8195_afe_enable_clk (afe, afe_priv->clk[MT8195_CLK_AUD_APLL2_TUNER ]); + ret =mt8195_afe_enable_clk (afe, afe_priv->clk[MT8195_CLK_AUD_APLL2 ]); +if (ret) +return ret; + ret =mt8195_afe_enable_clk (afe, afe_priv->clk[MT8195_CLK_AUD_APLL2_TUNER ]); +if (ret) { +mt8195_afe_disable_clk (afe, afe_priv->clk[MT8195_CLK_AUD_APLL2 ]); +return ret; + }break ;default : + ret =0 ;break ; } -return 0 ; +return ret; } static int mt8195_afe_disable_tuner_clk(struct mtk_base_afe *afe,
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.226 release. There are 2214 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 9 lines
Responses should be made by Fri, 20 Nov 2026 14:55:35 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.226-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.
Tested on AMD amd64 12-core and 4-core and x86 1-core systems
and on Intel x86-64 4-core and x86 1-core systems
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.226 release. There are 2214 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 20 Nov 2026 14:55:35 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.226-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
Tested on 2 amd64 laptops (a Lenovo ThinkPad T14 Gen 1 and an Apple MacBook Air 13" 2017). Working well, no regressions observed.
Signature · 1 line
-Barry K. Nathan <[email protected]>
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.226 release. There are 2214 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 20 Nov 2026 14:55:35 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.226-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.226 release. There are 2214 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 9 lines
Responses should be made by Fri, 20 Nov 2026 14:55:35 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.226-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.
Tested on AMD amd64 12-core and 4-core systems
and on Intel x86-64 4-core and x86 1-core systems
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.226 release. There are 2214 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Fri, 20 Nov 2026 14:55:35 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.226-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).