From: Dan Carpenter <dan.carpenter@oracle.com>
To: Sage Weil <sage@inktank.com>
Cc: ceph-devel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] ceph: divide by zero bug in __validate_layout()
Date: Sat, 18 Aug 2012 15:56:38 +0000 [thread overview]
Message-ID: <20120818155638.GC22424@elgon.mountain> (raw)
If "l->stripe_unit" is zero the the mod on the next line will cause a
divide by zero bug. This comes from the copy_from_user() in
ceph_ioctl_set_layout_policy()
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c
index 8e3fb69..81ec22b 100644
--- a/fs/ceph/ioctl.c
+++ b/fs/ceph/ioctl.c
@@ -42,6 +42,7 @@ static long __validate_layout(struct ceph_mds_client *mdsc,
/* validate striping parameters */
if ((l->object_size & ~PAGE_MASK) ||
(l->stripe_unit & ~PAGE_MASK) ||
+ (l->stripe_unit = 0) ||
((unsigned)l->object_size % (unsigned)l->stripe_unit))
return -EINVAL;
next reply other threads:[~2012-08-18 15:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-18 15:56 Dan Carpenter [this message]
2012-08-20 22:33 ` [patch] ceph: divide by zero bug in __validate_layout() Sage Weil
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=20120818155638.GC22424@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=ceph-devel@vger.kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=sage@inktank.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).