Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1488271lqp; Mon, 15 Apr 2024 07:58:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVC7H+IxTiETgPYx8mT5BAgw63FVfpppd1+rrHQFpWtkuXuNsT7z06i2icAJ/h7F8jS75F6EvNk5BUxG35fOL4uBFYa9t/s12MIGqpZfg== X-Google-Smtp-Source: AGHT+IFsTA71eq8WMdjoTGRwLGHWn38MiP2fEjn8W1niHXVxjo/RvLwSpoT5pKEJi+mejzm9rWQ1 X-Received: by 2002:a17:902:a50d:b0:1dd:5f85:118c with SMTP id s13-20020a170902a50d00b001dd5f85118cmr8519284plq.62.1713193092229; Mon, 15 Apr 2024 07:58:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713193092; cv=pass; d=google.com; s=arc-20160816; b=IxFENTQ+8ANGoV+KA+mrfX/3eNHAxkST//EqEFxNrnAhPTzKmt2UK6tBA9Y4rcxjHk vhGBy/gx5FgPdIg9qRMsk8r/i5UKMR0cOmlN2bbQ8ewyRiRkLMuMRQO1cap+6qX22OG1 XcJ86nsmtvg5EgwcGyX3rrcmafPBvWBwpIhZLvm/RBnV5hW9FrQuVUp2x5satA2lbFQz jmunNqzIkivih5zem9D8k93DrVlY+dSkArLuPQ14CyVdPsnu0c0io89Gve6ToT/b1dfL HCzZJofuPOH+rEmyB6TCwzRgVWKY1LWVpMTI5CLt8nugfRdesg1pJYW2XyKDnnB46gGV XRQg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=doatgCkp4QpvYF7S0Kze7TiNN5VDcuPhSAFHmXBg71Y=; fh=1liEDBrk8thi+IuPXcyJjsJNbkm2Wfa4ndXUiIpy/g4=; b=XYWtBCC/TOQ9PDbbHwsbL0+uMaQsTLRHvlP8G4rPzI0Zqfy0WgGK6B+dYlt0n+pnbI ilPXgtqeHJx25sM0pnNeEPsf+MMkAAXTHLzsJtHK4xvAdpSd+ncI8Y+qI3XSuQZalVok zG3dBlZ8aQXm8cbCBdwvzEG3ZOXeBsMALQHhcsyKLQVCLYCM9gC3JK7GnOp75WTpOajh p62ahtxArUHSEtbo+BtzoSK/0ZuYchhTjnRi7vxGpIaGYyglK+2XAgP+cRKiv/i87s1w gAV10P+ouvMwEl+yvbav+TTQ9C+zwPtyWpAPLmD/RXugI4a7CFSKopViqjjxff6Uh8hG esYg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iSWogZAC; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-145386-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145386-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id s12-20020a170902a50c00b001e3e52abe0asi7693422plq.149.2024.04.15.07.58.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 07:58:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145386-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=iSWogZAC; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-145386-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145386-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B10FCB23269 for ; Mon, 15 Apr 2024 14:49:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ADFCD71B3B; Mon, 15 Apr 2024 14:49:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iSWogZAC" Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (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 6A1DC2119 for ; Mon, 15 Apr 2024 14:49:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713192548; cv=none; b=KBI8tcsogfbUvwlavJVa5zfNAjm+3O2D7e53JyZclZg/bDiY6mPbOdNPhIcMO1npLIdkQuFSZ6FfSLPa8oZvGSxrlXzhtYndi03gkrk6+dspg9yfLwyJ7n6Dr6VjQ6J5A9D1KVoe76R1hEJgUzxPv+AM7nwzv7/5b52fgfWfHps= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713192548; c=relaxed/simple; bh=fBKUtpe6WJlYrr2+zWFLvMQ3icE3ciafglrtrTmdNhc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=pgM00tUBp9Oi6dVBwdqrM9cOOd70WtKawV/Kh1sZMwrAdG/xnc7qV1s4clIchOBS+KlSiwY5MFGvFYHx9aiPnPX7/m/XrQSJlpCiXiJoz0Qhu/tJWj/GlEcZSQtdXwZUKlSD0/vQyWNWkIW2ezhy67uwzS4YN3A6HH842fhIFtw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iSWogZAC; arc=none smtp.client-ip=209.85.167.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f45.google.com with SMTP id 2adb3069b0e04-516d1c8dc79so4229698e87.1 for ; Mon, 15 Apr 2024 07:49:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713192545; x=1713797345; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=doatgCkp4QpvYF7S0Kze7TiNN5VDcuPhSAFHmXBg71Y=; b=iSWogZACYR3sxVsTDMRBQY8pCEd7FdNTzc5dq5CCC8HadjEIALsi0Al7CSIXH89G3V zAOx/XCGcwJY3m9bgoFBx9CUb9ZgOx7Y5HBgUQLtgHYB4wO9jC8fyUWOgHA7o+0XolvS g+zR3y/AiA92djvkKdm8ohrxfc/IZFy9ViPbFnobZR0+I4lIKMevrEG6f3914Y7HaKlk sI3H6zlwlQlQHt7uOsUlhadXSDAo5VnhTaaiuCxCfyxxp+k8axEYxMTK/w12Txy6Qh09 eh0bhqId1OuRLbPo58D2gDiC8HbpoziB8f6w70CpM2Vte0omeDDReyR5u+ZdEJs4OoW5 W8iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713192545; x=1713797345; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=doatgCkp4QpvYF7S0Kze7TiNN5VDcuPhSAFHmXBg71Y=; b=nnJOBwC7uugJNy0+lzIGhGC1kOdRHFpB3csrzRkR4/gYReqfzCKTWfdsWCIOxTtJ3s VZAXcFNSRIAUyxHgfXTPweOUnfhlrBpe2vCB9CnWROiFtXYWGtvd5BInsm7P1hZz4ewp RUaoj9jhPW9w1QG0PJUVVrqbCNDrGHYyoAVDW5h+YaBIfgom9B3CohaImlT/0vZBEoGP O8omp4FAtsCYhVkqsjG8DtZgSV1dtp0dUJJboAaCB+UQG7lkW9TC7X/cDffRjJxGGiJ2 R0ze93p+ijkLagqYM1md6EP/cV4b/DxeWp76F7OGI2ejEYy7rThfHGogSPS9cU0hMlrP pdww== X-Forwarded-Encrypted: i=1; AJvYcCVSjatJsSsH9jVeArRvu68qBXdM2rlI3Pn4e6YlRROFsQbiTxUIi4ztn+HF0udnN6E9RYC4GtmIyqq7zNog7andKYzJgLgLh1eEzDLz X-Gm-Message-State: AOJu0YyiUs9fLGkKlSCrDI9mki5pThiuylKSJlCffdpXbu0l5iFyvzgU FfniIlYajkGUtUPf8pC0IgcpWsBRWTR5jF+lt+Sv1hJZSGxIvclQSJdjL3l550azyB/Gfe4WZyP Po4ENqO1bKOYfBuKi5ocQMQ5mwws= X-Received: by 2002:a05:6512:2e8:b0:518:9ce0:e623 with SMTP id m8-20020a05651202e800b005189ce0e623mr4883704lfq.2.1713192545274; Mon, 15 Apr 2024 07:49:05 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <000000000000209c9506161fd1d4@google.com> <20240415132828.149954-1-aha310510@gmail.com> In-Reply-To: <20240415132828.149954-1-aha310510@gmail.com> From: Ryusuke Konishi Date: Mon, 15 Apr 2024 23:48:48 +0900 Message-ID: Subject: Re: [syzbot] [nilfs?] UBSAN: array-index-out-of-bounds in nilfs_add_link To: Jeongjun Park Cc: syzbot+2e22057de05b9f3b30d8@syzkaller.appspotmail.com, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Apr 15, 2024 at 10:37=E2=80=AFPM Jeongjun Park wrote: > > please test array-index-out-of-bounds in nilfs_add_link > > #syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.= git 0bbac3facb5d > > diff --git a/fs/nilfs2/dir.c b/fs/nilfs2/dir.c > index bc846b904b68..aee40db7a036 100644 > --- a/fs/nilfs2/dir.c > +++ b/fs/nilfs2/dir.c > @@ -240,7 +240,7 @@ nilfs_filetype_table[NILFS_FT_MAX] =3D { > > #define S_SHIFT 12 > static unsigned char > -nilfs_type_by_mode[S_IFMT >> S_SHIFT] =3D { > +nilfs_type_by_mode[(S_IFMT >> S_SHIFT) + 1] =3D { > [S_IFREG >> S_SHIFT] =3D NILFS_FT_REG_FILE, > [S_IFDIR >> S_SHIFT] =3D NILFS_FT_DIR, > [S_IFCHR >> S_SHIFT] =3D NILFS_FT_CHRDEV, > -- > I found this patch of yours while debugging. This patch looks correct as a fix for the issue. In fact, I verified using the reproducer that it fixes the issue. Is it okay to understand that you will finish it and send it to me? If so, I'll take it and send it upstream after thorough testing. Regards, Ryusuke Konishi