All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Sakamoto <o-takashi@sakamocchi.jp>
To: "Zhijian Li (Fujitsu)" <lizhijian@fujitsu.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux1394-devel@lists.sourceforge.net"
	<linux1394-devel@lists.sourceforge.net>
Subject: Re: [PATCH 1/2] firewire: Kill unnecessary buf check in device_attribute.show
Date: Mon, 18 Mar 2024 18:23:11 +0900	[thread overview]
Message-ID: <20240318092311.GA678645@workstation.local> (raw)
In-Reply-To: <625470f3-b196-43f7-9844-fa1cb6da99f8@fujitsu.com>

Hi,

On Mon, Mar 18, 2024 at 06:24:52AM +0000, Zhijian Li (Fujitsu) wrote:
> ...
> Sorry for the mistake. I haven't considered callers from other than sysfs.
> I'm fine to reverting both *two*.
> 
> If we are interesting in the sysfs_emit conversion one, i cooked(see the attachment)
> a patch to revert "firewire: Kill unnecessary buf check in device_attribute.show" only.
> 
> (Feel free to ignore it if you have had a local fix.)
> ...
> From 96ad3e15b86e2504f3c17fd6a10be48e5ff81cb1 Mon Sep 17 00:00:00 2001
> From: Li Zhijian <lizhijian@fujitsu.com>
> Date: Mon, 18 Mar 2024 14:05:32 +0800
> Subject: [PATCH] Revert "firewire: Kill unnecessary buf check in
>  device_attribute.show"
> 
> This reverts commit 4a2b06ca33763b363038d333274e212db6ff0de1.
> 
> The previous fix didn't consider callers from other than sysfs. Revert
> it to fix the NULL dereference
> 
>  kernel:  ? sysfs_emit+0xb5/0xc0
>  kernel:  show_immediate+0x13f/0x1d0 [firewire_core]
>  kernel:  init_fw_attribute_group+0x81/0x150 [firewire_core]
>  kernel:  create_units+0x119/0x160 [firewire_core]
>  kernel:  fw_device_init+0x1a9/0x330 [firewire_core]
>  kernel:  fw_device_workfn+0x12/0x20 [firewire_core]
>  kernel:  process_one_work+0x16f/0x350
>  kernel:  worker_thread+0x306/0x440
>  kernel:  ? __pfx_worker_thread+0x10/0x10
>  kernel:  kthread+0xf2/0x120
>  kernel:  ? __pfx_kthread+0x10/0x10
>  kernel:  ret_from_fork+0x47/0x70
>  kernel:  ? __pfx_kthread+0x10/0x10
>  kernel:  ret_from_fork_asm+0x1b/0x30
>  kernel:  </TASK>
>  kernel: ---[ end trace 0000000000000000 ]---
>  kernel: ------------[ cut here ]------------
> 
> Fixes: 4a2b06ca3376 ("firewire: Kill unnecessary buf check in device_attribute.show")
> Reported-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
> Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
> ---
>  drivers/firewire/core-device.c | 16 ++++++++++++----
>  1 file changed, 12 insertions(+), 4 deletions(-)

Thanks for your immediate action. I applied it to for-linus branch, and
will send it in this week with my additional patch for notes. Let's back
to test, hehe.


Thanks

Takashi Sakamoto

  reply	other threads:[~2024-03-18  9:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22  5:39 [PATCH 1/2] firewire: Kill unnecessary buf check in device_attribute.show Li Zhijian
2024-01-22  5:39 ` [PATCH 2/2] firewire: Convert snprintf/sprintf to sysfs_emit Li Zhijian
2024-01-22  8:56 ` [PATCH 1/2] firewire: Kill unnecessary buf check in device_attribute.show Takashi Sakamoto
2024-03-18  4:46   ` Takashi Sakamoto
2024-03-18  6:24     ` Zhijian Li (Fujitsu)
2024-03-18  9:23       ` Takashi Sakamoto [this message]
2024-03-18  9:17     ` [PATCH] firewire: core: add memo about the caller of show functions for device attributes Takashi Sakamoto

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=20240318092311.GA678645@workstation.local \
    --to=o-takashi@sakamocchi.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=lizhijian@fujitsu.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.