From: Pavel Skripkin <paskripkin@gmail.com>
To: Jiri Slaby <jirislaby@kernel.org>,
gregkh@linuxfoundation.org, hdanton@sina.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tty: n_gsm: add missing tty_kref_put
Date: Tue, 9 Nov 2021 22:10:57 +0300 [thread overview]
Message-ID: <d047dc51-1259-6885-fba7-0d72a375d799@gmail.com> (raw)
In-Reply-To: <8e7d4214-01b8-d1a7-adaf-f2135cb6431a@kernel.org>
On 11/9/21 20:33, Jiri Slaby wrote:
> On 09. 11. 21, 11:39, Pavel Skripkin wrote:
>> My local syzbot instance hit memory leak in gsmld_attach_gsm(). The
>> reproducer injects allocation failure in tty_register_device(). After
>> this error only previous tty_register_device() calls unwinded, but not
>> tty_kref_get().
>>
>> It leads to tty_struct leak, because ->close() won't be called in case
>> of ->open() failure and nothing puts tty reference.
>
> I don't have time to check the n_gsm case now (like: are you talking
> about tty->open/close or file_ops->open/close -- they behave
> differently), but tty definitely calls close even if open fails.
>
Oh, I see now. I wasn't aware about this difference. Will do more
detailed analysis of reported leak. Thank you for pointing it out!
With regards,
Pavel Skripkin
prev parent reply other threads:[~2021-11-09 19:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-09 10:39 Pavel Skripkin
2021-11-09 17:33 ` Jiri Slaby
2021-11-09 19:10 ` Pavel Skripkin [this message]
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=d047dc51-1259-6885-fba7-0d72a375d799@gmail.com \
--to=paskripkin@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hdanton@sina.com \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®