Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1569906rdb; Wed, 20 Sep 2023 12:57:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHL+fOiefuVPSy8rSJ9rh7DVWdJmmlcz8PoZHqkBlmjQ/GPYJARuQ7pLW8NysfKZMQBxaC3 X-Received: by 2002:a17:902:b60f:b0:1bb:2020:be0d with SMTP id b15-20020a170902b60f00b001bb2020be0dmr3202077pls.14.1695239823117; Wed, 20 Sep 2023 12:57:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695239823; cv=none; d=google.com; s=arc-20160816; b=z0txl0oCt8ck7H0HlEoXccHUOET2SMvrJoDYMa/EVerfSmqfg6yk6e11r+Ovnt6X5u TaG+y2YHYcQjvWDYPnzz0GisJz/bf9WbTHrmY/UhQiACTkif2KqenIjZRd1DsdjpI66M gz35NGFAaQ6GEd4SDxDvolwcH2JcpjxKUU8U9wlr6nb9miWzz/2BQf+osC284NbwwD9w Hn7ZTDA3NDljsS/NWb35d12m2ZiXsfHym1o7nWIBqhn3SZQh7qEKWJmfqclnRcJVdPej ilpboMyYbUwrM48YMB3otRNtzcEw8KSBRQlaeAXbkOQ6bTaxWxA1vBooP0HpIz6GrJtA Y//g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=87prIpqQdSFKVlquqMGwIZaVLjZNXmiriU75j9GqehE=; fh=8es6UaqXRQaQuCJD5bxqh93CIQkkpVc56ITyEyTPaiA=; b=ccE5YC6Wf+oWvDgoCn7SRXiCKewHbWY3nKv7spud210fCFzUvcGHfYcA6nZTxs6xDP 7QS2Z+dpPNKaswAhqevRry/Dk2jC9W95vQR7+9h2AMF1BX5jCK2Qpj8ZhTSrGHcYE4mH pprc+/ZiafNnsgAnWcT7LTFHA8YIUz7YVia407x3AUBTGk7SFtZeYB2EDa8DyhvIly5q 2C4mVnFawMdvumZCAJdfZrAEdExjoK/CM8vdzo+ROG6yQdctRIwogMtAMUPhd8sGjqWO I3ZzRQnwY14emWfMgDpVBCoaXS3XNYj+yTCAPo4FBFeg08mDRj3G8d4C0+2Gew4l3Uxp 97gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kzHGRB9Q; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id z16-20020a170902d55000b001bf095dfb7asi12649667plf.231.2023.09.20.12.57.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 12:57:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kzHGRB9Q; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 5B70581DA3A6; Wed, 20 Sep 2023 12:37:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229697AbjITThP (ORCPT + 99 others); Wed, 20 Sep 2023 15:37:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbjITThO (ORCPT ); Wed, 20 Sep 2023 15:37:14 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 921E6A3; Wed, 20 Sep 2023 12:37:08 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E12EDC433C8; Wed, 20 Sep 2023 19:37:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695238628; bh=j+jorpIRAaPJFNymaByLkAEIB8117cyMKfFxgXZxHg0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kzHGRB9Q2kuEWQekIKGrHPr7rq9bDr3IyHKuXrus3e6FwWDk86aIxcYtCXO4dgEHp bkPMLHdRNyA+iS+7YyeZpl/eyxV1BS6NT48opo88Ef22lGi9H+QH6sNvAm5U7KvlNn fmHNCDgLt5Wve77qO+Ket2cwCQzm9c9gIuwecSgk536B+J4sVyipeE/qM82OU1f9jt wkSCIfzLmngLK7+MLboCQ4vb7MLVnVeH77juYG9Bm9rcLyvm0LTi03e73/P77mB8Xh Jg7WioU7Tx7khon8lhq7Ey390ZFsx3gbJoU6whL43CQMPu1ex8MDgwGdLq88vcISmU vyDJlq03S496A== Date: Wed, 20 Sep 2023 12:37:06 -0700 From: Eric Biggers To: Edward AD Cc: syzbot+9cf75dc581fb4307d6dd@syzkaller.appspotmail.com, adilger.kernel@dilger.ca, krisman@collabora.com, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, tytso@mit.edu Subject: Re: [PATCH] unicode: add s_encoding null ptr check in utf8ncursor Message-ID: <20230920193706.GB914@sol.localdomain> References: <0000000000001f0b970605c39a7e@google.com> <20230920112015.829124-2-twuufnxlz@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230920112015.829124-2-twuufnxlz@gmail.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 20 Sep 2023 12:37:11 -0700 (PDT) On Wed, Sep 20, 2023 at 07:20:16PM +0800, Edward AD wrote: > When init struct utf8cursor *u8c in utf8ncursor(), we need check um is > valid. > > Reported-and-tested-by: syzbot+9cf75dc581fb4307d6dd@syzkaller.appspotmail.com > Fixes: b81427939590 ("ext4: remove redundant checks of s_encoding") > Signed-off-by: Edward AD > --- > fs/unicode/utf8-norm.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/fs/unicode/utf8-norm.c b/fs/unicode/utf8-norm.c > index 768f8ab448b8..906b639b2f38 100644 > --- a/fs/unicode/utf8-norm.c > +++ b/fs/unicode/utf8-norm.c > @@ -422,6 +422,10 @@ int utf8ncursor(struct utf8cursor *u8c, const struct unicode_map *um, > { > if (!s) > return -1; > + > + if (IS_ERR_OR_NULL(um)) > + return -1; > + > u8c->um = um; > u8c->n = n; > u8c->s = s; > -- See https://lore.kernel.org/linux-fsdevel/20230920073659.GC2739@sol.localdomain/ - Eric