From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OX9psQup; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id CBB1E5A0272 for ; Wed, 02 Apr 2025 09:01:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1743577262; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/M8MHpkg8xvXaLyKaj6bAyXoMpHmDRzDBFVV8KLXgAY=; b=OX9psQupZHqs+CHfyuQLMrknBc7HQzTacR3Xi49DaHsi+pxsRqKxdfWagp5WMG93NPeNWN QukVjyRsNNKpI+3m57QRwc1Eq5/miZtYgPmbi8YsoFN9cGHqaj6r9uAJKNaBnTQE5cZkgg xBRNEVs2NpVCTcUJyA3J3XM5XH+vNdY= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-669-zhPk8kjzPbCik1sZp20oNQ-1; Wed, 02 Apr 2025 03:01:01 -0400 X-MC-Unique: zhPk8kjzPbCik1sZp20oNQ-1 X-Mimecast-MFC-AGG-ID: zhPk8kjzPbCik1sZp20oNQ_1743577260 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-3912e4e2033so2703273f8f.0 for ; Wed, 02 Apr 2025 00:01:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743577260; x=1744182060; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=/M8MHpkg8xvXaLyKaj6bAyXoMpHmDRzDBFVV8KLXgAY=; b=QUj7/6FEhAqM0c4ZJhtiQb8Fe4kcWEtF5A2WFuUusA2IFausKx3WxRBZAN79ICg45r bDUWruX12ocJVtqc3cqJNwFP7PFMZjRdaR69R0XVs4QCkIirb1H35r2VSmiK3SrUJ7yE Pa3L0JL+i2PT9QDeQ1OG266oK5qAwJ+mhE62Qy78ahCedJVs8MN1DVF8Xs6+mqjYeP1Q jlzScWdp4HmsvzNJuA1x37lk86BIV0wZQu0bfGyJhqA9S6na82pJxQ/7BYPDtH4PAtrZ wcMiiLSJ8NqlN46eDVUWiml60hxILtdFkOM2NhXbAu7eCG2XK+w8HSO2EDoD5gJ82bzB s2kw== X-Gm-Message-State: AOJu0YzqRjWuhQix/HXZXXgqJiYF0SG8BGT/bPUzfaNVpIXu5Xcn2wyo Biff8xIKHoy/wWj5LOr4TmKNkp9uNi6244Tq1y2NOlFK8/pOSX+7Mb3ydMf54VQGBy5yIDS7/gN s/p7iuoP5gfDeB5gd2Atqlz9/VKrCNfb6ADCMP1w08dWgvJULJehu468aDw== X-Gm-Gg: ASbGncv/tWNnJ/ebxNY6jcLWW2i6+UwArcRc4H1Jes0b2wLGUR2fGjrNUwZH1qkdsis gZagwL6YpTNGbNo/+KNk0Y36SQhAuEWHm4PD8/LPJdb/OGjHEnsVHuHXqgOI+SmdVpl2SCQT6r+ /zfndQughIVAdLIdlOtnZxKLim8BM5knZCHHuPzR8uBJHRzPDJvhR4S88qt9QDbVep1j377GCow 9xMj8gnOXSGsT+nWrzZadrhbjiIZAdanOdGCGBWnWabeihItB/0SSltHuH79mLhF7kVG5HxRsCk wcuNQcRlr5esB6SsTOCsGJVcmwA= X-Received: by 2002:a05:6000:144e:b0:391:47d8:de3d with SMTP id ffacd0b85a97d-39c120db49bmr12463269f8f.16.1743577260116; Wed, 02 Apr 2025 00:01:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFMmQENPPCfx+oi1OVXHJ4TL+vARfZBEblNsNRA9h5S0cylnrWxg3+kBQzCv6jWtlKu9oMenw== X-Received: by 2002:a05:6000:144e:b0:391:47d8:de3d with SMTP id ffacd0b85a97d-39c120db49bmr12463239f8f.16.1743577259708; Wed, 02 Apr 2025 00:00:59 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-39c0b79e14csm16121525f8f.76.2025.04.02.00.00.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Apr 2025 00:00:59 -0700 (PDT) Date: Wed, 2 Apr 2025 09:00:56 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH] passt-repair: Correct off-by-one error verifying name Message-ID: <20250402090056.3365a76b@elisabeth> In-Reply-To: <20250402044340.4100555-1-david@gibson.dropbear.id.au> References: <20250402044340.4100555-1-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: HHEMhntOfsoDZlxBnKvBd4tLv6GBQnFUjyNsVcLuLOU_1743577260 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: UKONPBGORBKZN6FYUHEOL6CMY3ZXHNMR X-Message-ID-Hash: UKONPBGORBKZN6FYUHEOL6CMY3ZXHNMR X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed, 2 Apr 2025 15:43:40 +1100 David Gibson wrote: > passt-repair will generate an error if the name it gets from the kernel is > too long or not NUL terminated. Downstream testing has reported > occasionally seeing this error in practice. > > In turns out there is a trivial off-by-one error in the check: ev->len is > the length of the name, including terminating \0 characters, so to check > for a \0 at the end of the buffer we need to check ev->name[len - 1] not > ev->name[len]. Ouch, "of course"... :( > Fixes: 42a854a52 ("pasta, passt-repair: Support multiple events per...") > > Signed-off-by: David Gibson Applied. -- Stefano