mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Al Viro <viro@parcelfarce.linux.theplanet.co.uk>
To: Vincent Pelletier <subdino2004@yahoo.fr>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Re: 2.6.10 : fs/openpromfs/inode.c : small mistakes makes module oops   when writing
Date: Wed, 5 Jan 2005 17:25:06 +0000	[thread overview]
Message-ID: <20050105172505.GJ26051@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <crh1ni$v8$1@sea.gmane.org>

On Wed, Jan 05, 2005 at 04:39:21PM +0100, Vincent Pelletier wrote:
> Hello.
> 
> Here is the patch.
> 
> Changelog:
> 	2005/01/05  Vincent Pelletier  <subdino2004@yahoo.fr>
> 	inode.c: (nodenum_read, property_read, property_write):
> 	Protected against NULL parameters. property_read: Returns 0 when
> 	called with a 0-length buffer. (property_write): Don't expect an
> 	hex list to begin with a dot.

NAK.  Patch
	a) loses needed checks
	b) adds utterly bogus ones
	c) is much bigger than it should be

All it really takes is

diff -urN RC10-bk6-base/fs/openpromfs/inode.c RC10-bk6-current/fs/openpromfs/inode.c
--- RC10-bk6-base/fs/openpromfs/inode.c	2004-10-18 17:54:07.000000000 -0400
+++ RC10-bk6-current/fs/openpromfs/inode.c	2005-01-05 12:22:08.710924933 -0500
@@ -94,8 +94,6 @@
 	openprom_property *op;
 	char buffer[64];
 	
-	if (*ppos >= 0xffffff || count >= 0xffffff)
-		return -EINVAL;
 	if (!filp->private_data) {
 		node = nodes[(u16)((long)inode->u.generic_ip)].node;
 		i = ((u32)(long)inode->u.generic_ip) >> 16;
@@ -168,6 +166,8 @@
 		op = (openprom_property *)filp->private_data;
 	if (!count || !(op->len || (op->flag & OPP_ASCIIZ)))
 		return 0;
+	if (*ppos >= 0xffffff || count >= 0xffffff)
+		return -EINVAL;
 	if (op->flag & OPP_STRINGLIST) {
 		for (k = 0, p = op->value; p < op->value + op->len; p++)
 			if (!*p)

      reply	other threads:[~2005-01-05 17:28 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-03 13:08 Vincent Pelletier
2005-01-05 15:39 ` [PATCH] " Vincent Pelletier
2005-01-05 17:25   ` Al Viro [this message]

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=20050105172505.GJ26051@parcelfarce.linux.theplanet.co.uk \
    --to=viro@parcelfarce.linux.theplanet.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=subdino2004@yahoo.fr \
    /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