* (no subject)
@ 2024-04-19 15:46 George Guo
2024-04-19 15:46 ` [PATCH 4.19.y v6 1/2] tracing: Remove hist trigger synth_var_refs George Guo
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: George Guo @ 2024-04-19 15:46 UTC (permalink / raw)
To: gregkh, tom.zanussi; +Cc: stable
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 3602 bytes --]
Subject: [PATCH 4.19.y v6 0/2] Double-free bug discovery on testing trigger-field-variable-support.tc
1) About v4-0001-tracing-Remove-hist-trigger-synth_var_refs.patch:
The reason I am backporting this patch is that no one found the double-free bug
at that time, then later the code was removed on upstream, but
4.19-stable has the bug.
This is tested via "./ftracetest test.d/trigger/inter-event/
trigger-field-variable-support.tc"
==================================================================
BUG: KASAN: use-after-free in destroy_hist_field+0x115/0x140
Read of size 4 at addr ffff888012e95318 by task ftracetest/1858
CPU: 1 PID: 1858 Comm: ftracetest Kdump: loaded Tainted: GE 4.19.90-89 #24
Source Version: Unknown
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0
Call Trace:
dump_stack+0xcb/0x10b
print_address_description.cold+0x54/0x249
kasan_report_error.cold+0x63/0xab
? destroy_hist_field+0x115/0x140
__asan_report_load4_noabort+0x8d/0xa0
? destroy_hist_field+0x115/0x140
destroy_hist_field+0x115/0x140
destroy_hist_data+0x4e4/0x9a0
event_hist_trigger_free+0x212/0x2f0
? update_cond_flag+0x128/0x170
? event_hist_trigger_func+0x2880/0x2880
hist_unregister_trigger+0x2f2/0x4f0
event_hist_trigger_func+0x168c/0x2880
? tracing_map_read_var_once+0xd0/0xd0
? create_key_field+0x520/0x520
? __mutex_lock_slowpath+0x10/0x10
event_trigger_write+0x2f4/0x490
? trigger_start+0x180/0x180
? __fget_light+0x369/0x5d0
? count_memcg_event_mm+0x104/0x2b0
? trigger_start+0x180/0x180
__vfs_write+0x81/0x100
vfs_write+0x1e1/0x540
ksys_write+0x12a/0x290
? __ia32_sys_read+0xb0/0xb0
? __close_fd+0x1d3/0x280
do_syscall_64+0xe3/0x2d0
entry_SYSCALL_64_after_hwframe+0x5c/0xc1
RIP: 0033:0x7efdd342ee04
Code: 00 f7 d8 64 89 02 48 c7 c0 ff ff ff ff eb b3 0f 1f 80 00 00 00 00 48
8d 05 39 34 0c 00 8b 00 85 c0 75 13 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff
ff 77 54 f3 c3 66 90 41 54 55 49 89 d4 53 48 89 f5
RSP: 002b:00007ffda01f5e08 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00000000000000b4 RCX: 00007efdd342ee04
RDX: 00000000000000b4 RSI: 000055c5b41b1e90 RDI: 0000000000000001
RBP: 000055c5b41b1e90 R08: 000000000000000a R09: 0000000000000000
R10: 000000000000000a R11: 0000000000000246 R12: 00007efdd34ed5c0
R13: 00000000000000b4 R14: 00007efdd34ed7c0 R15: 00000000000000b4
==================================================================
2) About v4-0002-tracing-Use-var_refs-for-hist-trigger-reference-c.patch:
Only v4-0001-tracing-Remove-hist-trigger-synth_var_refs.patch will lead
to compilation errors:
../kernel/trace/trace_events_hist.c: In function ‘find_var_ref’:
../kernel/trace/trace_events_hist.c:1364:36: error: ‘struct hist_trigger_data’ has no member named ‘n_synth_var_refs’; did you mean ‘n_var_refs’?
1364 | for (i = 0; i < hist_data->n_synth_var_refs; i++) {
| ^~~~~~~~~~~~~~~~
| n_var_refs
../kernel/trace/trace_events_hist.c:1365:41: error: ‘struct hist_trigger_data’ has no member named ‘synth_var_refs’; did you mean ‘n_var_refs’?
1365 | hist_field = hist_data->synth_var_refs[i];
| ^~~~~~~~~~~~~~
| n_var_refs
Tom Zanussi (2):
tracing: Remove hist trigger synth_var_refs
tracing: Use var_refs[] for hist trigger reference checking
kernel/trace/trace_events_hist.c | 86 ++++----------------------------
1 file changed, 11 insertions(+), 75 deletions(-)
--
2.34.1
^ permalink raw reply [flat|nested] 15+ messages in thread* [PATCH 4.19.y v6 1/2] tracing: Remove hist trigger synth_var_refs 2024-04-19 15:46 George Guo @ 2024-04-19 15:46 ` George Guo 2024-04-19 15:46 ` [PATCH 4.19.y v6 2/2] tracing: Use var_refs[] for hist trigger reference checking George Guo 2024-04-23 16:48 ` Greg KH 2 siblings, 0 replies; 15+ messages in thread From: George Guo @ 2024-04-19 15:46 UTC (permalink / raw) To: gregkh, tom.zanussi Cc: stable, Namhyung Kim, Masami Hiramatsu, Steven Rostedt, George Guo From: Tom Zanussi <tom.zanussi@linux.intel.com> commit 912201345f7c39e6b0ac283207be2b6641fa47b9 upstream. All var_refs are now handled uniformly and there's no reason to treat the synth_refs in a special way now, so remove them and associated functions. Link: http://lkml.kernel.org/r/b4d3470526b8f0426dcec125399dad9ad9b8589d.1545161087.git.tom.zanussi@linux.intel.com Acked-by: Namhyung Kim <namhyung@kernel.org> Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: George Guo <guodongtai@kylinos.cn> --- kernel/trace/trace_events_hist.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index e004daf8cad5..e4f5b6894cf2 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -280,8 +280,6 @@ struct hist_trigger_data { struct action_data *actions[HIST_ACTIONS_MAX]; unsigned int n_actions; - struct hist_field *synth_var_refs[SYNTH_FIELDS_MAX]; - unsigned int n_synth_var_refs; struct field_var *field_vars[SYNTH_FIELDS_MAX]; unsigned int n_field_vars; unsigned int n_field_var_str; @@ -3708,20 +3706,6 @@ static void save_field_var(struct hist_trigger_data *hist_data, } -static void destroy_synth_var_refs(struct hist_trigger_data *hist_data) -{ - unsigned int i; - - for (i = 0; i < hist_data->n_synth_var_refs; i++) - destroy_hist_field(hist_data->synth_var_refs[i], 0); -} - -static void save_synth_var_ref(struct hist_trigger_data *hist_data, - struct hist_field *var_ref) -{ - hist_data->synth_var_refs[hist_data->n_synth_var_refs++] = var_ref; -} - static int check_synth_field(struct synth_event *event, struct hist_field *hist_field, unsigned int field_pos) @@ -3884,7 +3868,6 @@ static int onmatch_create(struct hist_trigger_data *hist_data, goto err; } - save_synth_var_ref(hist_data, var_ref); field_pos++; kfree(p); continue; @@ -4631,7 +4614,6 @@ static void destroy_hist_data(struct hist_trigger_data *hist_data) destroy_actions(hist_data); destroy_field_vars(hist_data); destroy_field_var_hists(hist_data); - destroy_synth_var_refs(hist_data); kfree(hist_data); } -- 2.34.1 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* [PATCH 4.19.y v6 2/2] tracing: Use var_refs[] for hist trigger reference checking 2024-04-19 15:46 George Guo 2024-04-19 15:46 ` [PATCH 4.19.y v6 1/2] tracing: Remove hist trigger synth_var_refs George Guo @ 2024-04-19 15:46 ` George Guo 2024-04-23 16:48 ` Greg KH 2 siblings, 0 replies; 15+ messages in thread From: George Guo @ 2024-04-19 15:46 UTC (permalink / raw) To: gregkh, tom.zanussi Cc: stable, Tom Zanussi, Namhyung Kim, Masami Hiramatsu, Steven Rostedt, George Guo From: Tom Zanussi <tzanussi@gmail.com> commit e4f6d245031e04bdd12db390298acec0474a1a46 upstream. Since all the variable reference hist_fields are collected into hist_data->var_refs[] array, there's no need to go through all the fields looking for them, or in separate arrays like synth_var_refs[], which will be going away soon anyway. This also allows us to get rid of some unnecessary code and functions currently used for the same purpose. Link: http://lkml.kernel.org/r/1545246556.4239.7.camel@gmail.com Acked-by: Namhyung Kim <namhyung@kernel.org> Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: George Guo <guodongtai@kylinos.cn> --- kernel/trace/trace_events_hist.c | 68 ++++++-------------------------- 1 file changed, 11 insertions(+), 57 deletions(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index e4f5b6894cf2..ede370225245 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -1289,49 +1289,13 @@ check_field_for_var_ref(struct hist_field *hist_field, struct hist_trigger_data *var_data, unsigned int var_idx) { - struct hist_field *found = NULL; - - if (hist_field && hist_field->flags & HIST_FIELD_FL_VAR_REF) { - if (hist_field->var.idx == var_idx && - hist_field->var.hist_data == var_data) { - found = hist_field; - } - } - - return found; -} - -static struct hist_field * -check_field_for_var_refs(struct hist_trigger_data *hist_data, - struct hist_field *hist_field, - struct hist_trigger_data *var_data, - unsigned int var_idx, - unsigned int level) -{ - struct hist_field *found = NULL; - unsigned int i; - - if (level > 3) - return found; - - if (!hist_field) - return found; - - found = check_field_for_var_ref(hist_field, var_data, var_idx); - if (found) - return found; - - for (i = 0; i < HIST_FIELD_OPERANDS_MAX; i++) { - struct hist_field *operand; + WARN_ON(!(hist_field && hist_field->flags & HIST_FIELD_FL_VAR_REF)); - operand = hist_field->operands[i]; - found = check_field_for_var_refs(hist_data, operand, var_data, - var_idx, level + 1); - if (found) - return found; - } + if (hist_field && hist_field->var.idx == var_idx && + hist_field->var.hist_data == var_data) + return hist_field; - return found; + return NULL; } /** @@ -1350,26 +1314,16 @@ static struct hist_field *find_var_ref(struct hist_trigger_data *hist_data, struct hist_trigger_data *var_data, unsigned int var_idx) { - struct hist_field *hist_field, *found = NULL; + struct hist_field *hist_field; unsigned int i; - for_each_hist_field(i, hist_data) { - hist_field = hist_data->fields[i]; - found = check_field_for_var_refs(hist_data, hist_field, - var_data, var_idx, 0); - if (found) - return found; - } - - for (i = 0; i < hist_data->n_synth_var_refs; i++) { - hist_field = hist_data->synth_var_refs[i]; - found = check_field_for_var_refs(hist_data, hist_field, - var_data, var_idx, 0); - if (found) - return found; + for (i = 0; i < hist_data->n_var_refs; i++) { + hist_field = hist_data->var_refs[i]; + if (check_field_for_var_ref(hist_field, var_data, var_idx)) + return hist_field; } - return found; + return NULL; } /** -- 2.34.1 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: 2024-04-19 15:46 George Guo 2024-04-19 15:46 ` [PATCH 4.19.y v6 1/2] tracing: Remove hist trigger synth_var_refs George Guo 2024-04-19 15:46 ` [PATCH 4.19.y v6 2/2] tracing: Use var_refs[] for hist trigger reference checking George Guo @ 2024-04-23 16:48 ` Greg KH 2 siblings, 0 replies; 15+ messages in thread From: Greg KH @ 2024-04-23 16:48 UTC (permalink / raw) To: George Guo; +Cc: tom.zanussi, stable On Fri, Apr 19, 2024 at 11:46:56PM +0800, George Guo wrote: > Subject: [PATCH 4.19.y v6 0/2] Double-free bug discovery on testing trigger-field-variable-support.tc > > 1) About v4-0001-tracing-Remove-hist-trigger-synth_var_refs.patch: > > The reason I am backporting this patch is that no one found the double-free bug > at that time, then later the code was removed on upstream, but > 4.19-stable has the bug. Both now queued up, thanks greg k-h ^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH] usb: cdns3: gadget: fix request skipping after clearing halt
@ 2026-04-23 16:06 Yongchao Wu
2026-04-27 1:22 ` Peter Chen (CIX)
0 siblings, 1 reply; 15+ messages in thread
From: Yongchao Wu @ 2026-04-23 16:06 UTC (permalink / raw)
To: peter.chen, pawell; +Cc: rogerq, gregkh, linux-usb, stable, Yongchao Wu
According to the cdns3 datasheet, the EPRST (Endpoint Reset) command
causes the DMA engine to reposition its internal pointer to the next
Transfer Descriptor (TD) if it was already processing one.
This issue is consistently observed during the ADB identification
process on macOS hosts, where the host issues a Clear_Halt. Although
commit 4bf2dd65135a ("usb: cdns3: gadget: toggle cycle bit before reset
endpoint") attempted to avoid DMA advance by toggling the cycle bit,
trace logs show that on certain hosts like macOS, the DMA pointer
(EP_TRADDR) still shifts after EPRST:
cdns3_ctrl_req: Clear Endpoint Feature(Halt ep1out)
cdns3_doorbell_epx: ep1out, ep_trbaddr f9c04030 <-- Should be f9c04000
cdns3_gadget_giveback: ep1out: req: ... length: 16384/16384
As shown above, the DMA pointer jumped to index 3 (offset 0x30), causing
the controller to skip the initial TRBs of the request. This leads to
data misalignment and ADB protocol hangs on macOS.
Fix this by manually restoring the EP_TRADDR register to the starting
physical address of the current request after the EPRST operation is
complete.
Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver")
Cc: stable@vger.kernel.org
Cc: Peter Chen <peter.chen@kernel.org>
Signed-off-by: Yongchao Wu <yongchao.wu@autochips.com>
---
drivers/usb/cdns3/cdns3-gadget.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c
index d59a60a16ec77..96653c7d18f20 100644
--- a/drivers/usb/cdns3/cdns3-gadget.c
+++ b/drivers/usb/cdns3/cdns3-gadget.c
@@ -2814,9 +2814,19 @@ int __cdns3_gadget_ep_clear_halt(struct cdns3_endpoint *priv_ep)
priv_ep->flags &= ~(EP_STALLED | EP_STALL_PENDING);
if (request) {
- if (trb)
+ if (trb) {
*trb = trb_tmp;
+ /*
+ * Per datasheet, EPRST causes DMA to reposition to the next TD.
+ * Manually reset EP_TRADDR to the current TRB to prevent
+ * the hardware from skipping the interrupted request.
+ */
+ writel(EP_TRADDR_TRADDR(priv_ep->trb_pool_dma +
+ priv_req->start_trb * TRB_SIZE),
+ &priv_dev->regs->ep_traddr);
+ }
+
cdns3_rearm_transfer(priv_ep, 1);
}
base-commit: 46b513250491a7bfc97d98791dbe6a10bcc8129d
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH] usb: cdns3: gadget: fix request skipping after clearing halt 2026-04-23 16:06 [PATCH] usb: cdns3: gadget: fix request skipping after clearing halt Yongchao Wu @ 2026-04-27 1:22 ` Peter Chen (CIX) 2026-04-27 9:01 ` Pawel Laszczak 0 siblings, 1 reply; 15+ messages in thread From: Peter Chen (CIX) @ 2026-04-27 1:22 UTC (permalink / raw) To: Yongchao Wu, pawell; +Cc: rogerq, gregkh, linux-usb, stable On 26-04-24 00:06:01, Yongchao Wu wrote: > According to the cdns3 datasheet, the EPRST (Endpoint Reset) command > causes the DMA engine to reposition its internal pointer to the next > Transfer Descriptor (TD) if it was already processing one. > > This issue is consistently observed during the ADB identification > process on macOS hosts, where the host issues a Clear_Halt. Although > commit 4bf2dd65135a ("usb: cdns3: gadget: toggle cycle bit before reset > endpoint") attempted to avoid DMA advance by toggling the cycle bit, > trace logs show that on certain hosts like macOS, the DMA pointer > (EP_TRADDR) still shifts after EPRST: > > cdns3_ctrl_req: Clear Endpoint Feature(Halt ep1out) > cdns3_doorbell_epx: ep1out, ep_trbaddr f9c04030 <-- Should be f9c04000 > cdns3_gadget_giveback: ep1out: req: ... length: 16384/16384 > > As shown above, the DMA pointer jumped to index 3 (offset 0x30), causing > the controller to skip the initial TRBs of the request. This leads to > data misalignment and ADB protocol hangs on macOS. Pawel, Is it a hardware issue? The cycle bit has already been toggled before the endpoint has been reset, why the DMA pointer still advances? Peter > > Fix this by manually restoring the EP_TRADDR register to the starting > physical address of the current request after the EPRST operation is > complete. > > Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver") > Cc: stable@vger.kernel.org > Cc: Peter Chen <peter.chen@kernel.org> > Signed-off-by: Yongchao Wu <yongchao.wu@autochips.com> > --- > drivers/usb/cdns3/cdns3-gadget.c | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c > index d59a60a16ec77..96653c7d18f20 100644 > --- a/drivers/usb/cdns3/cdns3-gadget.c > +++ b/drivers/usb/cdns3/cdns3-gadget.c > @@ -2814,9 +2814,19 @@ int __cdns3_gadget_ep_clear_halt(struct cdns3_endpoint *priv_ep) > priv_ep->flags &= ~(EP_STALLED | EP_STALL_PENDING); > > if (request) { > - if (trb) > + if (trb) { > *trb = trb_tmp; > > + /* > + * Per datasheet, EPRST causes DMA to reposition to the next TD. > + * Manually reset EP_TRADDR to the current TRB to prevent > + * the hardware from skipping the interrupted request. > + */ > + writel(EP_TRADDR_TRADDR(priv_ep->trb_pool_dma + > + priv_req->start_trb * TRB_SIZE), > + &priv_dev->regs->ep_traddr); > + } > + > cdns3_rearm_transfer(priv_ep, 1); > } > > > base-commit: 46b513250491a7bfc97d98791dbe6a10bcc8129d > -- > 2.43.0 > > -- Best regards, Peter ^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: [PATCH] usb: cdns3: gadget: fix request skipping after clearing halt 2026-04-27 1:22 ` Peter Chen (CIX) @ 2026-04-27 9:01 ` Pawel Laszczak 2026-04-27 22:59 ` Peter Chen (CIX) 0 siblings, 1 reply; 15+ messages in thread From: Pawel Laszczak @ 2026-04-27 9:01 UTC (permalink / raw) To: Peter Chen (CIX), Yongchao Wu Cc: rogerq@kernel.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, stable@vger.kernel.org > > >On 26-04-24 00:06:01, Yongchao Wu wrote: >> According to the cdns3 datasheet, the EPRST (Endpoint Reset) command >> causes the DMA engine to reposition its internal pointer to the next >> Transfer Descriptor (TD) if it was already processing one. >> >> This issue is consistently observed during the ADB identification >> process on macOS hosts, where the host issues a Clear_Halt. Although >> commit 4bf2dd65135a ("usb: cdns3: gadget: toggle cycle bit before >> reset >> endpoint") attempted to avoid DMA advance by toggling the cycle bit, >> trace logs show that on certain hosts like macOS, the DMA pointer >> (EP_TRADDR) still shifts after EPRST: >> >> cdns3_ctrl_req: Clear Endpoint Feature(Halt ep1out) >> cdns3_doorbell_epx: ep1out, ep_trbaddr f9c04030 <-- Should be f9c04000 >> cdns3_gadget_giveback: ep1out: req: ... length: 16384/16384 >> >> As shown above, the DMA pointer jumped to index 3 (offset 0x30), >> causing the controller to skip the initial TRBs of the request. This >> leads to data misalignment and ADB protocol hangs on macOS. > >Pawel, Is it a hardware issue? The cycle bit has already been toggled before the >endpoint has been reset, why the DMA pointer still advances? Peter, do you remember what the TD looked like in your case? Maybe that’s where the difference lies. The patch description states that it jumps from 0xf9c04000 to 0xf9c04030, which would suggest that the TD consists of three TRBs. The driver only changes the cycle bit on the first one. I’m not entirely sure how the controller assembles this TD. I need some time to try explain the controller's behavior in this case. Yongchao, could you confirm if the TD consists of three TRBs? Pawel > >Peter > >> >> Fix this by manually restoring the EP_TRADDR register to the starting >> physical address of the current request after the EPRST operation is >> complete. >> >> Fixes: 7733f6c32e36 ("usb: cdns3: Add Cadence USB3 DRD Driver") >> Cc: stable@vger.kernel.org >> Cc: Peter Chen <peter.chen@kernel.org> >> Signed-off-by: Yongchao Wu <yongchao.wu@autochips.com> >> --- >> drivers/usb/cdns3/cdns3-gadget.c | 12 +++++++++++- >> 1 file changed, 11 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/usb/cdns3/cdns3-gadget.c >> b/drivers/usb/cdns3/cdns3-gadget.c >> index d59a60a16ec77..96653c7d18f20 100644 >> --- a/drivers/usb/cdns3/cdns3-gadget.c >> +++ b/drivers/usb/cdns3/cdns3-gadget.c >> @@ -2814,9 +2814,19 @@ int __cdns3_gadget_ep_clear_halt(struct >cdns3_endpoint *priv_ep) >> priv_ep->flags &= ~(EP_STALLED | EP_STALL_PENDING); >> >> if (request) { >> - if (trb) >> + if (trb) { >> *trb = trb_tmp; >> >> + /* >> + * Per datasheet, EPRST causes DMA to reposition to the >next TD. >> + * Manually reset EP_TRADDR to the current TRB to >prevent >> + * the hardware from skipping the interrupted request. >> + */ >> + writel(EP_TRADDR_TRADDR(priv_ep->trb_pool_dma + >> + priv_req->start_trb * >TRB_SIZE), >> + &priv_dev->regs->ep_traddr); >> + } >> + >> cdns3_rearm_transfer(priv_ep, 1); >> } >> >> >> base-commit: 46b513250491a7bfc97d98791dbe6a10bcc8129d >> -- >> 2.43.0 >> >> > >-- > >Best regards, >Peter ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] usb: cdns3: gadget: fix request skipping after clearing halt 2026-04-27 9:01 ` Pawel Laszczak @ 2026-04-27 22:59 ` Peter Chen (CIX) 2026-04-27 23:59 ` Yongchao Wu 0 siblings, 1 reply; 15+ messages in thread From: Peter Chen (CIX) @ 2026-04-27 22:59 UTC (permalink / raw) To: Pawel Laszczak Cc: Yongchao Wu, rogerq@kernel.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, stable@vger.kernel.org On 26-04-27 09:01:47, Pawel Laszczak wrote: > > > > > >On 26-04-24 00:06:01, Yongchao Wu wrote: > >> According to the cdns3 datasheet, the EPRST (Endpoint Reset) command > >> causes the DMA engine to reposition its internal pointer to the next > >> Transfer Descriptor (TD) if it was already processing one. > >> > >> This issue is consistently observed during the ADB identification > >> process on macOS hosts, where the host issues a Clear_Halt. Although > >> commit 4bf2dd65135a ("usb: cdns3: gadget: toggle cycle bit before > >> reset > >> endpoint") attempted to avoid DMA advance by toggling the cycle bit, > >> trace logs show that on certain hosts like macOS, the DMA pointer > >> (EP_TRADDR) still shifts after EPRST: > >> > >> cdns3_ctrl_req: Clear Endpoint Feature(Halt ep1out) > >> cdns3_doorbell_epx: ep1out, ep_trbaddr f9c04030 <-- Should be f9c04000 > >> cdns3_gadget_giveback: ep1out: req: ... length: 16384/16384 > >> > >> As shown above, the DMA pointer jumped to index 3 (offset 0x30), > >> causing the controller to skip the initial TRBs of the request. This > >> leads to data misalignment and ADB protocol hangs on macOS. > > > >Pawel, Is it a hardware issue? The cycle bit has already been toggled before the > >endpoint has been reset, why the DMA pointer still advances? > > Peter, do you remember what the TD looked like in your case? Sorry, it was almost 6 years ago, I could not remember it well. > Maybe that’s where the difference lies. The patch description states that > it jumps from 0xf9c04000 to 0xf9c04030, which would suggest that the TD > consists of three TRBs. The driver only changes the cycle bit on the > first one. According to Yongchao's statement: According to the cdns3 datasheet, the EPRST (Endpoint Reset) command causes the DMA engine to reposition its internal pointer to the next Transfer Descriptor (TD) if it was already processing one. My points are the cycle bit has toggled by SW before EPRST command, and EPRST command would reset DMA pointer to the 1st TRB within TD, and it is executed later than cycle bit toggles, why hardware could go on handling TRBs even the first TRB's cycle bit is for software? Peter > I’m not entirely sure how the controller assembles this TD. > I need some time to try explain the controller's behavior in this case. > > Yongchao, could you confirm if the TD consists of three TRBs? > > Pawel -- Best regards, Peter ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] usb: cdns3: gadget: fix request skipping after clearing halt 2026-04-27 22:59 ` Peter Chen (CIX) @ 2026-04-27 23:59 ` Yongchao Wu 2026-04-28 9:58 ` Pawel Laszczak 0 siblings, 1 reply; 15+ messages in thread From: Yongchao Wu @ 2026-04-27 23:59 UTC (permalink / raw) To: Peter Chen (CIX), Pawel Laszczak Cc: rogerq@kernel.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, stable@vger.kernel.org On 26-04-27 09:01:47, Pawel Laszczak wrote: >> >> >> On 26-04-24 00:06:01, Yongchao Wu wrote: >>> According to the cdns3 datasheet, the EPRST (Endpoint Reset) command >>> causes the DMA engine to reposition its internal pointer to the next >>> Transfer Descriptor (TD) if it was already processing one. >>> >>> This issue is consistently observed during the ADB identification >>> process on macOS hosts, where the host issues a Clear_Halt. Although >>> commit 4bf2dd65135a ("usb: cdns3: gadget: toggle cycle bit before >>> reset >>> endpoint") attempted to avoid DMA advance by toggling the cycle bit, >>> trace logs show that on certain hosts like macOS, the DMA pointer >>> (EP_TRADDR) still shifts after EPRST: >>> >>> cdns3_ctrl_req: Clear Endpoint Feature(Halt ep1out) >>> cdns3_doorbell_epx: ep1out, ep_trbaddr f9c04030 <- Should be f9c04000 >>> cdns3_gadget_giveback: ep1out: req: ... length: 16384/16384 >>> >>> As shown above, the DMA pointer jumped to index 3 (offset 0x30), >>> causing the controller to skip the initial TRBs of the request. This >>> leads to data misalignment and ADB protocol hangs on macOS. >> >> Pawel, Is it a hardware issue? The cycle bit has already been toggled before the >> endpoint has been reset, why the DMA pointer still advances? > > Yongchao, could you confirm if the TD consists of three TRBs? In our case, each TD consists of 4 TRBs. The DMA pointer appears to advance within the same TD after EPRST. Each 16KB request is split into 4 TRBs (4KB each): - TRB0 - TRB2: CHAIN - TRB3: IOC (last TRB of the TD) After enqueue, the initial EP_TRADDR points to the first TRB: EP_TRADDR = 0xf9c04000 (TRB0) After Clear_Halt (EPRST), it becomes: EP_TRADDR = 0xf9c04030 (TRB3) Since each TRB is 12 bytes, the offset 0x30 corresponds to 4 TRBs. This indicates that after EPRST, the DMA pointer skipped the entire current Request and jumped directly to the start of the next Request at 0xf9c04030 Below is the relevant trace (trimmed): // enqueue request (16KB -> 4 TRBs) cdns3_prepare_trb: dma buf: 0xf7abc000, size: 4096, ctrl: 0x00200415 cdns3_prepare_trb: dma buf: 0xf7abd000, size: 4096, ctrl: 0x00000415 cdns3_prepare_trb: dma buf: 0xf7abe000, size: 4096, ctrl: 0x00000415 cdns3_prepare_trb: dma buf: 0xf7abf000, size: 4096, ctrl: 0x00000425 cdns3_doorbell_epx: ep1out, ep_trbaddr f9c04000 // Clear_Halt cdns3_ctrl_req: Clear Endpoint Feature(Halt ep1out) cdns3_doorbell_epx: ep1out, ep_trbaddr f9c04030 This behavior is consistently observed on macOS hosts during ADB enumeration. So even though the cycle bit is toggled on the first TRB, the controller still appears to advance the DMA pointer within the same TD after EPRST. Please let me know if you need more detailed logs or a full TRB ring dump. I'd also appreciate any insight into how the controller determines the next position after EPRST in this case. Best regards, Yongchao ^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: [PATCH] usb: cdns3: gadget: fix request skipping after clearing halt 2026-04-27 23:59 ` Yongchao Wu @ 2026-04-28 9:58 ` Pawel Laszczak 2026-04-28 14:48 ` Yongchao Wu 0 siblings, 1 reply; 15+ messages in thread From: Pawel Laszczak @ 2026-04-28 9:58 UTC (permalink / raw) To: Yongchao Wu, Peter Chen (CIX) Cc: rogerq@kernel.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, stable@vger.kernel.org > >On 26-04-27 09:01:47, Pawel Laszczak wrote: > >> > >> > >> On 26-04-24 00:06:01, Yongchao Wu wrote: > >>> According to the cdns3 datasheet, the EPRST (Endpoint Reset) command >>>> causes the DMA engine to reposition its internal pointer to the next >>> >Transfer Descriptor (TD) if it was already processing one. > >>> > >>> This issue is consistently observed during the ADB identification >>> >process on macOS hosts, where the host issues a Clear_Halt. Although >>> >commit 4bf2dd65135a ("usb: cdns3: gadget: toggle cycle bit before >>> reset >>>> endpoint") attempted to avoid DMA advance by toggling the cycle bit, >>>> trace logs show that on certain hosts like macOS, the DMA pointer >>> >(EP_TRADDR) still shifts after EPRST: > >>> > >>> cdns3_ctrl_req: Clear Endpoint Feature(Halt ep1out) > >>> cdns3_doorbell_epx: ep1out, ep_trbaddr f9c04030 <- Should be >f9c04000 > >>> cdns3_gadget_giveback: ep1out: req: ... length: 16384/16384 > >>> > >>> As shown above, the DMA pointer jumped to index 3 (offset 0x30), >>> >causing the controller to skip the initial TRBs of the request. This >>> leads to >data misalignment and ADB protocol hangs on macOS. > >> > >> Pawel, Is it a hardware issue? The cycle bit has already been toggled before >the >> endpoint has been reset, why the DMA pointer still advances? > > > > Yongchao, could you confirm if the TD consists of three TRBs? >In our case, each TD consists of 4 TRBs. >The DMA pointer appears to advance within the same TD after EPRST. > >Each 16KB request is split into 4 TRBs (4KB each): >- TRB0 - TRB2: CHAIN >- TRB3: IOC (last TRB of the TD) > >After enqueue, the initial EP_TRADDR points to the first TRB: > EP_TRADDR = 0xf9c04000 (TRB0) > >After Clear_Halt (EPRST), it becomes: > EP_TRADDR = 0xf9c04030 (TRB3) > >Since each TRB is 12 bytes, the offset 0x30 corresponds to 4 TRBs. >This indicates that after EPRST, the DMA pointer skipped the entire current >Request and jumped directly to the start of the next Request at 0xf9c04030 > >Below is the relevant trace (trimmed): > >// enqueue request (16KB -> 4 TRBs) >cdns3_prepare_trb: dma buf: 0xf7abc000, size: 4096, ctrl: 0x00200415 >cdns3_prepare_trb: dma buf: 0xf7abd000, size: 4096, ctrl: 0x00000415 >cdns3_prepare_trb: dma buf: 0xf7abe000, size: 4096, ctrl: 0x00000415 >cdns3_prepare_trb: dma buf: 0xf7abf000, size: 4096, ctrl: 0x00000425 > >cdns3_doorbell_epx: ep1out, ep_trbaddr f9c04000 > >// Clear_Halt >cdns3_ctrl_req: Clear Endpoint Feature(Halt ep1out) >cdns3_doorbell_epx: ep1out, ep_trbaddr f9c04030 > >This behavior is consistently observed on macOS hosts during ADB >enumeration. > >So even though the cycle bit is toggled on the first TRB, the controller still >appears to advance the DMA pointer within the same TD after EPRST. > >Please let me know if you need more detailed logs or a full TRB ring dump. I'd >also appreciate any insight into how the controller determines the next >position after EPRST in this case. > Can you confirm whether the host had already sent some data for this TD prior to the endpoint reset operation? Pawel >Best regards, >Yongchao ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH] usb: cdns3: gadget: fix request skipping after clearing halt 2026-04-28 9:58 ` Pawel Laszczak @ 2026-04-28 14:48 ` Yongchao Wu 2026-05-04 9:15 ` Pawel Laszczak 0 siblings, 1 reply; 15+ messages in thread From: Yongchao Wu @ 2026-04-28 14:48 UTC (permalink / raw) To: Pawel Laszczak, Peter Chen (CIX) Cc: rogerq@kernel.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, stable@vger.kernel.org On 4/28/2026 5:58 PM, Pawel Laszczak wrote: > >> >> On 26-04-27 09:01:47, Pawel Laszczak wrote: >>>> >>>> >>>> On 26-04-24 00:06:01, Yongchao Wu wrote: >>>>> According to the cdns3 datasheet, the EPRST (Endpoint Reset) command >>>>> causes the DMA engine to reposition its internal pointer to the next >>>>> Transfer Descriptor (TD) if it was already processing one. >>>>> >>>>> This issue is consistently observed during the ADB identification >>>>> process on macOS hosts, where the host issues a Clear_Halt. Although >>>>> commit 4bf2dd65135a ("usb: cdns3: gadget: toggle cycle bit before reset >>>>> reset endpoint") attempted to avoid DMA advance by toggling the cycle bit, >>>>> trace logs show that on certain hosts like macOS, the DMA pointer >>>>> (EP_TRADDR) still shifts after EPRST: >>>>> >>>>> cdns3_ctrl_req: Clear Endpoint Feature(Halt ep1out) >>>>> cdns3_doorbell_epx: ep1out, ep_trbaddr f9c04030 <- Should be f9c04000 >>>>> cdns3_gadget_giveback: ep1out: req: ... length: 16384/16384 >>>>> >>>>> As shown above, the DMA pointer jumped to index 3 (offset 0x30), >>>>> causing the controller to skip the initial TRBs of the request. This >>>>> leads to data misalignment and ADB protocol hangs on macOS. >>>> >>>> Pawel, Is it a hardware issue? The cycle bit has already been toggled before the >>>> endpoint has been reset, why the DMA pointer still advances? >>> >>> Yongchao, could you confirm if the TD consists of three TRBs? >> In our case, each TD consists of 4 TRBs. >> The DMA pointer appears to advance within the same TD after EPRST. >> >> Each 16KB request is split into 4 TRBs (4KB each): >> - TRB0 - TRB2: CHAIN >> - TRB3: IOC (last TRB of the TD) >> >> After enqueue, the initial EP_TRADDR points to the first TRB: >> EP_TRADDR = 0xf9c04000 (TRB0) >> >> After Clear_Halt (EPRST), it becomes: >> EP_TRADDR = 0xf9c04030 (TRB3) >> >> Since each TRB is 12 bytes, the offset 0x30 corresponds to 4 TRBs. >> This indicates that after EPRST, the DMA pointer skipped the entire current >> Request and jumped directly to the start of the next Request at 0xf9c04030 >> >> Below is the relevant trace (trimmed): >> >> // enqueue request (16KB -> 4 TRBs) >> cdns3_prepare_trb: dma buf: 0xf7abc000, size: 4096, ctrl: 0x00200415 >> cdns3_prepare_trb: dma buf: 0xf7abd000, size: 4096, ctrl: 0x00000415 >> cdns3_prepare_trb: dma buf: 0xf7abe000, size: 4096, ctrl: 0x00000415 >> cdns3_prepare_trb: dma buf: 0xf7abf000, size: 4096, ctrl: 0x00000425 >> >> cdns3_doorbell_epx: ep1out, ep_trbaddr f9c04000 >> >> // Clear_Halt >> cdns3_ctrl_req: Clear Endpoint Feature(Halt ep1out) >> cdns3_doorbell_epx: ep1out, ep_trbaddr f9c04030 >> > > Can you confirm whether the host had already sent some data for this TD > prior to the endpoint reset operation? > I confirm that the host sent no data prior to or during the EPRST operation. TotalPhase Trace: 0,HS,2700,0:06.078.671,2.057.666 ms,0 B,,13,00,Set Configuration,Configuration=1 0,HS,2710,0:06.080.811,1.125.266 ms,,,,,[10 SOF],[Frames: 1243.7 - 1245.0] 0,HS,2711,0:06.080.955,992.550 us,2 B,,13,00,Get String Descriptor,Index=5 Length=2 0,HS,2733,0:06.082.061,125.083 us,,,,,[2 SOF],[Frames: 1245.1 - 1245.2] 0,HS,2734,0:06.082.119,104.566 us,28 B,,13,00,Get String Descriptor,Index=5 Length=28 0,HS,2756,0:06.082.311,355.935.283 ms,,,,,[2848 SOF],[Frames: 1245.3 - 1601.2] 0,HS,2757,0:06.438.196,105.033 us,4 B,,13,00,Get String Descriptor,Index=0 Length=256 0,HS,2778,0:06.438.371,875.233 us,,,,,[8 SOF],[Frames: 1601.3 - 1602.2] //1. Host issues Clear_Halt 0,HS,2779,0:06.439.278,51.433 us,0 B,,13,00,Clear Endpoint Feature,Halt Endpoint 01 OUT 0,HS,2789,0:06.439.371,500.150 us,,,,,[5 SOF],[Frames: 1602.3 - 1602.7] 0,HS,2790,0:06.439.874,51.416 us,0 B,,13,00,Clear Endpoint Feature,Halt Endpoint 01 IN 0,HS,2800,0:06.439.996,250.116 us,,,,,[3 SOF],[Frames: 1603.0 - 1603.2] //2. First OUT transaction happens 0,HS,2801,0:06.440.350,1.066 us,24 B,,13,01,OUT txn,43 4E 58 4E 01 00 00 01 00 00 10 00.. 0,HS,2805,0:06.440.371,66 ns,,,,,[1 SOF],[Frame: 1603.3] 0,HS,2806,0:06.440.453,4.283 us,218 B,,13,01,OUT txn,68 6F 73 74 3A 3A 66 65 61 74 75 72.. > Pawel > >> Best regards, >> Yongchao >> Best regards, >> Yongchao ^ permalink raw reply [flat|nested] 15+ messages in thread
* RE: 2026-04-28 14:48 ` Yongchao Wu @ 2026-05-04 9:15 ` Pawel Laszczak 0 siblings, 0 replies; 15+ messages in thread From: Pawel Laszczak @ 2026-05-04 9:15 UTC (permalink / raw) To: Yongchao Wu, Peter Chen (CIX) Cc: rogerq@kernel.org, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, stable@vger.kernel.org >> >>> >>> On 26-04-27 09:01:47, Pawel Laszczak wrote: >>>>> >>>>> >>>>> On 26-04-24 00:06:01, Yongchao Wu wrote: >>>>>> According to the cdns3 datasheet, the EPRST (Endpoint Reset) >>>>>> command causes the DMA engine to reposition its internal pointer >>>>>> to the next Transfer Descriptor (TD) if it was already processing one. >>>>>> >>>>>> This issue is consistently observed during the ADB identification >>>>>> process on macOS hosts, where the host issues a Clear_Halt. Although >>>>>> commit 4bf2dd65135a ("usb: cdns3: gadget: toggle cycle bit before >reset >>>>>> reset endpoint") attempted to avoid DMA advance by toggling the >>>>>> cycle bit, trace logs show that on certain hosts like macOS, the >>>>>> DMA pointer >>>>>> (EP_TRADDR) still shifts after EPRST: >>>>>> >>>>>> cdns3_ctrl_req: Clear Endpoint Feature(Halt ep1out) >>>>>> cdns3_doorbell_epx: ep1out, ep_trbaddr f9c04030 <- Should be >f9c04000 >>>>>> cdns3_gadget_giveback: ep1out: req: ... length: 16384/16384 >>>>>> >>>>>> As shown above, the DMA pointer jumped to index 3 (offset 0x30), >>>>>> causing the controller to skip the initial TRBs of the request. >>>>>> This leads to data misalignment and ADB protocol hangs on macOS. >>>>> >>>>> Pawel, Is it a hardware issue? The cycle bit has already been >>>>> toggled before the endpoint has been reset, why the DMA pointer still >advances? >>>> >>>> Yongchao, could you confirm if the TD consists of three TRBs? >>> In our case, each TD consists of 4 TRBs. >>> The DMA pointer appears to advance within the same TD after EPRST. >>> >>> Each 16KB request is split into 4 TRBs (4KB each): >>> - TRB0 - TRB2: CHAIN >>> - TRB3: IOC (last TRB of the TD) >>> >>> After enqueue, the initial EP_TRADDR points to the first TRB: >>> EP_TRADDR = 0xf9c04000 (TRB0) >>> >>> After Clear_Halt (EPRST), it becomes: >>> EP_TRADDR = 0xf9c04030 (TRB3) >>> >>> Since each TRB is 12 bytes, the offset 0x30 corresponds to 4 TRBs. >>> This indicates that after EPRST, the DMA pointer skipped the entire >>> current Request and jumped directly to the start of the next Request >>> at 0xf9c04030 >>> >>> Below is the relevant trace (trimmed): >>> >>> // enqueue request (16KB -> 4 TRBs) >>> cdns3_prepare_trb: dma buf: 0xf7abc000, size: 4096, ctrl: 0x00200415 >>> cdns3_prepare_trb: dma buf: 0xf7abd000, size: 4096, ctrl: 0x00000415 >>> cdns3_prepare_trb: dma buf: 0xf7abe000, size: 4096, ctrl: 0x00000415 >>> cdns3_prepare_trb: dma buf: 0xf7abf000, size: 4096, ctrl: 0x00000425 >>> >>> cdns3_doorbell_epx: ep1out, ep_trbaddr f9c04000 >>> >>> // Clear_Halt >>> cdns3_ctrl_req: Clear Endpoint Feature(Halt ep1out) >>> cdns3_doorbell_epx: ep1out, ep_trbaddr f9c04030 >>> >> >> Can you confirm whether the host had already sent some data for this >> TD prior to the endpoint reset operation? >> > >I confirm that the host sent no data prior to or during the EPRST operation. According to the specification, the controller may fetch TRB descriptors after the endpoint has been initialized. In complex Transfer Descriptors (TDs) consisting of several TRBs with the CH=1 bit set, the controller may fetch additional TRBs because it treats them as a single logical entity. I have not been able to determine exactly how many TRBs can be prefetched in such a situation. According to the description of the EPRST bit: After endpoint reset the software is responsible for it to re-set the Endpoint TRADDR. This fix looks correct to me, Can you confirm which version of controller do you have in usb_cap6 register? Pawel > >TotalPhase Trace: >0,HS,2700,0:06.078.671,2.057.666 ms,0 B,,13,00,Set >Configuration,Configuration=1 >0,HS,2710,0:06.080.811,1.125.266 ms,,,,,[10 SOF],[Frames: 1243.7 - 1245.0] >0,HS,2711,0:06.080.955,992.550 us,2 B,,13,00,Get String Descriptor,Index=5 >Length=2 >0,HS,2733,0:06.082.061,125.083 us,,,,,[2 SOF],[Frames: 1245.1 - 1245.2] >0,HS,2734,0:06.082.119,104.566 us,28 B,,13,00,Get String Descriptor,Index=5 >Length=28 >0,HS,2756,0:06.082.311,355.935.283 ms,,,,,[2848 SOF],[Frames: 1245.3 - >1601.2] >0,HS,2757,0:06.438.196,105.033 us,4 B,,13,00,Get String Descriptor,Index=0 >Length=256 >0,HS,2778,0:06.438.371,875.233 us,,,,,[8 SOF],[Frames: 1601.3 - 1602.2] //1. >Host issues Clear_Halt >0,HS,2779,0:06.439.278,51.433 us,0 B,,13,00,Clear Endpoint Feature,Halt >Endpoint 01 OUT >0,HS,2789,0:06.439.371,500.150 us,,,,,[5 SOF],[Frames: 1602.3 - 1602.7] >0,HS,2790,0:06.439.874,51.416 us,0 B,,13,00,Clear Endpoint Feature,Halt >Endpoint 01 IN >0,HS,2800,0:06.439.996,250.116 us,,,,,[3 SOF],[Frames: 1603.0 - 1603.2] //2. >First OUT transaction happens >0,HS,2801,0:06.440.350,1.066 us,24 B,,13,01,OUT txn,43 4E 58 4E 01 00 00 01 >00 00 10 00.. >0,HS,2805,0:06.440.371,66 ns,,,,,[1 SOF],[Frame: 1603.3] >0,HS,2806,0:06.440.453,4.283 us,218 B,,13,01,OUT txn,68 6F 73 74 3A 3A 66 65 >61 74 75 72.. > >> Pawel >> >>> Best regards, >>> Yongchao >>> Best regards, >>> Yongchao ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH 6.15 000/480] 6.15.10-rc1 review
@ 2025-08-13 15:48 Jon Hunter
2025-08-13 17:25 ` Jon Hunter
0 siblings, 1 reply; 15+ messages in thread
From: Jon Hunter @ 2025-08-13 15:48 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Greg Kroah-Hartman, patches, linux-kernel, torvalds, akpm, linux,
shuah, patches, lkft-triage, pavel, jonathanh, f.fainelli,
sudipm.mukherjee, srw, rwarsow, conor, hargar, broonie, achill,
linux-tegra, stable
On Tue, 12 Aug 2025 19:43:28 +0200, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 6.15.10 release.
> There are 480 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 Thu, 14 Aug 2025 17:42:20 +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/v6.x/stable-review/patch-6.15.10-rc1.gz
> or in the git tree and branch at:
> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.15.y
> and the diffstat can be found below.
>
> thanks,
>
> greg k-h
Failures detected for Tegra ...
Test results for stable-v6.15:
10 builds: 10 pass, 0 fail
28 boots: 28 pass, 0 fail
120 tests: 119 pass, 1 fail
Linux version: 6.15.10-rc1-g2510f67e2e34
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra186-p3509-0000+p3636-0001, tegra194-p2972-0000,
tegra194-p3509-0000+p3668-0000, tegra20-ventana,
tegra210-p2371-2180, tegra210-p3450-0000,
tegra30-cardhu-a04
Test failures: tegra194-p2972-0000: boot.py
Jon
^ permalink raw reply [flat|nested] 15+ messages in thread* (no subject) 2025-08-13 15:48 [PATCH 6.15 000/480] 6.15.10-rc1 review Jon Hunter @ 2025-08-13 17:25 ` Jon Hunter 2025-08-14 15:36 ` Greg KH 0 siblings, 1 reply; 15+ messages in thread From: Jon Hunter @ 2025-08-13 17:25 UTC (permalink / raw) To: jonathanh Cc: achill, akpm, broonie, conor, f.fainelli, gregkh, hargar, linux-kernel, linux-tegra, linux, lkft-triage, patches, patches, pavel, rwarsow, shuah, srw, stable, sudipm.mukherjee, torvalds [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain; charset="y", Size: 1971 bytes --] From: Jon Hunter <jonathanh@nvidia.com> Date: Wed, 13 Aug 2025 18:18:01 +0100 Subject: Re: [PATCH 6.15 000/480] 6.15.10-rc1 review X-NVConfidentiality: public On Wed, Aug 13, 2025 at 08:48:28AM -0700, Jon Hunter wrote: > On Tue, 12 Aug 2025 19:43:28 +0200, Greg Kroah-Hartman wrote: > > This is the start of the stable review cycle for the 6.15.10 release. > > There are 480 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 Thu, 14 Aug 2025 17:42:20 +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/v6.x/stable-review/patch-6.15.10-rc1.gz > > or in the git tree and branch at: > > git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.15.y > > and the diffstat can be found below. > > > > thanks, > > > > greg k-h > > Failures detected for Tegra ... > > Test results for stable-v6.15: > 10 builds: 10 pass, 0 fail > 28 boots: 28 pass, 0 fail > 120 tests: 119 pass, 1 fail > > Linux version: 6.15.10-rc1-g2510f67e2e34 > Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000, > tegra186-p3509-0000+p3636-0001, tegra194-p2972-0000, > tegra194-p3509-0000+p3668-0000, tegra20-ventana, > tegra210-p2371-2180, tegra210-p3450-0000, > tegra30-cardhu-a04 > > Test failures: tegra194-p2972-0000: boot.py I am seeing the following kernel warning for both linux-6.15.y and linux-6.16.y … WARNING KERN sched: DL replenish lagged too much I believe that this is introduced by … Peter Zijlstra <peterz@infradead.org> sched/deadline: Less agressive dl_server handling This has been reported here: https://lore.kernel.org/all/CAMuHMdXn4z1pioTtBGMfQM0jsLviqS2jwysaWXpoLxWYoGa82w@mail.gmail.com/ Jon ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: 2025-08-13 17:25 ` Jon Hunter @ 2025-08-14 15:36 ` Greg KH 2025-08-15 16:20 ` Re: Jon Hunter 0 siblings, 1 reply; 15+ messages in thread From: Greg KH @ 2025-08-14 15:36 UTC (permalink / raw) To: Jon Hunter Cc: achill, akpm, broonie, conor, f.fainelli, hargar, linux-kernel, linux-tegra, linux, lkft-triage, patches, patches, pavel, rwarsow, shuah, srw, stable, sudipm.mukherjee, torvalds On Wed, Aug 13, 2025 at 06:25:32PM +0100, Jon Hunter wrote: > On Wed, Aug 13, 2025 at 08:48:28AM -0700, Jon Hunter wrote: > > On Tue, 12 Aug 2025 19:43:28 +0200, Greg Kroah-Hartman wrote: > > > This is the start of the stable review cycle for the 6.15.10 release. > > > There are 480 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 Thu, 14 Aug 2025 17:42:20 +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/v6.x/stable-review/patch-6.15.10-rc1.gz > > > or in the git tree and branch at: > > > git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.15.y > > > and the diffstat can be found below. > > > > > > thanks, > > > > > > greg k-h > > > > Failures detected for Tegra ... > > > > Test results for stable-v6.15: > > 10 builds: 10 pass, 0 fail > > 28 boots: 28 pass, 0 fail > > 120 tests: 119 pass, 1 fail > > > > Linux version: 6.15.10-rc1-g2510f67e2e34 > > Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000, > > tegra186-p3509-0000+p3636-0001, tegra194-p2972-0000, > > tegra194-p3509-0000+p3668-0000, tegra20-ventana, > > tegra210-p2371-2180, tegra210-p3450-0000, > > tegra30-cardhu-a04 > > > > Test failures: tegra194-p2972-0000: boot.py > > I am seeing the following kernel warning for both linux-6.15.y and linux-6.16.y … > > WARNING KERN sched: DL replenish lagged too much > > I believe that this is introduced by … > > Peter Zijlstra <peterz@infradead.org> > sched/deadline: Less agressive dl_server handling > > This has been reported here: https://lore.kernel.org/all/CAMuHMdXn4z1pioTtBGMfQM0jsLviqS2jwysaWXpoLxWYoGa82w@mail.gmail.com/ I've now dropped this. Is that causing the test failure for you? thanks, greg k-h ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: 2025-08-14 15:36 ` Greg KH @ 2025-08-15 16:20 ` Jon Hunter 2025-08-15 16:53 ` Re: Greg KH 0 siblings, 1 reply; 15+ messages in thread From: Jon Hunter @ 2025-08-15 16:20 UTC (permalink / raw) To: Greg KH Cc: achill, akpm, broonie, conor, f.fainelli, hargar, linux-kernel, linux-tegra, linux, lkft-triage, patches, patches, pavel, rwarsow, shuah, srw, stable, sudipm.mukherjee, torvalds On 14/08/2025 16:36, Greg KH wrote: > On Wed, Aug 13, 2025 at 06:25:32PM +0100, Jon Hunter wrote: >> On Wed, Aug 13, 2025 at 08:48:28AM -0700, Jon Hunter wrote: >>> On Tue, 12 Aug 2025 19:43:28 +0200, Greg Kroah-Hartman wrote: >>>> This is the start of the stable review cycle for the 6.15.10 release. >>>> There are 480 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 Thu, 14 Aug 2025 17:42:20 +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/v6.x/stable-review/patch-6.15.10-rc1.gz >>>> or in the git tree and branch at: >>>> git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.15.y >>>> and the diffstat can be found below. >>>> >>>> thanks, >>>> >>>> greg k-h >>> >>> Failures detected for Tegra ... >>> >>> Test results for stable-v6.15: >>> 10 builds: 10 pass, 0 fail >>> 28 boots: 28 pass, 0 fail >>> 120 tests: 119 pass, 1 fail >>> >>> Linux version: 6.15.10-rc1-g2510f67e2e34 >>> Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000, >>> tegra186-p3509-0000+p3636-0001, tegra194-p2972-0000, >>> tegra194-p3509-0000+p3668-0000, tegra20-ventana, >>> tegra210-p2371-2180, tegra210-p3450-0000, >>> tegra30-cardhu-a04 >>> >>> Test failures: tegra194-p2972-0000: boot.py >> >> I am seeing the following kernel warning for both linux-6.15.y and linux-6.16.y … >> >> WARNING KERN sched: DL replenish lagged too much >> >> I believe that this is introduced by … >> >> Peter Zijlstra <peterz@infradead.org> >> sched/deadline: Less agressive dl_server handling >> >> This has been reported here: https://lore.kernel.org/all/CAMuHMdXn4z1pioTtBGMfQM0jsLviqS2jwysaWXpoLxWYoGa82w@mail.gmail.com/ > > I've now dropped this. > > Is that causing the test failure for you? Yes that is causing the test failure. Thanks! Jon -- nvpublic ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: 2025-08-15 16:20 ` Re: Jon Hunter @ 2025-08-15 16:53 ` Greg KH 0 siblings, 0 replies; 15+ messages in thread From: Greg KH @ 2025-08-15 16:53 UTC (permalink / raw) To: Jon Hunter Cc: achill, akpm, broonie, conor, f.fainelli, hargar, linux-kernel, linux-tegra, linux, lkft-triage, patches, patches, pavel, rwarsow, shuah, srw, stable, sudipm.mukherjee, torvalds On Fri, Aug 15, 2025 at 05:20:34PM +0100, Jon Hunter wrote: > On 14/08/2025 16:36, Greg KH wrote: > > On Wed, Aug 13, 2025 at 06:25:32PM +0100, Jon Hunter wrote: > > > On Wed, Aug 13, 2025 at 08:48:28AM -0700, Jon Hunter wrote: > > > > On Tue, 12 Aug 2025 19:43:28 +0200, Greg Kroah-Hartman wrote: > > > > > This is the start of the stable review cycle for the 6.15.10 release. > > > > > There are 480 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 Thu, 14 Aug 2025 17:42:20 +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/v6.x/stable-review/patch-6.15.10-rc1.gz > > > > > or in the git tree and branch at: > > > > > git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.15.y > > > > > and the diffstat can be found below. > > > > > > > > > > thanks, > > > > > > > > > > greg k-h > > > > > > > > Failures detected for Tegra ... > > > > > > > > Test results for stable-v6.15: > > > > 10 builds: 10 pass, 0 fail > > > > 28 boots: 28 pass, 0 fail > > > > 120 tests: 119 pass, 1 fail > > > > > > > > Linux version: 6.15.10-rc1-g2510f67e2e34 > > > > Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000, > > > > tegra186-p3509-0000+p3636-0001, tegra194-p2972-0000, > > > > tegra194-p3509-0000+p3668-0000, tegra20-ventana, > > > > tegra210-p2371-2180, tegra210-p3450-0000, > > > > tegra30-cardhu-a04 > > > > > > > > Test failures: tegra194-p2972-0000: boot.py > > > > > > I am seeing the following kernel warning for both linux-6.15.y and linux-6.16.y … > > > > > > WARNING KERN sched: DL replenish lagged too much > > > > > > I believe that this is introduced by … > > > > > > Peter Zijlstra <peterz@infradead.org> > > > sched/deadline: Less agressive dl_server handling > > > > > > This has been reported here: https://lore.kernel.org/all/CAMuHMdXn4z1pioTtBGMfQM0jsLviqS2jwysaWXpoLxWYoGa82w@mail.gmail.com/ > > > > I've now dropped this. > > > > Is that causing the test failure for you? > > Yes that is causing the test failure. Thanks! Is the test just noticing the warning message? Or is it a functional failure? Does it also fail on Linus's tree? thanks, greg k-h ^ permalink raw reply [flat|nested] 15+ messages in thread
* (no subject) @ 2024-11-23 1:39 the Hide 2024-11-23 7:32 ` Christoph Biedl 0 siblings, 1 reply; 15+ messages in thread From: the Hide @ 2024-11-23 1:39 UTC (permalink / raw) To: stable Who should I contact regarding the following error E: Malformed entry 5 in list file /etc/apt/sources.list.d/additional-repositories.list (Component) E: The list of sources could not be read. E: _cache->open() failed, please report. ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: 2024-11-23 1:39 the Hide @ 2024-11-23 7:32 ` Christoph Biedl 0 siblings, 0 replies; 15+ messages in thread From: Christoph Biedl @ 2024-11-23 7:32 UTC (permalink / raw) To: the Hide; +Cc: stable [-- Attachment #1: Type: text/plain, Size: 828 bytes --] the Hide wrote... > Who should I contact regarding the following error > > > E: Malformed entry 5 in list file > /etc/apt/sources.list.d/additional-repositories.list (Component) > E: The list of sources could not be read. > E: _cache->open() failed, please report. Assuming you're using Debian and not some derivatve: Some Debian users mailing list, like <https://lists.debian.org/debian-user/> From the above error message I assume there's a format error in /etc/apt/sources.list.d/additional-repositories.list - so it was wise to include the content of that file in a message to that list. If it's actually a bug in apt, the Debian bug tracker was the place to go. This list here however is about development of the Linux kernel, the stable releases, so not quite the right place. Christoph [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: @ 2023-02-28 6:32 Mahmut Akten 0 siblings, 0 replies; 15+ messages in thread From: Mahmut Akten @ 2023-02-28 6:32 UTC (permalink / raw) To: stable Hello I need your urgent response to a transaction request attached to your name/email stable@vger.kernel.org I would like to discuss with you now. Thank You Mahmut Akten Vice Chairman Garanti BBVA Bank (Turkey) www.garantibbva.com.tr ^ permalink raw reply [flat|nested] 15+ messages in thread
* (no subject) @ 2022-11-09 14:34 Denis Arefev 2022-11-09 14:44 ` Greg Kroah-Hartman 0 siblings, 1 reply; 15+ messages in thread From: Denis Arefev @ 2022-11-09 14:34 UTC (permalink / raw) To: David Airlie, Daniel Vetter, Greg Kroah-Hartman, stable Cc: Alexey Khoroshilov, ldv-project, trufanov, vfh Date: Wed, 9 Nov 2022 16:52:17 +0300 Subject: [PATCH 5.10] nbio_v7_4: Add pointer check Return value of a function 'amdgpu_ras_find_obj' is dereferenced at nbio_v7_4.c:325 without checking for null Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Denis Arefev <arefev@swemel.ru> --- drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c index eadc9526d33f..d2627a610e48 100644 --- a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c +++ b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c @@ -303,6 +303,9 @@ static void nbio_v7_4_handle_ras_controller_intr_no_bifring(struct amdgpu_device struct ras_manager *obj = amdgpu_ras_find_obj(adev, adev->nbio.ras_if); struct ras_err_data err_data = {0, 0, 0, NULL}; struct amdgpu_ras *ras = amdgpu_ras_get_context(adev); + if (!obj) + return; bif_doorbell_intr_cntl = RREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL); if (REG_GET_FIELD(bif_doorbell_intr_cntl, -- 2.25.1 ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: 2022-11-09 14:34 Denis Arefev @ 2022-11-09 14:44 ` Greg Kroah-Hartman 0 siblings, 0 replies; 15+ messages in thread From: Greg Kroah-Hartman @ 2022-11-09 14:44 UTC (permalink / raw) To: Denis Arefev Cc: David Airlie, Daniel Vetter, stable, Alexey Khoroshilov, ldv-project, trufanov, vfh On Wed, Nov 09, 2022 at 05:34:13PM +0300, Denis Arefev wrote: > Date: Wed, 9 Nov 2022 16:52:17 +0300 > Subject: [PATCH 5.10] nbio_v7_4: Add pointer check > > Return value of a function 'amdgpu_ras_find_obj' is dereferenced at nbio_v7_4.c:325 without checking for null > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Signed-off-by: Denis Arefev <arefev@swemel.ru> > --- > drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c > index eadc9526d33f..d2627a610e48 100644 > --- a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c > +++ b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c > @@ -303,6 +303,9 @@ static void nbio_v7_4_handle_ras_controller_intr_no_bifring(struct amdgpu_device > struct ras_manager *obj = amdgpu_ras_find_obj(adev, adev->nbio.ras_if); > struct ras_err_data err_data = {0, 0, 0, NULL}; > struct amdgpu_ras *ras = amdgpu_ras_get_context(adev); > > + if (!obj) > + return; > > bif_doorbell_intr_cntl = RREG32_SOC15(NBIO, 0, mmBIF_DOORBELL_INT_CNTL); > if (REG_GET_FIELD(bif_doorbell_intr_cntl, > -- > 2.25.1 > <formletter> This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly. </formletter> ^ permalink raw reply [flat|nested] 15+ messages in thread
* (no subject)
@ 2022-06-06 5:33 Fenil Jain
2022-06-06 5:51 ` Greg Kroah-Hartman
0 siblings, 1 reply; 15+ messages in thread
From: Fenil Jain @ 2022-06-06 5:33 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Shuah Khan, stable
On Fri, Jun 03, 2022 at 07:43:01PM +0200, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 5.18.2 release.
> There are 67 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 Sun, 05 Jun 2022 17:38:05 +0000.
> Anything received after that time might be too late.
Hey Greg,
Ran tests and boot tested on my system, no regression found
Tested-by: Fenil Jain<fkjainco@gmail.com>
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: 2022-06-06 5:33 Fenil Jain @ 2022-06-06 5:51 ` Greg Kroah-Hartman 0 siblings, 0 replies; 15+ messages in thread From: Greg Kroah-Hartman @ 2022-06-06 5:51 UTC (permalink / raw) To: Fenil Jain; +Cc: Shuah Khan, stable On Mon, Jun 06, 2022 at 11:03:24AM +0530, Fenil Jain wrote: > On Fri, Jun 03, 2022 at 07:43:01PM +0200, Greg Kroah-Hartman wrote: > > This is the start of the stable review cycle for the 5.18.2 release. > > There are 67 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 Sun, 05 Jun 2022 17:38:05 +0000. > > Anything received after that time might be too late. > > Hey Greg, > > Ran tests and boot tested on my system, no regression found > > Tested-by: Fenil Jain<fkjainco@gmail.com> Thanks for the testing, but something went wrong with your email client and it lost the Subject: line, making this impossible to be picked up by our tools. Also, please include an extra ' ' before the '<' character in your tested-by line. thanks, greg k-h ^ permalink raw reply [flat|nested] 15+ messages in thread
* (no subject)
@ 2021-01-19 0:10 David Howells
2021-01-20 14:46 ` Jarkko Sakkinen
0 siblings, 1 reply; 15+ messages in thread
From: David Howells @ 2021-01-19 0:10 UTC (permalink / raw)
To: torvalds
Cc: Tobias Markus, Tianjia Zhang, dhowells, keyrings, linux-crypto,
linux-security-module, stable, linux-kernel
From: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
On the following call path, `sig->pkey_algo` is not assigned
in asymmetric_key_verify_signature(), which causes runtime
crash in public_key_verify_signature().
keyctl_pkey_verify
asymmetric_key_verify_signature
verify_signature
public_key_verify_signature
This patch simply check this situation and fixes the crash
caused by NULL pointer.
Fixes: 215525639631 ("X.509: support OSCCA SM2-with-SM3 certificate verification")
Reported-by: Tobias Markus <tobias@markus-regensburg.de>
Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-and-tested-by: Toke Høiland-Jørgensen <toke@redhat.com>
Tested-by: João Fonseca <jpedrofonseca@ua.pt>
Cc: stable@vger.kernel.org # v5.10+
---
crypto/asymmetric_keys/public_key.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/crypto/asymmetric_keys/public_key.c b/crypto/asymmetric_keys/public_key.c
index 8892908ad58c..788a4ba1e2e7 100644
--- a/crypto/asymmetric_keys/public_key.c
+++ b/crypto/asymmetric_keys/public_key.c
@@ -356,7 +356,8 @@ int public_key_verify_signature(const struct public_key *pkey,
if (ret)
goto error_free_key;
- if (strcmp(sig->pkey_algo, "sm2") == 0 && sig->data_size) {
+ if (sig->pkey_algo && strcmp(sig->pkey_algo, "sm2") == 0 &&
+ sig->data_size) {
ret = cert_sig_digest_update(sig, tfm);
if (ret)
goto error_free_key;
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: 2021-01-19 0:10 David Howells @ 2021-01-20 14:46 ` Jarkko Sakkinen 0 siblings, 0 replies; 15+ messages in thread From: Jarkko Sakkinen @ 2021-01-20 14:46 UTC (permalink / raw) To: David Howells Cc: torvalds, Tobias Markus, Tianjia Zhang, keyrings, linux-crypto, linux-security-module, stable, linux-kernel On Tue, Jan 19, 2021 at 12:10:33AM +0000, David Howells wrote: > > From: Tianjia Zhang <tianjia.zhang@linux.alibaba.com> > > On the following call path, `sig->pkey_algo` is not assigned > in asymmetric_key_verify_signature(), which causes runtime > crash in public_key_verify_signature(). > > keyctl_pkey_verify > asymmetric_key_verify_signature > verify_signature > public_key_verify_signature > > This patch simply check this situation and fixes the crash > caused by NULL pointer. > > Fixes: 215525639631 ("X.509: support OSCCA SM2-with-SM3 certificate verification") > Reported-by: Tobias Markus <tobias@markus-regensburg.de> > Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com> > Signed-off-by: David Howells <dhowells@redhat.com> > Reviewed-and-tested-by: Toke Høiland-Jørgensen <toke@redhat.com> > Tested-by: João Fonseca <jpedrofonseca@ua.pt> > Cc: stable@vger.kernel.org # v5.10+ > --- For what it's worth Acked-by: Jarkko Sakkinen <jarkko@kernel.org> /Jarkko > > crypto/asymmetric_keys/public_key.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/crypto/asymmetric_keys/public_key.c b/crypto/asymmetric_keys/public_key.c > index 8892908ad58c..788a4ba1e2e7 100644 > --- a/crypto/asymmetric_keys/public_key.c > +++ b/crypto/asymmetric_keys/public_key.c > @@ -356,7 +356,8 @@ int public_key_verify_signature(const struct public_key *pkey, > if (ret) > goto error_free_key; > > - if (strcmp(sig->pkey_algo, "sm2") == 0 && sig->data_size) { > + if (sig->pkey_algo && strcmp(sig->pkey_algo, "sm2") == 0 && > + sig->data_size) { > ret = cert_sig_digest_update(sig, tfm); > if (ret) > goto error_free_key; > > ^ permalink raw reply [flat|nested] 15+ messages in thread
* RE, @ 2018-12-04 2:34 Ms Sharifah Ahmad Mustahfa 0 siblings, 0 replies; 15+ messages in thread From: Ms Sharifah Ahmad Mustahfa @ 2018-12-04 2:34 UTC (permalink / raw) -- Hello, First of all i will like to apologies for my manner of communication because you do not know me personally, its due to the fact that i have a very important proposal for you. ^ permalink raw reply [flat|nested] 15+ messages in thread
* RE, @ 2018-11-06 1:19 Miss Juliet Muhammad 0 siblings, 0 replies; 15+ messages in thread From: Miss Juliet Muhammad @ 2018-11-06 1:19 UTC (permalink / raw) To: Recipients I have a deal for you, in your region. ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2026-05-04 9:16 UTC | newest] Thread overview: 15+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-04-19 15:46 George Guo 2024-04-19 15:46 ` [PATCH 4.19.y v6 1/2] tracing: Remove hist trigger synth_var_refs George Guo 2024-04-19 15:46 ` [PATCH 4.19.y v6 2/2] tracing: Use var_refs[] for hist trigger reference checking George Guo 2024-04-23 16:48 ` Greg KH -- strict thread matches above, loose matches on Subject: below -- 2026-04-23 16:06 [PATCH] usb: cdns3: gadget: fix request skipping after clearing halt Yongchao Wu 2026-04-27 1:22 ` Peter Chen (CIX) 2026-04-27 9:01 ` Pawel Laszczak 2026-04-27 22:59 ` Peter Chen (CIX) 2026-04-27 23:59 ` Yongchao Wu 2026-04-28 9:58 ` Pawel Laszczak 2026-04-28 14:48 ` Yongchao Wu 2026-05-04 9:15 ` Pawel Laszczak 2025-08-13 15:48 [PATCH 6.15 000/480] 6.15.10-rc1 review Jon Hunter 2025-08-13 17:25 ` Jon Hunter 2025-08-14 15:36 ` Greg KH 2025-08-15 16:20 ` Re: Jon Hunter 2025-08-15 16:53 ` Re: Greg KH 2024-11-23 1:39 the Hide 2024-11-23 7:32 ` Christoph Biedl 2023-02-28 6:32 Re: Mahmut Akten 2022-11-09 14:34 Denis Arefev 2022-11-09 14:44 ` Greg Kroah-Hartman 2022-06-06 5:33 Fenil Jain 2022-06-06 5:51 ` Greg Kroah-Hartman 2021-01-19 0:10 David Howells 2021-01-20 14:46 ` Jarkko Sakkinen 2018-12-04 2:34 RE, Ms Sharifah Ahmad Mustahfa 2018-11-06 1:19 RE, Miss Juliet Muhammad
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox