All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Sreeraj S Kurup <sreekuttan2156239@gmail.com>
Cc: tiwai@suse.de, linux-kernel@vger.kernel.org,
	linux-sound@vger.kernel.org, perex@perex.cz
Subject: Re: [PATCH v2] ALSA: compress: Fix task resource leak on copy_to_user() failure
Date: Thu, 19 Nov 2026 13:57:49 +0100	[thread overview]
Message-ID: <87qzghugfm.wl-tiwai@suse.de> (raw)
In-Reply-To: <20261117160151.2624-1-sreekuttan2156239@gmail.com>

On Tue, 17 Nov 2026 17:01:51 +0100,
Sreeraj S Kurup wrote:
> 
> Hi Takashi,
> 
> Thanks for reviewing.
> 
> Regarding dma_buf_put(), get_dma_buf() takes an extra reference 
> for each DMA-BUF. This reference is intended to be transferred 
> to the file descriptor through fd_install(). If copy_to_user() 
> fails before fd_install(), these extra references must be 
> released separately.
> 
> snd_compr_task_free_one() releases the task's original DMA-BUF 
> references through snd_compr_task_free(). So both the explicit 
> dma_buf_put() calls and snd_compr_task_free_one() are needed.
> 
> Regarding the file descriptor ordering, I moved fd_install() 
> after copy_to_user() so that the file descriptors are installed 
> only after the task information is successfully copied to userspace.
> 
> There is a small time gap between copying the descriptor numbers and 
> installing the file descriptors. Userspace should use these descriptors 
> only after the ioctl completes.
> 
> Please let me know if you have any further concerns.
> 
> Best regards,
> Sreeraj

OK, now I applied to for-next branch.  Thanks.


Takashi

  reply	other threads:[~2026-11-19 12:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 10:45 [PATCH] ALSA: compress: Fix task resource leak on copy_to_user() failure Sreeraj S Kurup
2026-11-13 10:55 ` sashiko-bot
2026-11-13 11:04 ` [PATCH v2] " Sreeraj S Kurup
2026-11-17  6:28   ` Sreeraj S Kurup
2026-11-17 15:13     ` Takashi Iwai
2026-11-17 16:01       ` Sreeraj S Kurup
2026-11-19 12:57         ` Takashi Iwai [this message]
2026-11-19 15:07           ` Sreeraj S Kurup

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=87qzghugfm.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=sreekuttan2156239@gmail.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.