From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 3974120C028 for ; Thu, 23 Jan 2025 09:42:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737625351; cv=none; b=RLc5saeqxLLgJ2oWgMLIIDvaa2zRmKCUgGNQ/rgglmSFpq0Z+ns3Z47llbKg3qVPB2Vod3awhhYhlnN+HfsUQXYRYdXK6aw9BDsbAE4pSGQSlgnBmjqGwFwpVZcyXBmZhJ9j07fIUPKJrvNPCZpxy1W1ncwRLf/fvnELbgggWS0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737625351; c=relaxed/simple; bh=AbN43EQio02aCx/f+A1BiMUBLdzBYNlO1yM4rbWJBqQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tqSXP4EmA7CmQhL+ChScNhZ5bE9iVyggUJp+IowL+PJOdtyynLAlxI2yvXl6s+1+l5t7WEqfbVQkoTriIkP0gidIaj/YsoUZgSY1RaM0CKQ3WuD0lwdaclZyTvdY6h4A8njeXzRUYAX42dIN/RocFVil0fx6sUvxg8eWiCOszJ0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=gFr0E/Tb; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=hWUFK2uB; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=M8XGhp5q; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=wkoz+YfB; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="gFr0E/Tb"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="hWUFK2uB"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="M8XGhp5q"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="wkoz+YfB" Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id E606C21175; Thu, 23 Jan 2025 09:42:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1737625347; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oiMijr+WXmjA7NWesrEJYg/tJdD6ApuM+UeKC9rUR8M=; b=gFr0E/TbrLIH8telFHPniVV5+1zjjZ5H/OEUDijy6CBAH7/OVWl/DhyxqenIVwlkIVMweD E9EoCj/+Mdr0l7p988DYIFkJIM+2FcCrsErM74bpSlHvo1f5zFTsW3XW06bN5Imo+LxHJc ixER57rLnCpobAokHBm+zN7ZwK6Ra7g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1737625347; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oiMijr+WXmjA7NWesrEJYg/tJdD6ApuM+UeKC9rUR8M=; b=hWUFK2uBrgLKRFnvkNwPE5Q+6Yjnk6RSmIdUVH3Q7FPblwthUhprRES6Yn1/qXViCcFPCc gswsdDl4l71rApAA== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=M8XGhp5q; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=wkoz+YfB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1737625346; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oiMijr+WXmjA7NWesrEJYg/tJdD6ApuM+UeKC9rUR8M=; b=M8XGhp5qzi3FzjEy2EYiEjHHs4WprImfFdWH8PK8SWuwSg32MWk5aft7drk5MT3xZCC2nQ W+i0weB4SNekFIuf/zY20AvEuNo90zhEw+qMXVu4NcSmwwE80bvyFOPE3xtBhLZNAb5V9y rTsIupIpDcTW4zV5K/Tqzxxs7bGlpUg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1737625346; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oiMijr+WXmjA7NWesrEJYg/tJdD6ApuM+UeKC9rUR8M=; b=wkoz+YfBLerxnemLtg2Ijbgz2OlvZAAAvtRJ2IXTl0j+QnhAYlAmDGtTgKr0DahV85IwJy evlqe6fkQbdyeoAw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 47C611351A; Thu, 23 Jan 2025 09:42:26 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id a1htDgIPkmcHaQAAD6G6ig (envelope-from ); Thu, 23 Jan 2025 09:42:26 +0000 Date: Thu, 23 Jan 2025 10:42:24 +0100 From: Oscar Salvador To: Liu Shixin Cc: Andrew Morton , Kefeng Wang , Kemeng Shi , Baolin Wang , Mel Gorman , David Hildenbrand , Matthew Wilcox , Nanyong Sun , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/compaction: fix UBSAN shift-out-of-bounds warning Message-ID: References: <20250123021029.2826736-1-liushixin2@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250123021029.2826736-1-liushixin2@huawei.com> X-Rspamd-Queue-Id: E606C21175 X-Spam-Score: -4.51 X-Rspamd-Action: no action X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; MISSING_XM_UA(0.00)[]; TO_DN_SOME(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; FUZZY_BLOCKED(0.00)[rspamd.com]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_SEVEN(0.00)[11]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo,suse.de:email,suse.de:dkim]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Flag: NO X-Spam-Level: On Thu, Jan 23, 2025 at 10:10:29AM +0800, Liu Shixin wrote: > syzkaller reported a UBSAN shift-out-of-bounds warning of (1UL << order) > in isolate_freepages_block(). The bogus compound_order can be any value > because it is union with flags. Add back the MAX_PAGE_ORDER check to fix > the warning. > > Fixes: 3da0272a4c7d ("mm/compaction: correctly return failure with bogus compound_order in strict mode") > Signed-off-by: Liu Shixin Reviewed-by: Oscar Salvador -- Oscar Salvador SUSE Labs