mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@osdl.org>
To: torvalds@osdl.org, akpm@osdl.org
Cc: linux-kernel@vger.kernel.org
Subject: [GIT PATCH] LSM update, another missing hook
Date: Wed, 12 Oct 2005 12:13:53 -0700	[thread overview]
Message-ID: <20051012191353.GG5856@shell0.pdx.osdl.net> (raw)

Please pull from:
	rsync://rsync.kernel.org/pub/scm/linux/kernel/git/chrisw/lsm-2.6.git/
or if master.kernel.org hasn't synced up yet:
	master.kernel.org:/pub/scm/linux/kernel/git/chrisw/lsm-2.6.git/

This has one small fix in it:

 fs/aio.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

Kostik Belousov:
  aio syscalls are not checked by lsm

Patch inline below since it's small.

thanks,
-chris
--

>From nobody Mon Sep 17 00:00:00 2001
Subject: [PATCH] aio syscalls are not checked by lsm
From: Kostik Belousov <konstantin.belousov@zoral.com.ua>

another case of missing call to security_file_permission:
aio functions (namely, io_submit) does not check credentials
with security modules.

Below is the simple patch to the problem. It seems that it is
enough to check for rights at the request submission time.

Signed-off-by: Kostik Belousov <kostikbel@gmail.com>
Signed-off-by: Chris Wright <chrisw@osdl.org>
---

 fs/aio.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

f223267dee21023ac5c1a0cdbbdbfed0dc8c8fff
diff --git a/fs/aio.c b/fs/aio.c
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -1418,6 +1418,9 @@ static ssize_t aio_setup_iocb(struct kio
 		if (unlikely(!access_ok(VERIFY_WRITE, kiocb->ki_buf,
 			kiocb->ki_left)))
 			break;
+		ret = security_file_permission(file, MAY_READ);
+		if (unlikely(ret))
+			break;
 		ret = -EINVAL;
 		if (file->f_op->aio_read)
 			kiocb->ki_retry = aio_pread;
@@ -1430,6 +1433,9 @@ static ssize_t aio_setup_iocb(struct kio
 		if (unlikely(!access_ok(VERIFY_READ, kiocb->ki_buf,
 			kiocb->ki_left)))
 			break;
+		ret = security_file_permission(file, MAY_WRITE);
+		if (unlikely(ret))
+			break;
 		ret = -EINVAL;
 		if (file->f_op->aio_write)
 			kiocb->ki_retry = aio_pwrite;


                 reply	other threads:[~2005-10-12 19:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20051012191353.GG5856@shell0.pdx.osdl.net \
    --to=chrisw@osdl.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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

Powered by JetHome