public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: "Antipov, Dmitriy" <Dmitriy.Antipov@softline.com>
To: "gbayer@linux.ibm.com" <gbayer@linux.ibm.com>,
	"guwen@linux.alibaba.com" <guwen@linux.alibaba.com>,
	"wenjia@linux.ibm.com" <wenjia@linux.ibm.com>,
	"jaka@linux.ibm.com" <jaka@linux.ibm.com>
Cc: "lvc-project@linuxtesting.org" <lvc-project@linuxtesting.org>,
	"Shvetsov, Alexander" <Alexander.Shvetsov@softline.com>,
	"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [lvc-project] [PATCH] [RFC] net: smc: fix fasync leak in smc_release()
Date: Tue, 26 Mar 2024 08:18:43 +0000	[thread overview]
Message-ID: <941b129e87fec6b2f22ed3bc75334bd8515565a1.camel@softline.com> (raw)
In-Reply-To: <4a65f2f04d502a770627ccaacd099fd6a9d7f43a.camel@softline.com>

On Thu, 2024-03-07 at 13:21 +0300, Dmitry Antipov wrote:

> On Thu, 2024-03-07 at 10:57 +0100, Jan Karcher wrote:
> 
> > We think it might be an option to secure the path in this function with 
> > the smc->clcsock_release_lock.
> > 
> > ```
> > 	lock_sock(&smc->sk);
> > 	if (smc->use_fallback) {
> > 		if (!smc->clcsock) {
> > 			release_sock(&smc->sk);
> > 			return -EBADF;
> > 		}
> > +		mutex_lock(&smc->clcsock_release_lock);
> > 		answ = smc->clcsock->ops->ioctl(smc->clcsock, cmd, arg);
> > +		mutex_unlock(&smc->clcsock_release_lock);
> > 		release_sock(&smc->sk);
> > 		return answ;
> > 	}
> > ```
> > 
> > What do yo think about this?
> 
> You're trying to fix it on the wrong path. FIOASYNC is a generic rather
> than protocol-specific thing. So userspace 'ioctl(sock, FIOASYNC, [])'
> call is handled with:
> 
> -> sys_ioctl()
>   -> do_vfs_ioctl()
>     -> ioctl_fioasync()
>       -> filp->f_op->fasync() (which is sock_fasync() for all sockets)
> 
> rather than 'sock->ops->ioctl(...)'.

Any progress on this?

Dmitry


  reply	other threads:[~2024-03-26  8:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-21  5:16 [PATCH] [RFC] net: smc: fix fasync leak in smc_release() Dmitry Antipov
2024-02-21 13:09 ` Wen Gu
2024-02-21 15:02   ` [lvc-project] " Antipov, Dmitriy
2024-02-23  3:36     ` Wen Gu
2024-03-04 16:35       ` Dmitry Antipov
2024-03-06 14:45         ` Wen Gu
2024-03-06 18:07           ` Dmitry Antipov
2024-03-07  8:58             ` Jan Karcher
2024-03-07  9:57             ` Jan Karcher
2024-03-07 10:21               ` Antipov, Dmitriy
2024-03-26  8:18                 ` Antipov, Dmitriy [this message]
2024-03-27  6:12                   ` Wen Gu
2024-03-07 13:53             ` Wen Gu

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=941b129e87fec6b2f22ed3bc75334bd8515565a1.camel@softline.com \
    --to=dmitriy.antipov@softline.com \
    --cc=Alexander.Shvetsov@softline.com \
    --cc=gbayer@linux.ibm.com \
    --cc=guwen@linux.alibaba.com \
    --cc=jaka@linux.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=lvc-project@linuxtesting.org \
    --cc=netdev@vger.kernel.org \
    --cc=wenjia@linux.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox