From nobody Tue Sep 03 10:26:51 2024 X-Original-To: dev-commits-src-main@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 4Wyhcq6wvWz5MkLP; Tue, 03 Sep 2024 10:26:51 +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 4Wyhcq36TCz4rhH; Tue, 3 Sep 2024 10:26:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359211; 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=e9uCwRm4T9EyDLb3h0uteOIx6RYCnAEKW+UdnAAs3ts=; b=pG0RfAspWc/sZbQmZBwByhutExCJcK42gNCoMjErPTKMA21Ydn5fY4/wDOH7np0cRXjh5m 6cyTdmgzwDJ2SHUvkU432nj5FRXLwB+irZvl++Z8sDHH8CdrPRd0G2txGg4TrHt+jUFEjl H+UAMODsX3pOTIljV+19kvcNeBFVVDOncjZuKiFR95JAAS6zaMR30zCA2xpjGNECmYx0Dz akHxvTdzrVr07GNBWYlVUyg8RyG355oj5NsWh+FSjgcqQjc0C0c/wRLEQTYLPGwJpufbGr PMZDI//boFRfsYE5IIAc2I+d1j7ODtjuivPKhG5jNgmOm5/XFgBcwnJ9zuilWQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725359211; a=rsa-sha256; cv=none; b=w6XNanf+lD3JQbAFpNQ2DN7C2+PsCuuvVMzot/6EpOzZ+gXV8skjX7uMX3QrNBGqJoBa4P FSADIvlz9BYH06cnb39eqazB2OUu76965PG2WoGGUt6w6hnsRp0mz53892tf1kfsKF94JL YiKVNodaae2dUiu9AFazjqwA5nQgnP7pitj9RFJrd5LkpxyZqrpHgAmfLkXUUnrj2H72WW TVOGu+azbANCFIDdATHW9z8ZnxZ+xxfiByzr1FimEh1IpxGK3p3Pvm1dAUnt+zXZNkRbNI GBgdz2zqgvDWLVl06CbMeXvcoWatW/fzCuRECPcGlkmy1m+5417Xh3mkecftqw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725359211; 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=e9uCwRm4T9EyDLb3h0uteOIx6RYCnAEKW+UdnAAs3ts=; b=u+ikqIvFwQmD+x/GC0e3hGtAKYIlryKGKQ4YnMJrUWzpVRCUjUTzrfe9o5Pf67YaRkfcqe LaJLtE4Pqp3Gj073b1p3iNYcfc4a/sz3Xpb1oRCHwCGLHVAXzf3GC2nbtIfkNi9Wd83097 ppsFTbX4YerBLQ9ZRzXpmy1l4iUnm4TR6t+9shr5k9xDEeBBg3XhemSRIm5lQG4DM1JS5e pmmNx5Syuc1CqTzgEXla4XCFYOIkzP18H56pwO4kYalS4rD29KoJnuZlgcS5Ogo2Sx24+L RotbF2NdrwLKIoeP+HWprwgyMlWGYm5Cxpi6Mf8Ygz/qahZGA+n0NFkXJN+lRw== 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 4Wyhcq2W11zcLD; Tue, 3 Sep 2024 10:26:51 +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 483AQpW4009060; Tue, 3 Sep 2024 10:26:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 483AQpDs009057; Tue, 3 Sep 2024 10:26:51 GMT (envelope-from git) Date: Tue, 3 Sep 2024 10:26:51 GMT Message-Id: <202409031026.483AQpDs009057@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 5b00557330b3 - main - pf: Stop checking for failures from malloc(M_WAITOK) List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 5b00557330b3b69db84969e33f2e201288208dd9 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=5b00557330b3b69db84969e33f2e201288208dd9 commit 5b00557330b3b69db84969e33f2e201288208dd9 Author: Zhenlei Huang AuthorDate: 2024-09-03 10:25:20 +0000 Commit: Zhenlei Huang CommitDate: 2024-09-03 10:25:20 +0000 pf: Stop checking for failures from malloc(M_WAITOK) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D45852 --- 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 d22ffc2245cb..64086bf08871 100644 --- a/sys/netpfil/pf/pf_ioctl.c +++ b/sys/netpfil/pf/pf_ioctl.c @@ -2823,9 +2823,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); @@ -2903,9 +2900,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); @@ -3003,9 +2997,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); @@ -3036,8 +3027,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); @@ -3136,9 +3125,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); @@ -3214,9 +3200,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); @@ -3409,9 +3392,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); @@ -6003,9 +5983,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); @@ -6131,9 +6108,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); @@ -6192,9 +6166,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); @@ -6253,9 +6224,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);