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]) by passt.top (Postfix) with ESMTP id 853585A004F for ; Tue, 02 Jul 2024 22:55:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719953721; 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=o3b4hJsB6txW/xlNVzMyGi7LTQqn8pSaxQbgT4ZL6qo=; b=dW6nB82W+ZnDSzmVXTTuDBVoUMsV7qC0sXbTtsXeNmz/nUROzazpXiBv+hNDMzEujyHEb7 7OgV6TJVtY36k9NkXkJht3CoQzXWM1z3dFfkusloOOsG+Uk0q4UqlQf7Vc1wvKIqBYmKSM am8SYRtv695B8taLOLsWyhHKyaGyljs= Received: from mail-qt1-f199.google.com (mail-qt1-f199.google.com [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-504-oklYuhCjOeWMwGdglc-wvg-1; Tue, 02 Jul 2024 16:55:19 -0400 X-MC-Unique: oklYuhCjOeWMwGdglc-wvg-1 Received: by mail-qt1-f199.google.com with SMTP id d75a77b69052e-4465f627934so44197751cf.1 for ; Tue, 02 Jul 2024 13:55:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719953719; x=1720558519; 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=o3b4hJsB6txW/xlNVzMyGi7LTQqn8pSaxQbgT4ZL6qo=; b=Vv8A4SPzVCgI+MHWChUNHAtyzE1l9nY4S5UgeN/qbrwAXciYNGUh8eq4st3kCtq/om qSRRtK9FGZJSuXUYMUVHtqbSkogFUVKd3zd4Ly8mH3qls/eZ3jeg0WtzMCIYhfEa81VX vQoAVSuONQg1t4CVQVdVxi7L/9d/WWLjPWl2sOohRTZ+2p12jw6z5TwNcVDWQQM7yyYy kzoHNU6hjdrrJt17wIU9ZzhdHw8Me0sR7inU3mGPPDK3YnZGcgkaUhehvUpU7SOksuZD y44jiXWnl8FT0Z0saXSgu6oBsgzEv7KwJEw/Q8F5Nt529D3CH/xuXS2Yq7Z19bD0MVA1 s02g== X-Gm-Message-State: AOJu0YyAxEYBzBBOd88RUQ5MSxJ5wvf5rqX8hDAMU5IoN2DwcFF2gtsz tW82PVenvm0koqDkIb4ClO0TegeBjByorys3IqlxpYIiutwzF3tCa2SEVJxlbqLELIwt6hOVubq V4P9kQqjqmnFzCHrWbpsVzdkVL9NrwDfQn0D80oCaBAdEkJcR8g== X-Received: by 2002:a05:622a:4f:b0:446:5984:9cf0 with SMTP id d75a77b69052e-44662dc1631mr153099241cf.1.1719953719373; Tue, 02 Jul 2024 13:55:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFjG8GwlvCqaRXZxhjXHiylgwjbNIdKhD5ZXzWcuhrgrwbk0gvLTDkNjrGYfuG8FYWchq83/Q== X-Received: by 2002:a05:622a:4f:b0:446:5984:9cf0 with SMTP id d75a77b69052e-44662dc1631mr153099121cf.1.1719953719012; Tue, 02 Jul 2024 13:55:19 -0700 (PDT) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-4465143e475sm44583781cf.46.2024.07.02.13.55.18 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Jul 2024 13:55:18 -0700 (PDT) Date: Tue, 2 Jul 2024 22:54:43 +0200 From: Stefano Brivio To: passt-dev@passt.top Subject: Re: [PATCH v2 0/5] Small, assorted "hardening" fixes Message-ID: <20240702225443.7a966f90@elisabeth> In-Reply-To: <20240627204641.4046184-1-sbrivio@redhat.com> References: <20240627204641.4046184-1-sbrivio@redhat.com> 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-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: H4U6WF4DW6E2CQHW3O6NSKT4LE7XPC3X X-Message-ID-Hash: H4U6WF4DW6E2CQHW3O6NSKT4LE7XPC3X 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: Matej Hrica , David Gibson 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 Thu, 27 Jun 2024 22:46:36 +0200 Stefano Brivio wrote: > All harmless issues as far as I can tell, but nice to fix. > > v2: > - in 3/5: > - keep 'skip' in write_remainder() unsigned, and check for > unsigned overflow instead > - refactor sadd_overflow() and ssub_overflow() to use built-ins > with automatic types, take ssize_t arguments, and deal with > different ssize_t type widths > - in 4/5: > - switch l2len in tap_handler_passt() to uint32_t, as it really > is unsigned and 32-bit wide > - return if the length descriptor mismatches, instead of trying > to proceed to the next frame > - add 5/5 > > Stefano Brivio (5): > conf: Copy up to MAXDNSRCH - 1 bytes, not MAXDNSRCH > tcp_splice: Check return value of setsockopt() for SO_RCVLOWAT > util, lineread, tap: Overflow checks on long signed sums and > subtractions > tap: Discard guest data on length descriptor mismatch > conf: Use the right maximum buffer size for c->sock_path I applied 1/5, 2/5, and 5/5. I'll post a new version of 4/5 without the "fix" for the integer overflow false positive soon, and I'll leave 3/5 alone for the moment. -- Stefano