Skip to content

ASoC: SOF: Topology: Fix EQ feature by properly utilizing new user ABI - #334

Merged
plbossart merged 1 commit into
thesofproject:topic/sof-devfrom
singalsu:fix_eq_functionality_with_new_abi
Nov 30, 2018
Merged

ASoC: SOF: Topology: Fix EQ feature by properly utilizing new user ABI#334
plbossart merged 1 commit into
thesofproject:topic/sof-devfrom
singalsu:fix_eq_functionality_with_new_abi

Conversation

@singalsu

Copy link
Copy Markdown
Collaborator

This patch contains a number of updates. First, the EQ header in uapi
is updated similarly as in firmware. The macros and structs were
conflicting and prevented firmware EQs to work correctly.

The topology.c sof_control_load_bytes() function is updated to check
the ABI fields instead of creating them. The user space tools need
to insert a valid ABI header into configuration data. The check for
user data size is improved by adding DSP IPC max size check.

The control.c ext bytes put/get code is similarly updated to
retrieve/return the ABI header from user space. The checks are improved
to cover size exceed and mismatch. The added debug messages and changed
error messages help to know the limits for user data size without need
to deep dive into source code.

The error message in snd_sof_bytes_put() function is fixed.

Signed-off-by: Seppo Ingalsuo seppo.ingalsuo@linux.intel.com

@singalsu

Copy link
Copy Markdown
CollaboratorAuthor

Note: The FW and topology fixes are needed too for the feature to work. Plus the tools fix is needed to be able to create working EQ configurations. I will create next the PRs for them.

I'm proposing to not bump the ABI version since I'm only fixing the buggy macros there.

Comment threadsound/soc/sof/control.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this seems too verbose to have a debug message every time you change an EQ coefficient.
Just keep the error message with all the information needed.

@plbossartplbossart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rebase, remove some too verbose logs and let me know when it's merged in the firmware, i'll merge then. Thanks!

Comment threadsound/soc/sof/control.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah crap, this conflicts with the change I just merged, so you'll have to rebase and resubmit.

Comment threadsound/soc/sof/control.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same, it's too verbose and not very useful info

Comment threadsound/soc/sof/topology.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

too verbose?

@singalsu

Copy link
Copy Markdown
CollaboratorAuthor

OK, I'll reduce the verbosity. I added them to keep my mind clear what the various sizes are while checking the size checks code. The error prints should now contain the sufficient information for a user to fix their data if there's issue.

This patch contains a number of updates. First, the EQ header in uapi
is updated similarly as in firmware. The macros and structs were
conflicting and prevented firmware EQs to work correctly.
The topology.c sof_control_load_bytes() function is updated to check
the ABI fields instead of creating them. The user space tools need
to insert a valid ABI header into configuration data. The check for
user data size is improved by adding DSP IPC max size check.
The control.c ext bytes put/get code is similarly updated to
retrieve/return the ABI header from user space. The checks are improved
to cover size exceed and mismatch. The changed error messages help to
know the limits for user data size without need to deep dive into
source code.
Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
@singalsu
singalsuforce-pushed the fix_eq_functionality_with_new_abi branch from 3b0638b to 4bb3da2CompareNovember 30, 2018 13:57
@singalsu

Copy link
Copy Markdown
CollaboratorAuthor

@plbossart I've updated now the PR.

@plbossartplbossart left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, let's merge

@plbossart
plbossart merged commit 1f5974a into thesofproject:topic/sof-devNov 30, 2018
@singalsu

Copy link
Copy Markdown
CollaboratorAuthor

@plbossart@lgirdwood Great, thanks for the review rounds for this!

kv2019i pushed a commit to kv2019i/linux that referenced this pull request Jan 19, 2021
the following syzkaller reproducer:
r0 = socket$inet_mptcp(0x2, 0x1, 0x106)
bind$inet(r0, &(0x7f0000000080)={0x2, 0x4e24, @multicast2}, 0x10)
connect$inet(r0, &(0x7f0000000480)={0x2, 0x4e24, @Local}, 0x10)
sendto$inet(r0, &(0x7f0000000100)="f6", 0xffffffe7, 0xc000, 0x0, 0x0)
systematically triggers the following warning:
WARNING: CPU: 2 PID: 8618 at net/core/stream.c:208 sk_stream_kill_queues+0x3fa/0x580
Modules linked in:
CPU: 2 PID: 8618 Comm: syz-executor Not tainted 5.10.0+ thesofproject#334
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.1-4.module+el8.1.0+4066+0f1aadab 04/04
RIP: 0010:sk_stream_kill_queues+0x3fa/0x580
Code: df 48 c1 ea 03 0f b6 04 02 84 c0 74 04 3c 03 7e 40 8b ab 20 02 00 00 e9 64 ff ff ff e8 df f0 81 2
RSP: 0018:ffffc9000290fcb0 EFLAGS: 00010293
RAX: ffff888011cb8000 RBX: 0000000000000000 RCX: ffffffff86eecf0e
RDX: 0000000000000000 RSI: ffffffff86eecf6a RDI: 0000000000000005
RBP: 0000000000000e28 R08: ffff888011cb8000 R09: fffffbfff1f48139
R10: ffffffff8fa409c7 R11: fffffbfff1f48138 R12: ffff8880215e6220
R13: ffffffff8fa409c0 R14: ffffc9000290fd30 R15: 1ffff92000521fa2
FS: 00007f41c78f4800(0000) GS:ffff88802d000000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f95c803d088 CR3: 0000000025ed2000 CR4: 00000000000006f0
Call Trace:
__mptcp_destroy_sock+0x4f5/0x8e0
mptcp_close+0x5e2/0x7f0
inet_release+0x12b/0x270
__sock_release+0xc8/0x270
sock_close+0x18/0x20
__fput+0x272/0x8e0
task_work_run+0xe0/0x1a0
exit_to_user_mode_prepare+0x1df/0x200
syscall_exit_to_user_mode+0x19/0x50
entry_SYSCALL_64_after_hwframe+0x44/0xa9
userspace programs provide arbitrarily high values of 'len' in sendmsg():
this is causing integer overflow of 'amount'. Cap forward allocation to 1
megabyte: higher values are not really useful.
Suggested-by: Paolo Abeni <pabeni@redhat.com>
Fixes: e93da92 ("mptcp: implement wmem reservation")
Signed-off-by: Davide Caratti <dcaratti@redhat.com>
Link: https://lore.kernel.org/r/3334d00d8b2faecafdfab9aa593efcbf61442756.1608584474.git.dcaratti@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
bardliao pushed a commit to bardliao/linux that referenced this pull request Oct 31, 2024
Currently, there is no terminator entry for exynosautov920_cmu_of_match,
hence facing below KASAN warning,
BUG: KASAN: global-out-of-bounds in of_match_node+0x120/0x13c
Read of size 1 at addr ffffffe31cc9e628 by task swapper/0/1
CPU: 1 UID: 0 PID: 1 Comm: swapper/0 Not tainted 6.11.0+ thesofproject#334
Hardware name: linux,dummy-virt (DT)
Call trace:
dump_backtrace+0x94/0xec
show_stack+0x18/0x24
dump_stack_lvl+0x90/0xd0
print_report+0x1f4/0x5b4
kasan_report+0xc8/0x110
__asan_report_load1_noabort+0x20/0x2c
of_match_node+0x120/0x13c
of_match_device+0x70/0xb4
platform_match+0xa0/0x25c
__device_attach_driver+0x7c/0x2d4
bus_for_each_drv+0x100/0x188
__device_attach+0x174/0x364
device_initial_probe+0x14/0x20
bus_probe_device+0x128/0x158
device_add+0xb3c/0x10fc
of_device_add+0xdc/0x150
of_platform_device_create_pdata+0x120/0x20c
of_platform_bus_create+0x2bc/0x620
of_platform_populate+0x58/0x108
of_platform_default_populate_init+0x100/0x120
do_one_initcall+0x110/0x788
kernel_init_freeable+0x44c/0x61c
kernel_init+0x24/0x1e4
ret_from_fork+0x10/0x20
The buggy address belongs to the variable:
exynosautov920_cmu_of_match+0xc8/0x2c80
Add a dummy terminator entry at the end to assist of_match_node() in
traversing up to the terminator entry without accessing an
out-of-boundary index.
Fixes: 485e13f ("clk: samsung: add top clock support for ExynosAuto v920 SoC")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20240927102104.3268790-1-ruanjinjie@huawei.com
[krzk: drop trailing comma]
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
oder-chiou pushed a commit to oder-chiou/linux-soundwire that referenced this pull request May 5, 2026
Add a test case which replaces an active ingress qdisc while keeping the
miniq in-tact during the transition period to the new clsact qdisc.
# ./vmtest.sh -- ./test_progs -t tc_link
[...]
./test_progs -t tc_link
[ 3.412871] bpf_testmod: loading out-of-tree module taints kernel.
[ 3.413343] bpf_testmod: module verification failed: signature and/or required key missing - tainting kernel
thesofproject#332 tc_links_after:OK
thesofproject#333 tc_links_append:OK
thesofproject#334 tc_links_basic:OK
thesofproject#335 tc_links_before:OK
thesofproject#336 tc_links_chain_classic:OK
thesofproject#337 tc_links_chain_mixed:OK
thesofproject#338 tc_links_dev_chain0:OK
thesofproject#339 tc_links_dev_cleanup:OK
thesofproject#340 tc_links_dev_mixed:OK
thesofproject#341 tc_links_ingress:OK
thesofproject#342 tc_links_invalid:OK
thesofproject#343 tc_links_prepend:OK
thesofproject#344 tc_links_replace:OK
thesofproject#345 tc_links_revision:OK
Summary: 14/0 PASSED, 0 SKIPPED, 0 FAILED
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Cc: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://lore.kernel.org/r/20240708133130.11609-2-daniel@iogearbox.net
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@singalsu@plbossart