From: Al Viro <viro@ZenIV.linux.org.uk>
To: Tadeusz Struk <tadeusz.struk@intel.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
linux-crypto@vger.kernel.org
Subject: Re: [PATCH 03/17] fs: don't allow to complete sync iocbs through aio_complete
Date: Tue, 14 Apr 2015 20:22:01 +0100 [thread overview]
Message-ID: <20150414192201.GE889@ZenIV.linux.org.uk> (raw)
In-Reply-To: <552D5E4D.8000909@intel.com>
On Tue, Apr 14, 2015 at 11:37:01AM -0700, Tadeusz Struk wrote:
> The only problem is it calls init_sync_kiocb(&iocb, NULL) on a different iocb.
> The one that isn't even passed to skcipher_recvmsg()
> skcipher_recvmsg() checks is_sync_kiocb(msg->msg_iocb).
> I just want to make sure that after the merging window is closed I can still
> trigger aio_read on PF_ALG socket.
> thanks
... and after the merge with net-next#master that BUG_ON() is gone, so
you are still just fine.
FWIW, in the current for-davem (or in net-next#master, now that Dave has
pulled it) the functions in question are:
static inline int sock_recvmsg_nosec(struct socket *sock, struct msghdr *msg,
size_t size, int flags)
{
return sock->ops->recvmsg(sock, msg, size, flags);
}
int sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,
int flags)
{
int err = security_socket_recvmsg(sock, msg, size, flags);
return err ?: sock_recvmsg_nosec(sock, msg, size, flags);
}
EXPORT_SYMBOL(sock_recvmsg);
static ssize_t sock_read_iter(struct kiocb *iocb, struct iov_iter *to)
{
struct file *file = iocb->ki_filp;
struct socket *sock = file->private_data;
struct msghdr msg = {.msg_iter = *to,
.msg_iocb = iocb};
ssize_t res;
if (file->f_flags & O_NONBLOCK)
msg.msg_flags = MSG_DONTWAIT;
if (iocb->ki_pos != 0)
return -ESPIPE;
if (!iov_iter_count(to)) /* Match SYS5 behaviour */
return 0;
res = sock_recvmsg(sock, &msg, iov_iter_count(to), msg.msg_flags);
*to = msg.msg_iter;
return res;
}
AFAICS, everything looks fine. Now, _another_ BUG_ON() might be worth
eventual removal (one in sock_sendmsg_nosec()), but right now we don't
have async ->sendmsg() instances, so it's not urgent.
next prev parent reply other threads:[~2015-04-14 19:22 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-11 21:17 [call for review] netdev-related stuff in vfs.git Al Viro
2015-04-11 21:18 ` [PATCH 01/17] fs: remove ki_nbytes Al Viro
2015-04-11 21:18 ` [PATCH 02/17] fuse: handle synchronous iocbs internally Al Viro
2015-04-11 21:18 ` [PATCH 03/17] fs: don't allow to complete sync iocbs through aio_complete Al Viro
2015-04-14 18:00 ` Tadeusz Struk
2015-04-14 18:26 ` Al Viro
2015-04-14 18:37 ` Tadeusz Struk
2015-04-14 19:22 ` Al Viro [this message]
2015-04-11 21:18 ` [PATCH 04/17] fs: split generic and aio kiocb Al Viro
2015-04-11 21:18 ` [PATCH 05/17] fs: move struct kiocb to fs.h Al Viro
2015-04-11 21:18 ` [PATCH 06/17] saner iov_iter initialization primitives Al Viro
2015-04-11 21:18 ` [PATCH 07/17] RxRPC: Fix the conversion to iov_iter Al Viro
2015-04-11 21:18 ` [PATCH 08/17] RxRPC: Don't call skb_add_data() if there's no data to copy Al Viro
2015-04-11 21:18 ` [PATCH 09/17] RxRPC: Use iov_iter_count() in rxrpc_send_data() instead of the len argument Al Viro
2015-04-11 21:18 ` [PATCH 10/17] AFS: afs_send_empty_reply() doesn't require an iovec array Al Viro
2015-04-11 21:18 ` [PATCH 11/17] RxRPC: Handle VERSION Rx protocol packets Al Viro
2015-04-11 21:18 ` [PATCH 12/17] kafs: Add more "unified AFS" error codes Al Viro
2015-04-11 21:18 ` [PATCH 13/17] net: switch sendto() and recvfrom() to import_single_range() Al Viro
2015-04-11 21:18 ` [PATCH 14/17] net: switch importing msghdr from userland to {compat_,}import_iovec() Al Viro
2015-04-11 21:18 ` [PATCH 15/17] switch kernel_sendmsg() and kernel_recvmsg() to iov_iter_kvec() Al Viro
2015-04-14 16:21 ` David Laight
2015-04-14 16:34 ` Al Viro
2015-04-14 16:36 ` David Laight
2015-04-14 16:59 ` Al Viro
2015-04-15 9:08 ` David Laight
2015-04-15 9:36 ` Daniel Borkmann
2015-04-15 9:53 ` David Laight
2015-04-11 21:18 ` [PATCH 16/17] get rid of the size argument of sock_sendmsg() Al Viro
2015-04-14 16:25 ` David Laight
2015-04-14 16:35 ` Al Viro
2015-04-14 16:44 ` Al Viro
2015-04-14 17:55 ` David Miller
2015-04-15 8:37 ` David Laight
2015-04-15 10:15 ` Eric Dumazet
2015-04-15 16:06 ` David Miller
2015-04-11 21:18 ` [PATCH 17/17] new helper: msg_data_left() Al Viro
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=20150414192201.GE889@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=davem@davemloft.net \
--cc=linux-crypto@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tadeusz.struk@intel.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;
as well as URLs for NNTP newsgroup(s).