From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1Yf9yr-0001XC-Rv for mharc-grub-devel@gnu.org; Mon, 06 Apr 2015 12:34:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yf9yp-0001WL-Al for grub-devel@gnu.org; Mon, 06 Apr 2015 12:34:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yf9ym-0006RB-1S for grub-devel@gnu.org; Mon, 06 Apr 2015 12:34:31 -0400 Received: from mail-la0-x232.google.com ([2a00:1450:4010:c03::232]:35956) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yf9yl-0006PE-Pw for grub-devel@gnu.org; Mon, 06 Apr 2015 12:34:27 -0400 Received: by lagv1 with SMTP id v1so23368588lag.3 for ; Mon, 06 Apr 2015 09:34:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=x9A0yBplg8GeutAEWH2bEQgitZ5mPKkgUXAEhzoIPwQ=; b=KS35cOPLamqpfq31jMgJoJtnbaGLfM9FEoSbEBkBbvhTYV9SVek3KJPnFrp8k9+hEK uANXZg2RpWnA9sFf3m6GkFAZvNs99Nua4sdgNnQsFAFnXPzBUsVF4unoYbIfP1jgEMg8 Jic4hJfh04Bo4GknDWjYqUyE0rnwIK0/lXBM/+1/gNCm20d8A0yZlQ4pXJhpc80JCg8W 6DH4HmtZRwdjiuTtaN9S5mnDAQWJGd+nHW2r0a+D+nNWWSlMQqFv7eSSsQo069eGJiOg Y0BB8ff2nEtKKyRjSW4ZgS3enyVTb4dRSaeaTYI2RrP6KU8zW7wB6i1HTS4u+6eW0Quv zmvg== X-Received: by 10.112.13.7 with SMTP id d7mr14378832lbc.79.1428338066277; Mon, 06 Apr 2015 09:34:26 -0700 (PDT) Received: from opensuse.site (ppp91-76-14-38.pppoe.mtu-net.ru. [91.76.14.38]) by mx.google.com with ESMTPSA id h3sm1108243lbj.19.2015.04.06.09.34.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Apr 2015 09:34:24 -0700 (PDT) Date: Mon, 6 Apr 2015 19:34:23 +0300 From: Andrei Borzenkov To: Michael Zimmermann Subject: Re: Division Bugs Message-ID: <20150406193423.6efdca20@opensuse.site> In-Reply-To: References: X-Mailer: Claws Mail 3.11.0 (GTK+ 2.24.25; x86_64-suse-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::232 Cc: The development of GNU GRUB X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2015 16:34:32 -0000 =D0=92 Sat, 4 Apr 2015 22:49:28 +0200 Michael Zimmermann =D0=BF=D0=B8=D1=88=D0=B5=D1= =82: > I think I found a bug but I'm not sure. >=20 > http://git.savannah.gnu.org/gitweb/?p=3Dgrub.git;a=3Dblob;f=3Dgrub-core/l= ib/division.c;h=3D920a79f18b7a7180bc5bcf18987c043b1df56687;hb=3Drefs/heads/= master#l53 > at line 53 u write a value to ro: > *ro =3D r; >=20 > now take a look at the callers: > http://git.savannah.gnu.org/gitweb/?p=3Dgrub.git;a=3Dblob;f=3Dgrub-core/k= ern/compiler-rt.c;h=3Dd4cc15513aabea3061bd2dddc896b105bb180a5b;hb=3Drefs/he= ads/master >=20 > some look like this which should be ok: > grub_divmod64s (a, b, &ret); >=20 > but there are others like this: > grub_divmod64s (a, b, 0); >=20 > I got a "data abort, translation fault on write" exception after > compiling a lib which uses that division function. >=20 Fixed. Unfortunately there does not appear any easy way to regression test it. Dereferencing 0x0 pointer does not trigger an error, unless you setup address mapping appropriately. Thank you for report!