All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ivan Romanov <drizt@land.ru>
To: steved@redhat.com
Cc: linux-nfs@vger.kernel.org
Subject: exportfs crash with long path
Date: Mon, 08 Oct 2012 21:07:08 +0600	[thread overview]
Message-ID: <1349708828.1183.5.camel@lix> (raw)

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

Hello. I opened a bug with nfs-utils on Redhat Bugzilla. And got an
advice to email upstream. So I just repeat my bug text with a patch.

How reproducible:
always

Steps to Reproduce:
# mkdir -p /home/kudinae/Общедоступные
# echo '/home/kudinae/Общедоступные oek-1(rw,sync,no_wdelay,no_root_squash,no_subtree_check)' > /etc/exports
# exportfs -a
Segmentation fault

I've obtained the sources. So a crush happens on export.c:293. variable
pos has negative value. I think problem into strtoint and export_hash
functions. strtoint has unsigned type and always returns positive value
but export_hash impicity cast it to signed int. So it is possible to
get negative value. I wrote patch to fix this.

Original Red Hat bug
https://bugzilla.redhat.com/show_bug.cgi?id=863054

[-- Attachment #2: nfs-utils-hash.patch --]
[-- Type: text/x-patch, Size: 333 bytes --]

diff --git a/support/export/export.c b/support/export/export.c
index 4fda30a..0257903 100644
--- a/support/export/export.c
+++ b/support/export/export.c
@@ -357,7 +357,7 @@ strtoint(char *str)
 static int 
 export_hash(char *str)
 {
-	int num = strtoint(str);
+	unsigned int num = strtoint(str);
 
 	return num % HASH_TABLE_SIZE;
 }

             reply	other threads:[~2012-10-08 15:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-08 15:07 Ivan Romanov [this message]
2012-10-10 12:28 ` exportfs crash with long path J. Bruce Fields
2012-10-15 17:13 ` Steve Dickson

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=1349708828.1183.5.camel@lix \
    --to=drizt@land.ru \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    /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.