From patchwork Fri Oct 16 09:07:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 290312 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74D78C43457 for ; Fri, 16 Oct 2020 09:07:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 20BC220878 for ; Fri, 16 Oct 2020 09:07:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839270; bh=D5hUL4SWsMlrsqXDEX491/eYSiPleStMN00z+BVSyTU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=pt7fHa8BCrfqkIYaBBr7VfBCAhVVpJ3SxPszYAeBCF/SMcJmzh6arZC41A6LD2bQm +d8byvdKY+F3BE0BFck+5BMdsUt/yOTnHILE2veWDSoy6oqdDv6wl3t+kIf5oFjxKx OTNkkS2+pJ9oO9AUnMgilxf7/oFYVrHKkLG/J4dg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394392AbgJPJHt (ORCPT ); Fri, 16 Oct 2020 05:07:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:36056 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394904AbgJPJHo (ORCPT ); Fri, 16 Oct 2020 05:07:44 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1550B20789; Fri, 16 Oct 2020 09:07:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602839263; bh=D5hUL4SWsMlrsqXDEX491/eYSiPleStMN00z+BVSyTU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VQLsdFyKNsQyV2DxuNS3soNwTNyTqV3d8eJLCt8w9xxGF3MDo3Yf5D6CNQoJDOcHN IymdcxE+Q5XI6zWXh02AtmU0SLL42+VAXyE4giMQElOSFOZKWwv3wm6tuKoB0Tsmr6 khngWMQ44cUfAyiAeSVvqI1Ts2sGlUl+8Cf1JXiM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, syzbot+d94d02749498bb7bab4b@syzkaller.appspotmail.com, Jan Kara Subject: [PATCH 4.9 14/16] reiserfs: Initialize inode keys properly Date: Fri, 16 Oct 2020 11:07:18 +0200 Message-Id: <20201016090437.917062205@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201016090437.205626543@linuxfoundation.org> References: <20201016090437.205626543@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Jan Kara commit 4443390e08d34d5771ab444f601cf71b3c9634a4 upstream. reiserfs_read_locked_inode() didn't initialize key length properly. Use _make_cpu_key() macro for key initialization so that all key member are properly initialized. CC: stable@vger.kernel.org Reported-by: syzbot+d94d02749498bb7bab4b@syzkaller.appspotmail.com Signed-off-by: Jan Kara Signed-off-by: Greg Kroah-Hartman --- fs/reiserfs/inode.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c @@ -1554,11 +1554,7 @@ void reiserfs_read_locked_inode(struct i * set version 1, version 2 could be used too, because stat data * key is the same in both versions */ - key.version = KEY_FORMAT_3_5; - key.on_disk_key.k_dir_id = dirino; - key.on_disk_key.k_objectid = inode->i_ino; - key.on_disk_key.k_offset = 0; - key.on_disk_key.k_type = 0; + _make_cpu_key(&key, KEY_FORMAT_3_5, dirino, inode->i_ino, 0, 0, 3); /* look for the object's stat data */ retval = search_item(inode->i_sb, &key, &path_to_sd);