From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f195.google.com (mail-pf1-f195.google.com [209.85.210.195]) (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 D66B62264CF for ; Wed, 28 Jan 2026 02:42:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769568141; cv=none; b=p4M9LxX1GBELfJL/wAcmGQQz/+7aZNbNHXBXHXsPtlbFL6XWknIg3VZO4rsjQhRYHJE8ZUFy1rL++p3GcBM5vmotWHDWuN6SKbFzeH1njYuSiHMxs6gMRb59Q02iPknxWhPlEQVtNfQLqvfq5IarYhjGJALp9pUBTNQJnrq9etI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769568141; c=relaxed/simple; bh=ySUVuUZdbvYFfY4FgYdpkObwkXmUBZX+j+38Y6EqrJU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=F6dyiniY850DbBAn1E8P0XAB2aCxCMmgDQNDpOh5UhCtZioKFL/+LDw1HyYLdpYVneZU+4wbMmzyakLFMfaJ5sXw68orDvVpk03oyqaU3sb3vNoXnp0CbCNYboxQc7mQWTjO98NM05k/Uw0Z+BammEVgWjLr2oQsdiwqneRgRXA= 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=fBgftnZ7; arc=none smtp.client-ip=209.85.210.195 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fBgftnZ7" Received: by mail-pf1-f195.google.com with SMTP id d2e1a72fcca58-82318b640beso2684453b3a.0 for ; Tue, 27 Jan 2026 18:42:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769568139; x=1770172939; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=QEZMQLfdyPYKzhiqnkvYGZfQ0QlObO2jzAVYfO/9mvE=; b=fBgftnZ7ntOEThv5RpetTH/31HW1G3h7GfBLJXacJuaf5FS2C/x2kNdLbudVge+cQp egM/YLXzTZJLqdKRs9KqqdVcaXdg8/Jw/soWKSlLNcs8uyNM0D7q47ccjdm5MAsUufuE I2aI5s62Uf9U4RyMGJ4VOII1REkw+/946M8gzccRKsZyr0ckoegQL/9jJIBhMLA1/JIp xN/fDjC/fzYk/iT43+vOEcgtj8UzGHNTiQLCpurToDwPJ9ElvLyANROr9boKB03h/ouS 8XXHx2yvhoMjefUQLlYnhxXtu6hmV7il2eNeA7/DJQxtUJmVjjh4DH0TxjA4jDWoNDQ2 lCtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769568139; x=1770172939; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=QEZMQLfdyPYKzhiqnkvYGZfQ0QlObO2jzAVYfO/9mvE=; b=H6pfeTwLQDZBFYMjJ6689i9kbDSjHgbXVmn0jt2202NyhUH0WK17KKqW1v4a/8Czv4 mGIj1bmA7L+CpgZas/iNVJWGzb65yIHCR7P1SLNl6HBSPj/lmtah4soPX8zZWu0YTnUz dDZ7OCL4C4INoK35eAghuWU46sWpJ67o3JppnXYUp5ILw8Q0jfSmhRJ7ie8YzonMe+ZM D3+km+UQRJYessO2xIYIsKw4DsHsTQ7xG5Dqy8kub+uNh1sIp6AtWRMBFmevK0QWYnFn tGcntCvS15jHcBDNvQdeJdIgrz+sxOFm8p/MkeL33xaV3CLvJelenpryisXeQZBiY+Wh Sc/A== X-Forwarded-Encrypted: i=1; AJvYcCXbllwfc2hSS3Zd7sQzX51CTR0GXryFEeNpcLLs6mIGl9GzMhwn6lydJgbtHkSA9rhsfPxZoKvTxpsJNDY=@vger.kernel.org X-Gm-Message-State: AOJu0Yz8L9XYtJXsXad4iVFNbAkNZ+9zWvvDSrE7Cq6p1Ju8TevlJYa8 iQeYzuGE19iMsrIMBbLczrEK9lVuVIL8eHIMSOSKOEq3SKEGZ+3KVppE X-Gm-Gg: AZuq6aKQAj7laR/qohZEOf5uhAzV/nnt2e1zs/4d87sNZSMYUPPVY3U25egjSe7Z+Sn oxeM8HbWItrrc2f/sl8vJX4MrQ4kNPOXob59uFTNVoDhC0TXdY2E1+Z7DVwAoeowxe5ntKNK7yH X9HwXAtaV3CHQ7x/4t9Vz63Eml77CRk+/xhNU98Shh19XnaswiOscaHmo74tsdC6RW2Uds5Vgq9 qnyEX7WOUcQCraojqCSZ0oJ5gyggSEkGts/TAuGT20kE+Jhcz9i8NVjw3hdDFEd7Iy2uYEkwjeE 6mkAobBtIT0AaPipH9pUY12HvjbZk6td5+w8Q/3R+k9jSH7b3Opxp2z8j2v/RM8yX5Oc5nrCiTO NDTBC1PpRC852g999Ad1eNP63FZYau3dj6MQnElssRWkEPRza+Hfdh+s2jJNaMHVSpank58P4s0 P/FPcOCM+2iUT8qg/8qMKm3r1XzQ8JZnaV+bYhzw== X-Received: by 2002:a05:6a00:4b01:b0:823:edf:9811 with SMTP id d2e1a72fcca58-823691738a2mr3517068b3a.18.1769568139083; Tue, 27 Jan 2026 18:42:19 -0800 (PST) Received: from lima-ubuntu.hz.ali.com ([47.246.98.220]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-82379bfd8desm869487b3a.33.2026.01.27.18.42.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jan 2026 18:42:18 -0800 (PST) From: Qing Wang To: miklos@szeredi.hu Cc: amir73il@gmail.com, linux-kernel@vger.kernel.org, linux-unionfs@vger.kernel.org, syzbot+d130f98b2c265fae5297@syzkaller.appspotmail.com, wangqing7171@gmail.com Subject: Re: [PATCH v2] ovl: Fix uninit-value in ovl_fill_real Date: Wed, 28 Jan 2026 10:42:12 +0800 Message-Id: <20260128024212.1818250-1-wangqing7171@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Tue, 27 Jan 2026 at 19:19, Miklos Szeredi wrote: > diff --git a/fs/overlayfs/readdir.c b/fs/overlayfs/readdir.c > index 160960bb0ad0..9ea3cd11dd93 100644 > --- a/fs/overlayfs/readdir.c > +++ b/fs/overlayfs/readdir.c > @@ -755,7 +755,7 @@ static bool ovl_fill_real(struct dir_context *ctx, const char *name, > struct dir_context *orig_ctx = rdt->orig_ctx; > bool res; > > - if (rdt->parent_ino && strcmp(name, "..") == 0) { > + if (rdt->parent_ino && namelen == 2 && !strncmp(name, "..", namelen)) { > > Yeah, and also the str... functions only make sense on null terminated > strings, so that needs to be memcmp. Thanks for your idea, but I think strncmp is same as memncmp in this case. strncmp dons't use null terminated. ``` int strncmp(const char *cs, const char *ct, size_t count) { unsigned char c1, c2; while (count) { c1 = *cs++; c2 = *ct++; if (c1 != c2) return c1 < c2 ? -1 : 1; if (!c1) break; count--; } return 0; } ``` What do you think? -- Best Regards, Qing