+ dquot-add-proper-locking-when-using-current-signal-tty.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     dquot: add proper locking when using current->signal->tty

has been added to the -mm tree.  Its filename is

     dquot-add-proper-locking-when-using-current-signal-tty.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: dquot: add proper locking when using current->signal->tty
From: Jan Kara <jack@xxxxxxx>

Dquot passes the tty to tty_write_message without locking

Signed-off-by: Jan Kara <jack@xxxxxxx>
Cc: Alan Cox <alan@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/dquot.c |    5 +++++
 1 files changed, 5 insertions(+)

diff -puN fs/dquot.c~dquot-add-proper-locking-when-using-current-signal-tty fs/dquot.c
--- a/fs/dquot.c~dquot-add-proper-locking-when-using-current-signal-tty
+++ a/fs/dquot.c
@@ -834,6 +834,9 @@ static void print_warning(struct dquot *
 	if (!need_print_warning(dquot) || (flag && test_and_set_bit(flag, &dquot->dq_flags)))
 		return;
 
+	mutex_lock(&tty_mutex);
+	if (!current->signal->tty)
+		goto out_lock;
 	tty_write_message(current->signal->tty, dquot->dq_sb->s_id);
 	if (warntype == ISOFTWARN || warntype == BSOFTWARN)
 		tty_write_message(current->signal->tty, ": warning, ");
@@ -861,6 +864,8 @@ static void print_warning(struct dquot *
 			break;
 	}
 	tty_write_message(current->signal->tty, msg);
+out_lock:
+	mutex_unlock(&tty_mutex);
 }
 
 static inline void flush_warnings(struct dquot **dquots, char *warntype)
_

Patches currently in -mm which might be from jack@xxxxxxx are

dquot-add-proper-locking-when-using-current-signal-tty.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux