All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Péter Ujfalusi" <peter.ujfalusi@linux.intel.com>
To: Dan Carpenter <error27@gmail.com>
Cc: guennadi.liakhovetski@linux.intel.com, alsa-devel@alsa-project.org
Subject: Re: [bug report] ASoC: SOF: avoid a NULL dereference with unsupported widgets
Date: Mon, 3 Apr 2023 08:20:38 +0300	[thread overview]
Message-ID: <8f78395b-5cc3-e5da-90f2-2fa7114ddcfb@linux.intel.com> (raw)
In-Reply-To: <b3671cde-7f77-48aa-a4a2-db25e141ff45@kili.mountain>



On 01/04/2023 10:44, Dan Carpenter wrote:
> On Fri, Mar 31, 2023 at 10:14:11AM +0300, Péter Ujfalusi wrote:
>> if src_fw_module is NULL then the print will be:
>> source (efault) or sink sink.module.name widget weren't set up properly
>>
>> Guennadi is relying on some black magic in the printk system to handle
>> the printing instead of open coding.
> 
> I've done compiler related work and explored some weird aspect of the
> C language and I am so fascinated by this.  I would have thought it
> crashes before the function is called.  I cannot even imagine how black
> magic like this would work.

I think it is not a compiler magic, but kernel magic:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/lib/vsprintf.c#n700

> Is there anyway I can test this?

You could, If you have a laptop which uses SOF and it is Intel 11th gen
or newer then you can switch it to IPC4 and install the opt-in v2.5
(which would need with 6.4 kernel).
Apply this patch to 6.3-rc (or 6.2) and boot up, but unpatched kernel
will NULL dereference, so you need to have a backup option.

https://github.com/thesofproject/sof-bin

The v2.5 is not there as a release,you need to fetch the repo and follow
the instructions.

Read the instruction in v2.5.x/README.md before attempting to use this
release.

Now that I look back at the patch, yes it is not obvious, but it is
doing a valid thing.

-- 
Péter

  reply	other threads:[~2023-04-03  5:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-31  6:58 [bug report] ASoC: SOF: avoid a NULL dereference with unsupported widgets Dan Carpenter
2023-03-31  7:14 ` Péter Ujfalusi
2023-04-01  7:44   ` Dan Carpenter
2023-04-03  5:20     ` Péter Ujfalusi [this message]
2023-04-03  5:54       ` Dan Carpenter
2023-04-03  7:08         ` Péter Ujfalusi
2023-04-11 16:22           ` Guennadi Liakhovetski
2023-04-13  4:41             ` Dan Carpenter
2023-04-13  4:46               ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8f78395b-5cc3-e5da-90f2-2fa7114ddcfb@linux.intel.com \
    --to=peter.ujfalusi@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=error27@gmail.com \
    --cc=guennadi.liakhovetski@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.