From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753622AbbFVE6L (ORCPT ); Mon, 22 Jun 2015 00:58:11 -0400 Received: from smtprelay0193.hostedemail.com ([216.40.44.193]:48519 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751484AbbFVE6G (ORCPT ); Mon, 22 Jun 2015 00:58:06 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::,RULES_HIT:41:355:379:541:599:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1539:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3870:3871:4321:5007:6261:7903:8603:8957:10004:10400:10848:11026:11232:11658:11914:12043:12438:12517:12519:12740:13069:13311:13357:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: worm99_c474561a5f2d X-Filterd-Recvd-Size: 1710 Message-ID: <1434949083.9808.8.camel@perches.com> Subject: Re: [PATCH v2] hexdump: fix for non-aligned buffers From: Joe Perches To: Horacio Mijail =?ISO-8859-1?Q?Ant=F3n?= Quiles Cc: Andrew Morton , Andy Shevchenko , David Howells , Vivek Goyal , linux-kernel@vger.kernel.org, trivial@kernel.org Date: Sun, 21 Jun 2015 21:58:03 -0700 In-Reply-To: <20150621234234.GA24689@mija-VirtualBox> References: <20150621234234.GA24689@mija-VirtualBox> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.11-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2015-06-22 at 01:42 +0200, =?UTF-8?q?Horacio=20Mijail=20Ant=C3=B3n=20Quiles?= wrote: > An hexdump with a buf not aligned to the groupsize causes > non-naturally-aligned memory accesses. This was causing a kernel panic on > the processor BlackFin BF527, when such an unaligned buffer was fed by the > function ubifs_scanned_corruption in fs/ubifs/scan.c . [] > diff --git a/lib/hexdump.c b/lib/hexdump.c [] > @@ -123,6 +123,11 @@ int hex_dump_to_buffer(const void *buf, size_t len, int rowsize, int groupsize, > groupsize = 1; > if ((len % groupsize) != 0) /* no mixed size output */ > groupsize = 1; > + > + /* fall back to 1-byte groups if buf is not aligned to groupsize*/ Please add a space before the "*/" -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/