From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (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 4626F3DB303 for ; Fri, 31 Jul 2026 11:20:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785496825; cv=none; b=IggAa1lJyF3/AFUTefkhRnkYHKKLaZIsVBVB0mGnehbis+YHW6yF7cHZrsiO1ERdJth+a3VWUtwc4Jdz+PyvP3gDKleH3++tj9wEQZ/NxZoCdQcdHQ7t8o8UdEEj+PIvx9DPzCMl4Y5Yny4wTIezXBteY+AqmsWR8uyYdSyG1xA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785496825; c=relaxed/simple; bh=Bq3Ywgc86DledfdQMuTfMx1iFtuwK8Szvs4VwRcgD+Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oEDsnxl1gXJuGNp3rF1VPGiEwHFJzBfXJue1JBpLIhpsOIkKYs8CzaTZeZCya26rPIwTNc7J35ZBU++PNPdX42ZxqyYw0TNOpG+aa5J0ZDFCRLnM1Dgute6AeZMDAbjzkuTABf1HoPBc7veYn+0QcGFJI8ZiL8ULHtzAjoyST0s= 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=khAhsFwX; arc=none smtp.client-ip=209.85.208.44 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="khAhsFwX" Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-69f2c67650aso1374800a12.2 for ; Fri, 31 Jul 2026 04:20:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1785496822; x=1786101622; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=zpsaKTs1fQyHTTQ7IHSRoMDnLkmSOTdMspucVX9efyg=; b=khAhsFwXnZ37GmQBm1osFpEJhYuRIcYdyvcQaxhDV9B9XK6TR7NClSiWxt5ST9G+KG QNCiy4aQg6i2tnIO09v2PSYLhTKy4yfYUONp/hnZ4WdzcA7CjtQlSB6DXFT9cyOTrUxN apJqOeqCupf4ZlDAfjbDgZ4h/A9dM2mLacWj507QIPGMyz3dZTZO97ONgyW88UWOhGmf nsujR1EfiZgQs8ygjQqdqkFNayVtWqY2XZc6Vjd8JNzhj1yhv5AWyqdkp36Ead4y8Bw3 CSxvpEMTMMVFXztG8Rb8Yzf6UEbppgHe6Zks+6iaRlw3tec1VMfjPg/7ymG7t6/rJeEr a7Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785496822; x=1786101622; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=zpsaKTs1fQyHTTQ7IHSRoMDnLkmSOTdMspucVX9efyg=; b=BdquCROV9xx9SpVY0ap3yHY6C5v2fjTelubC8o3cAvOzrb1paHGmzGkBs83xYobQ6f nUCtGu+wyvm5/gmDPsogMlsK+MTcNi9pGqSUBBvOoxBBxnu+2IwamrsvkyRg7OFkqbex aFkl2iR6zauJsYLixZWsMOXURp3Kir14PYc02m8qUTvvMc0mGzJLWf/UMRfhCGsh7ktC eLn6Av1busnfla5vnq7yRpF2yhpkHH1STp0eBOan82AtaL3t0QE11tUMkH8QJrcf4Xal qHsYCWa5rX8qiQqBIE12SWoLL7ORwN+ePSSNhN5TUcp4pD5UhAHcoW5m9NNZY3UuPjrX 4l6Q== X-Forwarded-Encrypted: i=1; AHgh+RoFbVI43bGJWnhE9GStqkT/Gkn+DFifkPuwCDNNpxVpYEQTry02LIYuR0YN7HCPEdK7PDUHJ6EVLxjxFkI=@vger.kernel.org X-Gm-Message-State: AOJu0YzhXbEAmtNKNk+VYL1vObJP2w3jEE1CC2+LW9pnwYCckz+3oATF H+6YTkAcXxCiQASjsycsrV38ATFt6r+frbOsbuhDUMSDgJWgIVVrne+x7/mUIMkhDtw= X-Gm-Gg: AR+sD12NLdm2gcm8vCprBCHLwiX6vUazFamAljExNFzE2bz4zsvsP/fs4Zipi2k0oIp Zg3ZEbEr11lJyQrw2kjk8soUJoVTJJk933b8rx43clEbqzxJQnCylnHKWD25g0gl30GdLbQ3J9j 4ympAJiUSUe3BoNDfOcWGD9s9pe1xwc5jxrcuy/s+PPHGRtAKcCYjCixpLdb3dQDfnaWGHFgu1F 9VNT0VchMoRPe8Z3dNvlYgr30XDqz9xQIYjR6SMtNwq4R+Htf4BuJX0V2VeFXRhkT/EZI4b1gZd w+xCqbXJN2u+QdsqW8LUYPQ+OIm/P4ByF1ocr5jI5CylhfDfey+AMWxneA0pBqEIy4j1nTvKAHF 283S6yCOqVEEO4spca4cKh95urMIB3wYWYMGZV6lrgK8LXS9OsoQxWX8UqtAogXgWkC/XU6kyq9 BfJ7uJEyR+1nJC2UVZxqVWEp2eZFqoJjn32vJdRQboz4fc6A5UKCEk3geUlL5ONkIZG6Q= X-Received: by 2002:a05:6402:52dc:b0:69c:811f:8f5 with SMTP id 4fb4d7f45d1cf-6a0984ca852mr778349a12.6.1785496822488; Fri, 31 Jul 2026 04:20:22 -0700 (PDT) Received: from localhost ([2c0f:3d00:6be:8900:ce5e:9212:ea4b:f30]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-6a09c5b1a15sm1232514a12.9.2026.07.31.04.20.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2026 04:20:19 -0700 (PDT) Date: Fri, 31 Jul 2026 14:20:15 +0300 From: Dan Carpenter To: Ivy Lopez Cc: Greg Kroah-Hartman , Ovidiu Panait , linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: axis-fifo: validate tx_fifo_depth from device tree Message-ID: References: <20260731000136.96707-1-skunkolee@gmail.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: <20260731000136.96707-1-skunkolee@gmail.com> On Thu, Jul 30, 2026 at 06:01:36PM -0600, Ivy Lopez wrote: > tx_fifo_depth is read from the "xlnx,tx-fifo-depth" device tree > property with no lower-bound check. It is later used in > axis_fifo_write() as (fifo->tx_fifo_depth - 4), an unsigned > subtraction, to bound the size of writes accepted from userspace. > If tx_fifo_depth is less than 4, this subtraction underflows, > defeating the check that exists specifically to prevent a > 'Transmit Packet Overrun Error' requiring a reset of the TX > circuit to recover. > > Reject tx_fifo_depth values below 4 at parse time, consistent > with the existing validation of the tdata-width properties in > the same function. > > Signed-off-by: Ivy Lopez Generally, device tree data needs to be correct... This value is normally 32k. It doesn't make sense to check this one thing when there are thousands of other ways to mess up a device tree file. We could merge this but that would make the AI think this is a useful behavior. Instead of that the AI should be updated with correct assumptions. Or we could create a more complete device tree verifier. regards, dan carpenter