public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>, jack@suse.cz
Cc: linux-block@vger.kernel.org
Subject: Re: [PATCH] loop: remember whether sysfs_create_group() succeeded
Date: Fri, 4 May 2018 08:30:39 -0600	[thread overview]
Message-ID: <6bf461ba-4bd0-6709-1605-b0fccd0f105d@kernel.dk> (raw)
In-Reply-To: <201805042327.CBF64097.OOVQFtFJFLSHOM@I-love.SAKURA.ne.jp>

On 5/4/18 8:27 AM, Tetsuo Handa wrote:
> Jens Axboe wrote:
>> On 5/4/18 5:47 AM, Tetsuo Handa wrote:
>>> >From 626d33de1b70b11ecaf95a9f83f7644998e54cbb Mon Sep 17 00:00:00 2001
>>> From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
>>> Date: Wed, 2 May 2018 23:03:48 +0900
>>> Subject: [PATCH] loop: remember whether sysfs_create_group() succeeded
>>>
>>> syzbot is hitting WARN() triggered by memory allocation fault
>>> injection [1] because loop module is calling sysfs_remove_group()
>>> when sysfs_create_group() failed.
>>> Fix this by remembering whether sysfs_create_group() succeeded.
>>
>> Can we store this locally instead of in the loop_device? Also,
>> naming wise, something like sysfs_init_done would be more readily
>> understandable.
> 
> Whether sysfs entry for this loop device exists is per "struct loop_device"
> flag, isn't it? What does "locally" mean?

I'm assuming this is calling remove in an error path when alloc fails.
So it should be possible to know locally whether this was done or not,
before calling the teardown. Storing this is in the loop_device seems
like a bit of a hack.

If that's not easily done, then my next suggestion would be to
use a loop flag for it, LO_FLAGS_SYSFS_SETUP or something like that.

-- 
Jens Axboe

  reply	other threads:[~2018-05-04 14:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <001a113ed2fa7bedfe055c8316a5@google.com>
     [not found] ` <94eb2c030882b2b1b505610813df@google.com>
     [not found]   ` <55ff5960-eaab-5a36-5605-4e2230b77607@I-love.SAKURA.ne.jp>
     [not found]     ` <20180502142434.GA10928@kroah.com>
2018-05-04 11:47       ` [PATCH] loop: remember whether sysfs_create_group() succeeded Tetsuo Handa
2018-05-04 14:15         ` Jens Axboe
2018-05-04 14:27           ` Tetsuo Handa
2018-05-04 14:30             ` Jens Axboe [this message]
2018-05-04 14:40               ` Tetsuo Handa
2018-05-04 14:43                 ` Jens Axboe
2018-05-04 16:14                   ` [PATCH v2] " Tetsuo Handa
2018-05-04 16:27                     ` Jens Axboe
2018-05-04 16:47                       ` Tetsuo Handa
2018-05-05 10:46                 ` [PATCH] " Milan Broz
2018-05-05 11:49                   ` Tetsuo Handa
2018-05-08  9:02                     ` Milan Broz
2018-05-09 12:31         ` Jan Kara

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=6bf461ba-4bd0-6709-1605-b0fccd0f105d@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=jack@suse.cz \
    --cc=linux-block@vger.kernel.org \
    --cc=penguin-kernel@I-love.SAKURA.ne.jp \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox