From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-il1-f199.google.com (mail-il1-f199.google.com [209.85.166.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDA8C2AE96 for ; Fri, 20 Dec 2024 11:28:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734694137; cv=none; b=gQyVJtVJpowz3H9ocRIxxSIHE97rdQ7L4m43P21DrNeAdGteD88BQY6kVinqfTOMsF7dOZps2UWiTrqkah8Fjf5miUhvsfOC5flfDOTllho9Sm/pUM6yV4vXaXACgEVjtZ+UI2xli1kulreNhtSFJSCjUIWiuplGl+PPmyatYwg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734694137; c=relaxed/simple; bh=o5ijXmEHDZTY4hB6hUko+D9ox8cxxwsqqibIeWvW//c=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=MwowcFvSL5rWWZRoOz6rKal8l0VEEY3yuFFG0NoT3CHtMdgMniy8hp+5aySWLBiVPhayI0VF1tJGyADg2389jbiKdr31S7LENLCVQQvvk+urhN0M+zDLX2gSM1XvZ6FNTtnyxvOT61M20Ur/vBJxPHR90iV61YZbkbKdIKN11Hk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.166.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-il1-f199.google.com with SMTP id e9e14a558f8ab-3a91a13f63fso16178945ab.3 for ; Fri, 20 Dec 2024 03:28:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734694135; x=1735298935; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UnpEebS4pSIjVxxjKdEGNGN0nNRImmW9XhmjXBsGWPk=; b=gSYuyYcjBTl0TfSmxb2MSC7CPnH74wTfl4JQj/XPG7h314fDaHrWMtF/jgc9UjGJah /jK+pnneRkhnKiTnPzr8X8l9uwSzJuyKwSgtdSV9k8SEH+YS7nKb9pD7BX5Jb2/uWozD 6PmHPzo9ZhSbzLrM8V1pVLx2g5gxHx8uO18j0GZ9RNeuxSujOOkxJWRInyi9PDsnG2PX yEY5ZnUBzAAubb+h6xTkXd2RUo00zha6vaTcWJX/Dlwh1E9bJ4J4VB1VPPUQQuel48Xm 4kTkqJUwR+5jMw5+ME1lh+N8K2wIwYcSuTrrhrjAj0XG1NF4Q7tsqHCx1u1xNoLJ0Vkv 2bxQ== X-Gm-Message-State: AOJu0YylLv9XN29riJsvTDpHkZf174Nlx9PXtA1Nd0chnTYaZ3T0LOI3 hwhUXUr0qKjL4dfDlpemMbc3FdtcpF6qphvBwtlnrFBKMT4J0TloAQotopqDmyiD+rzkRDy13pU DCDyfwx5r34UKFDdcOcp2DS2edvygyQodk5C6Sg0baKlLl99j5g355+8= X-Google-Smtp-Source: AGHT+IHcWfMlfmX4cgIivOWE0v5cFaf6zuGA2OusNFMvHTVmXsHAfVnaCtn4j4VzaAja3/vCV3ScMRvoSnfu6cr1dUtbL3lgjLCd Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6e02:3f8f:b0:3a7:a3a4:2d4b with SMTP id e9e14a558f8ab-3c2d2d4cfccmr20147725ab.14.1734694135106; Fri, 20 Dec 2024 03:28:55 -0800 (PST) Date: Fri, 20 Dec 2024 03:28:55 -0800 In-Reply-To: <6764cecc.050a0220.1bfc9e.0001.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <676554f7.050a0220.1333dc.00cf.GAE@google.com> Subject: Re: [syzbot] Re: UBSAN: array-index-out-of-bounds in inline_xattr_addr() From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: Re: UBSAN: array-index-out-of-bounds in inline_xattr_addr() Author: dmantipov@yandex.ru #syz test https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux d6ab634f1b323db6639b8b776f5d95ae747b342a diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index 282fd320bdb3..3061cf69a7fb 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -302,15 +302,7 @@ static bool sanity_check_inode(struct inode *inode, struct page *node_page) F2FS_TOTAL_EXTRA_ATTR_SIZE); return false; } - if (f2fs_sb_has_flexible_inline_xattr(sbi) && - f2fs_has_inline_xattr(inode) && - (!fi->i_inline_xattr_size || - fi->i_inline_xattr_size > MAX_INLINE_XATTR_SIZE)) { - f2fs_warn(sbi, "%s: inode (ino=%lx) has corrupted i_inline_xattr_size: %d, max: %lu", - __func__, inode->i_ino, fi->i_inline_xattr_size, - MAX_INLINE_XATTR_SIZE); - return false; - } + if (f2fs_sb_has_compression(sbi) && fi->i_flags & F2FS_COMPR_FL && F2FS_FITS_IN_INODE(ri, fi->i_extra_isize, @@ -320,6 +312,16 @@ static bool sanity_check_inode(struct inode *inode, struct page *node_page) } } + if (f2fs_sb_has_flexible_inline_xattr(sbi) && + f2fs_has_inline_xattr(inode) && + (!fi->i_inline_xattr_size || + fi->i_inline_xattr_size > MAX_INLINE_XATTR_SIZE)) { + f2fs_warn(sbi, "%s: inode (ino=%lx) has corrupted i_inline_xattr_size: %d, max: %lu", + __func__, inode->i_ino, fi->i_inline_xattr_size, + MAX_INLINE_XATTR_SIZE); + return false; + } + if (!f2fs_sb_has_extra_attr(sbi)) { if (f2fs_sb_has_project_quota(sbi)) { f2fs_warn(sbi, "%s: corrupted inode ino=%lx, wrong feature flag: %u, run fsck to fix.",