From: Goldwyn Rodrigues <rgoldwyn@suse.de>
To: linux-fsdevel@vger.kernel.org
Cc: Goldwyn Rodrigues <rgoldwyn@suse.com>
Subject: [PATCH] aio: Check for aio_flags
Date: Tue, 7 Feb 2017 20:33:23 -0600 [thread overview]
Message-ID: <20170208023323.8962-1-rgoldwyn@suse.de> (raw)
From: Goldwyn Rodrigues <rgoldwyn@suse.com>
aio_flags are not checked when performing io_submit() and
can contain non-conforming values.
Return -EINVAL if they are invalid.
Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
diff --git a/fs/aio.c b/fs/aio.c
index 428484f..f2dd175 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1521,6 +1521,11 @@ static int io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb,
return -EINVAL;
}
+ if (unlikely(iocb->aio_flags & ~IOCB_FLAG_RESFD)) {
+ pr_debug("EINVAL: incorrect flags\n");
+ return -EINVAL;
+ }
+
req = aio_get_req(ctx);
if (unlikely(!req))
return -EAGAIN;
next reply other threads:[~2017-02-08 2:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-08 2:33 Goldwyn Rodrigues [this message]
2017-02-08 7:59 ` [PATCH] aio: Check for aio_flags Christoph Hellwig
2017-02-08 11:19 ` Goldwyn Rodrigues
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=20170208023323.8962-1-rgoldwyn@suse.de \
--to=rgoldwyn@suse.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=rgoldwyn@suse.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).