From patchwork Wed Sep 2 13:17:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Landley X-Patchwork-Id: 7111801 Return-Path: X-Original-To: patchwork-v9fs-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 88BB99F32B for ; Wed, 2 Sep 2015 13:43:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A375B20397 for ; Wed, 2 Sep 2015 13:43:40 +0000 (UTC) Received: from lists.sourceforge.net (lists.sourceforge.net [216.34.181.88]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 688002035E for ; Wed, 2 Sep 2015 13:43:39 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZX8K4-0000dJ-I9; Wed, 02 Sep 2015 13:43:32 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ZX8K2-0000d7-TR for v9fs-developer@lists.sourceforge.net; Wed, 02 Sep 2015 13:43:30 +0000 X-ACL-Warn: Received: from mail-ob0-f174.google.com ([209.85.214.174]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1ZX8K1-0004XH-M9 for v9fs-developer@lists.sourceforge.net; Wed, 02 Sep 2015 13:43:30 +0000 Received: by obbbh8 with SMTP id bh8so8097306obb.0 for ; Wed, 02 Sep 2015 06:43:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-type:content-transfer-encoding; bh=9PypoNAbx9NnNpNE51hkQkci9Ux7YhVaHY9kiZfHzCU=; b=cJymKCRVx2MM4JReSZ7EI2/IpguDfdmXMi3/vjb/LndUT9ohIOuX6GINjQ/VYEi2JF hSo/8O8V0dzV95gLc1sFw+p+H0jHVr0hDU3SRDjxdLgAw26cTjK4bVyttEOVXNISYbM4 6WuhhO8W0h7Bt2trx7KnYFVqiDgF+X/rHrHWm7IrnS9PguNvqijnfsJIVax4ZyCrWrcv HtJQaBkGJ6tXMUzIB7l65uQG+wd4f3WY35dh26PQZzmAndRhOwvnNeaUBxKILbtqtWUv 5yzBnPGU0K0G7h5ZLV6Bq9G5gGLtPvkFM63tkn+UwoEy+3QuOKC2GYhfrX/RYoevN/xC 4Pxw== X-Gm-Message-State: ALoCoQnJh9vGvjxn+d2IJ2URbMb233SS1aqn6DW6bM4sdj9ea2jh61wAzESaRowKZXzkRiZ4Z+38 X-Received: by 10.182.105.231 with SMTP id gp7mr4569462obb.81.1441199851855; Wed, 02 Sep 2015 06:17:31 -0700 (PDT) Received: from [10.0.2.15] (cpe-72-182-52-210.austin.res.rr.com. [72.182.52.210]) by smtp.googlemail.com with ESMTPSA id x142sm2734831oix.0.2015.09.02.06.17.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Sep 2015 06:17:30 -0700 (PDT) To: V9FS Developers From: Rob Landley Message-ID: <55E6F6E9.20409@landley.net> Date: Wed, 2 Sep 2015 08:17:29 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 X-Spam-Score: 0.0 (/) X-Headers-End: 1ZX8K1-0004XH-M9 Subject: [V9fs-developer] [PATCH] v9fs unaligned access. X-BeenThere: v9fs-developer@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: v9fs-developer-bounces@lists.sourceforge.net X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rob Landley The v9fs driver code was making an unaligned read. Signed-off-by: Rob Landley --- net/9p/trans_fd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Heads up, not sure this is the right fix for sparse's tag checking? ------------------------------------------------------------------------------ Monitor Your Dynamic Infrastructure at Any Scale With Datadog! Get real-time metrics from all of your servers, apps and tools in one place. SourceForge users - Click here to start your Free Trial of Datadog now! http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140 diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c index bced8c0..09ec72c 100644 --- a/net/9p/trans_fd.c +++ b/net/9p/trans_fd.c @@ -340,7 +340,8 @@ static void p9_read_work(struct work_struct *work) goto error; } - tag = le16_to_cpu(*(__le16 *) (m->rbuf+5)); /* read tag */ + memcpy(tag, m->rbuf+5, sizeof(tag)); /* read tag, unaligned */ + tag = le16_to_cpu(*(__le16 *)tag); p9_debug(P9_DEBUG_TRANS, "mux %p pkt: size: %d bytes tag: %d\n", m, n, tag);