From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 14966329C48 for ; Thu, 16 Apr 2026 11:49:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776340172; cv=none; b=e8ji1Tn0a5M/S1gLSYQb7KcwUpHZGAYkGyqDnS7gEOItVpnrYLnZZeGOT/eXC9BoqBI95sM+WJlEEYmyHrjZohUlRs70a/9Mp9GtuFTqOc2My1gn0UQt9qWKHv57jdmqHo+CRyqYD3/scweQTF7FdwZtycrifVuXrhr0EpjbaOE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776340172; c=relaxed/simple; bh=pQKxeHLRXgVC0+6Nv+mKMwQzm/AYFiqHhaDwdr43NSs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QeEKL+DJzBBtWmjq7hdv49mSIbIck9I7DWna1oiw4CDuOfoshFureb4yD+pttCWBYoelNjA7/lomJf30JXFrFUKN0kelBcDLsFlnNXxTB9gTW0UkAAhrBdj46CoG0mx+tV0wyLmfQwsmPNriFUzks8mHyUTcdLfYMoj26r1Vd1A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Bc0QwBB1; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Bc0QwBB1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776340170; h=from:from:reply-to:subject:subject: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=kngQOc5ytpk3uICUzeEv1AlgSMNquk+OecDuIWV0N1E=; b=Bc0QwBB1Jt9CjZ7wuTjNIWIjFGbe1vNAuEMeWYZerZzuz6nXveQ3QKrlvAxvw7f+WjntFq sH8K/CDSR2yjT4o/dfWUElGk7a50tqrUSpjWXRvjNeAcPVvABQmOKQsYUuIOWHBO12ix9o WKSxusP9PkMeN5i9c6Fzg1bbCmz2H04= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-478-DuHVIbI5NKS4RzQDUFDYlg-1; Thu, 16 Apr 2026 07:49:26 -0400 X-MC-Unique: DuHVIbI5NKS4RzQDUFDYlg-1 X-Mimecast-MFC-AGG-ID: DuHVIbI5NKS4RzQDUFDYlg_1776340165 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A6E991956048; Thu, 16 Apr 2026 11:49:25 +0000 (UTC) Received: from oak (unknown [10.22.64.186]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id B86E630001B9; Thu, 16 Apr 2026 11:49:24 +0000 (UTC) Date: Thu, 16 Apr 2026 07:49:12 -0400 From: Joe Simmons-Talbott To: Dave Penkler Cc: Joe Simmons-Talbott , linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: Re: [PATCH] gpib: agilent_82357a: don't check a NULL serial string Message-ID: <20260416114852.GA15912@oak> References: <20260326131256.1758014-1-joest@redhat.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: X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 On Fri, Mar 27, 2026 at 11:38:49AM +0100, Dave Penkler wrote: > On Thu, Mar 26, 2026 at 09:12:56AM -0400, Joe Simmons-Talbott wrote: > > The agilent_82357a driver uses the USB device serial string for device > > matching but does not verify that the string exists before passing it > > to strcmp(). > > > > Verify that the device has a serial number before accessing it to avoid > > triggering a NULL-pointer dereference with devices that don't provide > > a serial number (iSerialNumber = 0). > > > > Similar to commit aa79f996eb41 ("i2c: cp2615: fix serial string > > NULL-deref at probe"). > > > > Found by Claude:sonnet-4.5 > > > > Signed-off-by: Joe Simmons-Talbott > > --- > > drivers/gpib/agilent_82357a/agilent_82357a.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpib/agilent_82357a/agilent_82357a.c b/drivers/gpib/agilent_82357a/agilent_82357a.c > > index e1349afbf933..da046ea40f11 100644 > > --- a/drivers/gpib/agilent_82357a/agilent_82357a.c > > +++ b/drivers/gpib/agilent_82357a/agilent_82357a.c > > @@ -1298,7 +1298,7 @@ static inline int agilent_82357a_device_match(struct usb_interface *interface, > > if (gpib_match_device_path(&interface->dev, config->device_path) == 0) > > return 0; > > if (config->serial_number && > > - strcmp(usbdev->serial, config->serial_number) != 0) > > + (!usbdev->serial || strcmp(usbdev->serial, config->serial_number) != 0)) > > return 0; > > > > return 1; > > -- > > 2.53.0 > > > Acked-by: Dave Penkler > +Greg Hi Greg, Sorry I neglected to include you on the original patch submission. Are you able to either take this patch or point me to the proper person? Thanks, Joe