All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe W Damasio <felipewd@terra.com.br>
To: Jens Axboe <axboe@suse.de>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] check copy_from_user return value in sony535
Date: Mon, 06 Oct 2003 10:53:46 -0300	[thread overview]
Message-ID: <3F8173EA.7040802@terra.com.br> (raw)

[-- Attachment #1: Type: text/plain, Size: 197 bytes --]

	Hi Jens,

	Patch against 2.6.0-test6.

	- Check the return value of copy_from_user on sony535 CDROM driver. 
Found by smatch.

	Following the local style, btw :)

	Please apply,

	Thanks.

Felipe

[-- Attachment #2: sonycd535-copy_from_user.patch --]
[-- Type: text/plain, Size: 491 bytes --]

--- linux-2.6.0-test6/drivers/cdrom/sonycd535.c.orig	2003-10-06 10:46:56.000000000 -0300
+++ linux-2.6.0-test6/drivers/cdrom/sonycd535.c	2003-10-06 10:48:20.000000000 -0300
@@ -1158,7 +1158,8 @@
 			return err;
 		spin_up_drive(status);
 		set_drive_mode(SONY535_AUDIO_DRIVE_MODE, status);
-		copy_from_user(params, (void *)arg, 6);
+		if (copy_from_user(params, (void *)arg, 6))
+			return -EFAULT;
 
 		/* The parameters are given in int, must be converted */
 		for (i = 0; i < 3; i++) {

             reply	other threads:[~2003-10-06 13:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-06 13:53 Felipe W Damasio [this message]
2003-10-06 13:52 ` [PATCH] check copy_from_user return value in sony535 Jens Axboe
     [not found] <E1A6XJm-0003Vi-00.adobriyan-mail-ru@f20.mail.ru>
2003-10-06 16:05 ` Felipe W Damasio
2003-10-06 16:10   ` Jens Axboe

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=3F8173EA.7040802@terra.com.br \
    --to=felipewd@terra.com.br \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.