From: Michal Schmidt <xschmi00@stud.feec.vutbr.cz>
To: Jens Axboe <axboe@suse.de>
Cc: Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: [PATCH] fix verify_command to allow burning more than 1 DVD
Date: Mon, 17 Jan 2005 21:34:21 +0100 [thread overview]
Message-ID: <41EC214D.6060607@stud.feec.vutbr.cz> (raw)
[-- Attachment #1: Type: text/plain, Size: 762 bytes --]
Hello,
I use K3B with growisofs to burn DVDs. After boot I can burn a DVD as a
normal user. But only the first one. When I want to burn another one,
K3B complains that it is unable to prevent media removal. Then only root
can burn DVDs.
The bug is in the kernel in the function verify_command.
When a process opens the DVD recorder with O_RDONLY and issues a command
which is marked safe_for_write, this function is supposed to just return
-EPERM and do nothing more. However, there is a bug that causes the
command to be marked as CMD_WARNED. From now on no non-privileged
process is able to issue this command even if it correctly opens the
device with O_RDWR - because the command is no longer marked as
CMD_WRITE_SAFE.
A patch is attached.
Michal
[-- Attachment #2: verify_command.patch --]
[-- Type: text/x-patch, Size: 490 bytes --]
--- linux-2.6.11-mm1/drivers/block/scsi_ioctl.c.orig 2005-01-17 20:42:40.000000000 +0100
+++ linux-2.6.11-mm1/drivers/block/scsi_ioctl.c 2005-01-17 20:43:14.000000000 +0100
@@ -197,9 +197,7 @@ static int verify_command(struct file *f
if (type & CMD_WRITE_SAFE) {
if (file->f_mode & FMODE_WRITE)
return 0;
- }
-
- if (!(type & CMD_WARNED)) {
+ } else if (!(type & CMD_WARNED)) {
cmd_type[cmd[0]] = CMD_WARNED;
printk(KERN_WARNING "scsi: unknown opcode 0x%02x\n", cmd[0]);
}
next reply other threads:[~2005-01-17 20:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-17 20:34 Michal Schmidt [this message]
2005-01-18 22:43 ` [PATCH] fix verify_command to allow burning more than 1 DVD Peter Osterlund
2005-01-19 0:44 ` Michal Schmidt
2005-01-19 7:25 ` Jens Axboe
2005-01-19 20:01 ` Dominique Simon
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=41EC214D.6060607@stud.feec.vutbr.cz \
--to=xschmi00@stud.feec.vutbr.cz \
--cc=axboe@suse.de \
--cc=linux-kernel@vger.kernel.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