linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] aio: Check for aio_flags
@ 2017-02-08  2:33 Goldwyn Rodrigues
  2017-02-08  7:59 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Goldwyn Rodrigues @ 2017-02-08  2:33 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Goldwyn Rodrigues

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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-08 11:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-08  2:33 [PATCH] aio: Check for aio_flags Goldwyn Rodrigues
2017-02-08  7:59 ` Christoph Hellwig
2017-02-08 11:19   ` Goldwyn Rodrigues

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).