From nobody Mon Sep 30 04:45:12 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XH7m90rbjz5XkGl; Mon, 30 Sep 2024 04:45:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XH7m84BTsz4Ds7; Mon, 30 Sep 2024 04:45:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727671512; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OQ080WfzmxQupCyrr6aR10smpDN5SrBZeVp5T3MFD0E=; b=Lr9MBfBGbosaEuF6HvQNUH6w+80e+yCXiOMx7GH2k7Iw27hK0sNbjTs0TZ/V2GS6yoXt0T Ytm92EO/nBe3uJ1Y/8fQrVw+k2LERi8feTIGNySLyGFvEjzj7uKTUC+yp0w6if7Odp414P zjT/1VFq9MzVcLHLBA7HWpggyaxsiBg8yxXm+IEQSnUA8pTa00UyfCAKcJ8KHDOmUfcoaE bejnHkIRoJJhx8hESD3xbtxkas10bOtAAGHrqzwVt9pSqGFzK2jXx3dfaaylEd3lt+SZ8y 2Z9nQuv+1RuTzVGCPGSb/HSwXuWYKNT6dL9BDbuNU2BKavORBG6iEwcJ7+P+4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727671512; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OQ080WfzmxQupCyrr6aR10smpDN5SrBZeVp5T3MFD0E=; b=ErZH5lNF5jA10KA5ops50g++elggK2Iv1BQHrON22WCOnokcHTVrRQPFoTKp1nInfGiYgu raJo91DHaQ4cT04sNe1pZF4B9Zjw2w1kFjsZ17D0T1v3jwSgta9CY+VDxOpmw+0M9Nmk3U ZHC+3Sfnm5dbBDI+gp/tAK/F0UxXHgIgfQ83VLKQWBQmQLe7jOQoIxhm6h6GRX3Wf9rt0X Xo6s7Tw0Py8vNrwZcq41SDmKM2B3EdNxBvm2/2wYY3vTj5fIGmP5Wl3qGYEhLpq3CYt4dJ gh34XnELJM7CXWr+IASZQm00VZPvGWmqMjZ+7KNux3ZC/7nJpCASY/8XT8bT7A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727671512; a=rsa-sha256; cv=none; b=WQ5KEWoI2JKLnVjX/YsJIDt/WfSEy2Do9FrDcPRFhERqUViv9afwX6B4ui/zhfGSTY/S+3 R/PGLV//LflmfYEWyGcTvbEjQvC+H7cOmywfNBC2ZE9iLcScvsyGPlBktiL8s08Zwli1CL 53gqUH0WL2S+bkzo08wuNHRjLfGkmSApOb7Q7LcaOtKqUiu27cGP8N2J2qyJnconwlc1yC 4oeYecUoAO09Cgd8DW1q4JDKci50IY2Wvv63eDzI6bCIBcKlKfMXDLyDcAizIsuX3xTrd7 /wiHbnYDDrby6L2SUzPnQykKxQo3cq/PX76HH08G3Xty0rtIyUnw9w+zQJmAVw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XH7m82tRZzf9Q; Mon, 30 Sep 2024 04:45:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 48U4jCWf086359; Mon, 30 Sep 2024 04:45:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48U4jCfF086356; Mon, 30 Sep 2024 04:45:12 GMT (envelope-from git) Date: Mon, 30 Sep 2024 04:45:12 GMT Message-Id: <202409300445.48U4jCfF086356@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: a0c4498478f9 - stable/14 - pf: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: a0c4498478f92f76e2d06a1d2ba49806156264e3 Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=a0c4498478f92f76e2d06a1d2ba49806156264e3 commit a0c4498478f92f76e2d06a1d2ba49806156264e3 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:20 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-30 04:44:16 +0000 pf: Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 (cherry picked from commit 5b00557330b3b69db84969e33f2e201288208dd9) --- sys/netpfil/pf/pf_ioctl.c | 32 -------------------------------- sys/netpfil/pf/pf_syncookies.c | 3 --- 2 files changed, 35 deletions(-) diff --git a/sys/netpfil/pf/pf_ioctl.c b/sys/netpfil/pf/pf_ioctl.c index 04369a1aa9bb..6cb7bc95df2b 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2670,9 +2670,6 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td /* Copy the request in */ packed = malloc(nv->len, M_NVLIST, M_WAITOK); - if (packed == NULL) - ERROUT(ENOMEM); - error = copyin(nv->data, packed, nv->len); if (error) ERROUT(error); @@ -2750,9 +2747,6 @@ DIOCGETETHRULES_error: ERROUT(ENOMEM); nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); - if (nvlpacked == NULL) - ERROUT(ENOMEM); - error = copyin(nv->data, nvlpacked, nv->len); if (error) ERROUT(error); @@ -2850,9 +2844,6 @@ DIOCGETETHRULE_error: ERROUT(ENOMEM); nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); - if (nvlpacked == NULL) - ERROUT(ENOMEM); - error = copyin(nv->data, nvlpacked, nv->len); if (error) ERROUT(error); @@ -2883,8 +2874,6 @@ DIOCGETETHRULE_error: } rule = malloc(sizeof(*rule), M_PFRULE, M_WAITOK); - if (rule == NULL) - ERROUT(ENOMEM); rule->timestamp = NULL; error = pf_nveth_rule_to_keth_rule(nvl, rule); @@ -2983,9 +2972,6 @@ DIOCADDETHRULE_error: ERROUT(ENOMEM); nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); - if (nvlpacked == NULL) - ERROUT(ENOMEM); - error = copyin(nv->data, nvlpacked, nv->len); if (error) ERROUT(error); @@ -3061,9 +3047,6 @@ DIOCGETETHRULESETS_error: ERROUT(ENOMEM); nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); - if (nvlpacked == NULL) - ERROUT(ENOMEM); - error = copyin(nv->data, nvlpacked, nv->len); if (error) ERROUT(error); @@ -3333,9 +3316,6 @@ DIOCADDRULENV_error: /* Copy the request in */ nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); - if (nvlpacked == NULL) - ERROUT(ENOMEM); - error = copyin(nv->data, nvlpacked, nv->len); if (error) ERROUT(error); @@ -6132,9 +6112,6 @@ pf_keepcounters(struct pfioc_nv *nv) ERROUT(ENOMEM); nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); - if (nvlpacked == NULL) - ERROUT(ENOMEM); - error = copyin(nv->data, nvlpacked, nv->len); if (error) ERROUT(error); @@ -6258,9 +6235,6 @@ pf_killstates_nv(struct pfioc_nv *nv) ERROUT(ENOMEM); nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); - if (nvlpacked == NULL) - ERROUT(ENOMEM); - error = copyin(nv->data, nvlpacked, nv->len); if (error) ERROUT(error); @@ -6316,9 +6290,6 @@ pf_clearstates_nv(struct pfioc_nv *nv) ERROUT(ENOMEM); nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); - if (nvlpacked == NULL) - ERROUT(ENOMEM); - error = copyin(nv->data, nvlpacked, nv->len); if (error) ERROUT(error); @@ -6375,9 +6346,6 @@ pf_getstate(struct pfioc_nv *nv) ERROUT(ENOMEM); nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); - if (nvlpacked == NULL) - ERROUT(ENOMEM); - error = copyin(nv->data, nvlpacked, nv->len); if (error) ERROUT(error); diff --git a/sys/netpfil/pf/pf_syncookies.c b/sys/netpfil/pf/pf_syncookies.c index c5ee64c6aed0..538ab1dfd94c 100644 --- a/sys/netpfil/pf/pf_syncookies.c +++ b/sys/netpfil/pf/pf_syncookies.c @@ -201,9 +201,6 @@ pf_set_syncookies(struct pfioc_nv *nv) return (ENOMEM); nvlpacked = malloc(nv->len, M_NVLIST, M_WAITOK); - if (nvlpacked == NULL) - return (ENOMEM); - error = copyin(nv->data, nvlpacked, nv->len); if (error) ERROUT(error);