From patchwork Fri May 31 14:55:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13681765 Received: from mail-qk1-f169.google.com (mail-qk1-f169.google.com [209.85.222.169]) (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 0F2165731B for ; Fri, 31 May 2024 14:56:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717167362; cv=none; b=HKTW36tueXuS0sTarrNev/Hrg5rKM981Go6YAlTVIhzI9w+l61EvhQ+/IU3qSzuOUcXyORgGC2olTsLSPiBntp8knHbbuCsFxS/w1oVIxJhqpuS+1EKiuUmbWqtQIj+L+W9jKz33OoBPp1UR8ada5+B7Ei9QYYwVH2VBba7eaZE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717167362; c=relaxed/simple; bh=0QhtWRrZQs36vjEC3NrhSslpyU5nxOi412dAAMrvpWY=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=M8HgT/UOrAT/N2q1+O/bqHFD/ptlqLiW90HB8CVf6hbdjULtgFaX9tsQ57Gr4etOBJ5ai4mdJIjO/hekvezfMMrpN81p2AKOeibvAKIsF3oDQ5WMh6cg8x+O1sNZyA4sLlfLq/LlM04TPO6Emd0JaGhbhPiAyqUdxKrZZD37DOs= 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=c32ycG4I; arc=none smtp.client-ip=209.85.222.169 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="c32ycG4I" Received: by mail-qk1-f169.google.com with SMTP id af79cd13be357-7930504b2e2so103350385a.3 for ; Fri, 31 May 2024 07:56:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717167360; x=1717772160; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=x9DMJMX0YO0v/TNHNWnRe4ZY3CEI9ovzGriqh1VGrOU=; b=c32ycG4IrMJCv8iT+zWrymundg16QVHjzgmupZAXSunHy6lK4W57iiEkijJPne+Jz+ vkNrKbvte3wO7OSSE4YPrZe3t3AfVJU/4BRyHvFEanusqJhOeVPMmINuuDeoDLuFZUlQ SCQY7qWqasctQJFyvVBODZPQSYPFdRMa9OnrnS/qbWcbSgXgtIB9EYb7oyQraniJIq0P Qx9w3dsBLSNdsN7fps0k7qbPtWzhH+yU7D6RUWzuarLCJ/V/rpxmEXb4K6IUEp1KtA8u ydxeVTzh5ln71Ryx31KVk86UsB3ay7IM3LgcjKrVAsL61Zm2dEDj0bOQRV9Nk7bgNDZI 0jEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717167360; x=1717772160; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=x9DMJMX0YO0v/TNHNWnRe4ZY3CEI9ovzGriqh1VGrOU=; b=JKl8oPF0w8GEnbueNc3gKGR94/Qo3Ve8lok0dNkhP+SnCsypjVq2AziY7tywDQMRwk +lVTBAHSTSggPvz2a0YU6qZNXbILQkrAi5xaNYkgN39nNXR/xrlANlNDcbMB5El31Wvo 2uQ/teTxVBj2wS13+ifpjBsWXybBFNFbU1ZugaZzibJgVDU4yoKUHZhfEPLHjhDtjxe2 Q60SPniyPWiC2UX7Z3VVjKH+Rz+dClamoeoX8nc2CW0wGSdjI/eoedMuu0cuF3GtXLAv ia+3Lyc+j451n8Du1d5zc+uVgnnHhWHUvE5dZPS+BgVmWtuO7ISxVPUkle4Z6C3HndfH udLg== X-Gm-Message-State: AOJu0YzIBwNaQzlxRqQO0sSOhhZ/oMX5qBOblPYkgt8g15bVts0hDoMl WPEv6QOHTV7LfK/VAqtWo4QBMNIKaNbRYZbni/z4R/AjfXLW0TQsWBqIMQ== X-Google-Smtp-Source: AGHT+IHQXlNFIs4+Q0meyVb9CbsGF8T5D051K75JNgO9NjrjiMiKA0kuOXqo/H2nDs6088WyNEKA5w== X-Received: by 2002:a05:620a:2886:b0:794:70cb:8 with SMTP id af79cd13be357-794f5c882f2mr251789585a.40.1717167359591; Fri, 31 May 2024 07:55:59 -0700 (PDT) Received: from LOCLAP699.rst-02.locus ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-43ff23e0e48sm8704841cf.42.2024.05.31.07.55.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 07:55:59 -0700 (PDT) From: James Prestwood To: ell@lists.linux.dev Cc: James Prestwood Subject: [PATCH 1/3] acd: move l_acd_stop ahead of EVENT_CONFLICT Date: Fri, 31 May 2024 07:55:52 -0700 Message-Id: <20240531145554.601087-1-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: ell@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Stopping ACD after the event callback results in an invalid read if the callback destroyed the ACD object. Stopping ACD prior resolves this and is consistent with other call sites. --- ell/acd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ell/acd.c b/ell/acd.c index b913c9b..e7ad416 100644 --- a/ell/acd.c +++ b/ell/acd.c @@ -283,11 +283,11 @@ static bool acd_read_handler(struct l_io *io, void *user_data) target_conflict ? "Target" : "Source", NIPQUAD(acd->ip)); + l_acd_stop(acd); + if (acd->event_func) acd->event_func(L_ACD_EVENT_CONFLICT, acd->user_data); - l_acd_stop(acd); - break; case ACD_STATE_ANNOUNCED: /* Only defend packets with a source conflict */ From patchwork Fri May 31 14:55:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13681766 Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) (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 1135657C8E for ; Fri, 31 May 2024 14:56:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717167363; cv=none; b=N3k0s3kAjwjDax/SG/f8bDaOrmgA69EsMOSBX3H55rd+/qVePvZJSf57X4hiYVZ5XT4xOzq6kCeHMScOxZI9wsJIiqvuDq38SmlasL5hWg69CoAlonqVNf8C6Z/wHW1cVWPGJnoRk/qg8HGBnqUoEbcZo3//KxLNWS8T8ZLxgUg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717167363; c=relaxed/simple; bh=vdKMQAQGENutMRml6a6UjN2Tsdp76m7UbGUZWOxJ3To=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kWBeoXOg4mT0jY0XFAF08adIWOQ8ljQfWlPrQtmwD3rFp/iLDZyyhwFO4nLz+zzs9OiTzKNuFb4BFiGFw66XG3g73CPfSy+kWPmOmAznFstUtRBrhSSksGkuwW1rG4MfF18HDegdn1NNIYhRAopSqg4UUar7a8+uDsBx03Ev1lQ= 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=VOebSFIz; arc=none smtp.client-ip=209.85.222.174 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="VOebSFIz" Received: by mail-qk1-f174.google.com with SMTP id af79cd13be357-794cbdca425so151068085a.0 for ; Fri, 31 May 2024 07:56:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717167361; x=1717772161; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TeoZYF+e8wOfTkbr6ksfkhgz19NvRSx+JWt0sNdb1i0=; b=VOebSFIzryNOUa0Gvx1x9NByI9InYcwGzJXq34ZnK9Io1IhvN8IX8+eFV5Mfb2XxRl D1jkudbQi6BN1Jyye9wcrTxCN8aIGC+IQBzvMLQGh8Mgfsm2GpF6P03at8uKuZOqXIi+ RTIlk4TJXaL+FFQ61ScTA7T2oFVJbdxYxBHJCDpd9Of36X1RHsKvrP8AQmtjSdXUr0Yy kESBYYfdOjiQLLNrxwSOuY2v0alk1QSheqD2Ph4V0sZPf8/ie5rpMmUAAJs1BtuAPjbM 3N+c4fXpbubbAeEZab96+DOAojPlsbV7RCmfqk1gW5Vc9ZyosrGWkOIGsHGiH1sNhuzA i2wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717167361; x=1717772161; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TeoZYF+e8wOfTkbr6ksfkhgz19NvRSx+JWt0sNdb1i0=; b=Xk/wduzidSB+OsCwWwf/P5UbRnF/Q+5I0A6RtWFqLI9Yx513IAxvLJdW6KRhfoQF8R sHiq0sHMv2mUToO2fXjno4w17wlm61i0Aov9Or6OWN/iPWJpUm+2CzrXb4c9cQcgpHG4 NXt+YskRQi0QG//4zs68LvLTjOC52V6gIbPklL5/DM/qE7f79VQJNoZzn+nlXRZrOgs6 Q6Hjwf8agjbwQGo50qX2uc3gTGgCje9a3RN75Pjn+1Nop7w4U1tsHhiCKAWN+Wuxl83P A3AA1SqpIxI35bOx8AdQh+cwinwuYOJWWT+76Kb28wwtlUNGLpLqI6QReIWSvx0AFd1/ cVpg== X-Gm-Message-State: AOJu0YxbWl74DVxh724ngGtGTK4fSA0XzJrxf6Ob2GgzpxWqs18xu51T HrmKkanKOCcbH5NoVBtd4m8ULJ+KBnzj5QkiE8lbeR/zlvvW9E5XgSNRQA== X-Google-Smtp-Source: AGHT+IER4dmOYQ5+DdpAxXst5Zqjq6xhWD39PTs87RQwDvD8XxFYqeYJnEf+zn45/fA6SG0bLb+Ulg== X-Received: by 2002:a05:620a:450b:b0:790:ed57:1354 with SMTP id af79cd13be357-794f5c664f1mr245545185a.6.1717167360715; Fri, 31 May 2024 07:56:00 -0700 (PDT) Received: from LOCLAP699.rst-02.locus ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-43ff23e0e48sm8704841cf.42.2024.05.31.07.55.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 07:56:00 -0700 (PDT) From: James Prestwood To: ell@lists.linux.dev Cc: James Prestwood Subject: [PATCH 2/3] icmp6: fix memory leaks with dns_list/domains Date: Fri, 31 May 2024 07:55:53 -0700 Message-Id: <20240531145554.601087-2-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240531145554.601087-1-prestwoj@gmail.com> References: <20240531145554.601087-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: ell@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Both of these lists were never freed upon freeing the router object --- ell/icmp6.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ell/icmp6.c b/ell/icmp6.c index d94127e..d352955 100644 --- a/ell/icmp6.c +++ b/ell/icmp6.c @@ -787,8 +787,16 @@ struct l_icmp6_router *_icmp6_router_new() void _icmp6_router_free(struct l_icmp6_router *r) { + unsigned int i; + l_free(r->routes); l_free(r->ac_prefixes); + l_free(r->dns_list); + + for (i = 0; i < r->n_domains; i++) + l_free(r->domains[i].domain); + + l_free(r->domains); l_free(r); } From patchwork Fri May 31 14:55:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 13681767 Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) (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 13E9D5C8FC for ; Fri, 31 May 2024 14:56:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717167364; cv=none; b=R86JfwZ0AtZFJEamEWh5zf4W1hnnaqFb7kV/D22aefvuTaHNZcH82ErakqNj4UYBpYe9z77HRb261aXvS96bG8sILjBXFyyEkA2bVxQ5Cc8JKLRU5E5R+PI1Uc/D4X9zVZNMmmaiG/Ns1+9HE6wcpfz7j9t5/GHM/3+w7XDx7UA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717167364; c=relaxed/simple; bh=ilAgxMwTD0AXkoUJQf2CB2Ogi2Qo0x0ZKAGF8q1C3Os=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hpBWjbmAtzzluSX2BxxMeokIVQzOQ9YykFKFVpIyN5zMO6mjs7xB6ys2VDAtFhbjkX/5WhlB7+I7peSJmrldMnVZz3oY07EqBJmeELiNbLWM0+RFDvfd7f/ygr7NE1HXQhDkvQTGtQrwYMRnXHgQwq/N6mvZO3ADtHEjya/ukDM= 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=dcWHYkJb; arc=none smtp.client-ip=209.85.160.174 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="dcWHYkJb" Received: by mail-qt1-f174.google.com with SMTP id d75a77b69052e-43fc100549cso11110351cf.0 for ; Fri, 31 May 2024 07:56:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717167362; x=1717772162; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=85Y5VfNBfWr6W4qv5vuH9/35nYjZiTGP59kDK0kW0c8=; b=dcWHYkJbsRVMQRyvDodjQ49K7dikMxraZud85nUSudNN2W6kQI9o+nGCrIdbvDhgkK yxZQcNfUWdOa5mHZz4zul+I3Qk1k7XJT6J0lpTQ7nYe65Tei1QNVGKbnHiVpOQ/xo1Za 2iE332NBEDdxfrTyAwTiJe8k6f2F19SGjDdVOn6VduCogWxnz/aoqAMJbpQ6hcZBW3XF JR6UCoL75LGxy0io1mFJHTmWItytiZm7Tp2Yj4hkMYNWO9kfAZCYyxQqMxrvIgsHvZKK lc+yrPXiqdfRkjA6sCFaI83apg1UpEAlWSNXs1aqyxhTtYxiQ3Wu9pOX0ZAK+u/wpx02 mwZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717167362; x=1717772162; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=85Y5VfNBfWr6W4qv5vuH9/35nYjZiTGP59kDK0kW0c8=; b=TQtDLWoOpHBVpEWwuSZys+idsJ8XpdSnLSGALOZlbt6wcXKR7CyKhrGUnqKYWyc7Wr gB3p480tc1aB+vpZEE3NXipMweMQOOW0fOdUl7UJguAZhK9v9xrjcHln0+yoEeDDVe/O 8eP5t4MJrdnwrbhOQbI+TFFQDalpcRKzwvGY9z/GJJOCsnU7y4RNX0D2TL8MNY2NyUpb HjcwgWkozcZThd12gXRjLpXHLx+Dr1uLE0u4L4IWdeKr8cfMIwpBlCiIMyBOl2r6n6BC nSJU2sJ5Qjb2MxU4/WFYY8V0Vcydnv90BQeUBOMnow0AQp4/h27Teh0xQZNfUtSxxRfC Kniw== X-Gm-Message-State: AOJu0YwIuzeINnsAkI23zBcHYbsj/erprCXL45Y6a9NmoABNQw5ARNiO Tu9yWFcW0DDYvQzYYT5gzresQMTrSm/ikvttLyLGWWD/Xx9hdPZy2aDWlw== X-Google-Smtp-Source: AGHT+IHUhKnI2oWyhAI2Ge2XRNA5YO37Wct3DqHSvnII0cc3CsgF86D9SFNaWSdGp6SXOfjVG2JfUg== X-Received: by 2002:a05:622a:1309:b0:43d:f612:979e with SMTP id d75a77b69052e-43ff52ab1e4mr23087301cf.47.1717167361800; Fri, 31 May 2024 07:56:01 -0700 (PDT) Received: from LOCLAP699.rst-02.locus ([208.195.13.130]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-43ff23e0e48sm8704841cf.42.2024.05.31.07.56.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 07:56:01 -0700 (PDT) From: James Prestwood To: ell@lists.linux.dev Cc: James Prestwood Subject: [PATCH 3/3] netconfig: free slaac_domains/slaac_dnses Date: Fri, 31 May 2024 07:55:54 -0700 Message-Id: <20240531145554.601087-3-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240531145554.601087-1-prestwoj@gmail.com> References: <20240531145554.601087-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: ell@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Neither of these queues were freed upon freeing the netconfig object --- ell/netconfig.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ell/netconfig.c b/ell/netconfig.c index 06a717f..9cebdc3 100644 --- a/ell/netconfig.c +++ b/ell/netconfig.c @@ -1410,6 +1410,8 @@ LIB_EXPORT void l_netconfig_destroy(struct l_netconfig *netconfig) l_queue_destroy(netconfig->routes.updated, NULL); l_queue_destroy(netconfig->routes.removed, NULL); l_queue_destroy(netconfig->icmp_route_data, NULL); + l_queue_destroy(netconfig->slaac_domains, NULL); + l_queue_destroy(netconfig->slaac_dnses, NULL); l_free(netconfig); }