Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
ffdbb155d4
!53 fix up parsing in radiusclient.conf
From: @eaglegai 
Reviewed-by: @jiangheng12 
Signed-off-by: @jiangheng12
2025-02-14 07:58:04 +00:00
eaglegai
4a5988c498 fix up parsing in radiusclient.conf and add check for struct sockaddr_ll 2025-02-14 07:20:30 +00:00
openeuler-ci-bot
a8834d4c5b
!42 [sync] PR-38: correct patch names and commit messages
From: @openeuler-sync-bot 
Reviewed-by: @robertxw 
Signed-off-by: @robertxw
2023-09-12 06:16:44 +00:00
xingwei
5be0914fc5 correct patch names and commit messages
(cherry picked from commit 015a34a11baa4c8e66b0416f8a674c9f84ac4810)
2023-09-12 11:37:40 +08:00
openeuler-ci-bot
c553e249f3
!31 [sync] PR-30: add fclose operation to fix file pointer not closed after use
From: @openeuler-sync-bot 
Reviewed-by: @seuzw 
Signed-off-by: @seuzw
2023-03-11 07:53:32 +00:00
xingwei
45e587e5bf add fclose operation to fix file pointer not closed after use
(cherry picked from commit 0f942e3092a69e66fb48c6865da10cbe0c1119df)
2023-03-11 11:07:57 +08:00
openeuler-ci-bot
ca378bce24
!23 [sync] PR-18: fix CVE-2022-4603
From: @openeuler-sync-bot 
Reviewed-by: @seuzw 
Signed-off-by: @seuzw
2023-01-03 06:54:42 +00:00
eaglegai
679bf6b663 fix CVE-2022-4603
(cherry picked from commit 3b10003a78afbdbedfa3dc57a451a118b7963083)
2022-12-29 14:19:16 +08:00
openeuler-ci-bot
c9b8a72d34
!17 [sync] PR-16: pppd: Negotiate IP address when only peer addresses are provided
From: @openeuler-sync-bot 
Reviewed-by: @seuzw 
Signed-off-by: @seuzw
2022-10-20 08:08:57 +00:00
eaglegai
74d30bbdf2 pppd: Negotiate IP address when only peer addresses are provided
(cherry picked from commit 46bea0472c60109882b96095042ffaf6a278653f)
2022-10-20 15:40:27 +08:00
5 changed files with 301 additions and 3 deletions

View File

@ -0,0 +1,45 @@
From a75fb7b198eed50d769c80c36629f38346882cbf Mon Sep 17 00:00:00 2001
From: Paul Mackerras <paulus@ozlabs.org>
Date: Thu, 4 Aug 2022 12:23:08 +1000
Subject: [PATCH] pppdump: Avoid out-of-range access to packet buffer
This fixes a potential vulnerability where data is written to spkt.buf
and rpkt.buf without a check on the array index. To fix this, we
check the array index (pkt->cnt) before storing the byte or
incrementing the count. This also means we no longer have a potential
signed integer overflow on the increment of pkt->cnt.
Fortunately, pppdump is not used in the normal process of setting up a
PPP connection, is not installed setuid-root, and is not invoked
automatically in any scenario that I am aware of.
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
---
pppdump/pppdump.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/pppdump/pppdump.c b/pppdump/pppdump.c
index 2b815fc9..b85a8627 100644
--- a/pppdump/pppdump.c
+++ b/pppdump/pppdump.c
@@ -297,6 +297,10 @@ dumpppp(f)
printf("%s aborted packet:\n ", dir);
q = " ";
}
+ if (pkt->cnt >= sizeof(pkt->buf)) {
+ printf("%s over-long packet truncated:\n ", dir);
+ q = " ";
+ }
nb = pkt->cnt;
p = pkt->buf;
pkt->cnt = 0;
@@ -400,7 +404,8 @@ dumpppp(f)
c ^= 0x20;
pkt->esc = 0;
}
- pkt->buf[pkt->cnt++] = c;
+ if (pkt->cnt < sizeof(pkt->buf))
+ pkt->buf[pkt->cnt++] = c;
break;
}
}

View File

@ -0,0 +1,49 @@
From 7f89208b860ea0c41636410bfdb6a609b2772f47 Mon Sep 17 00:00:00 2001
From: Eivind Naess <eivnaes@yahoo.com>
Date: Sun, 23 Apr 2023 11:37:01 -0700
Subject: [PATCH] Closes #411, Fixing up parsing in radiusclient.conf
Adding curly braces to fix the code.
Signed-off-by: Eivind Naess <eivnaes@yahoo.com>
---
pppd/plugins/radius/config.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/pppd/plugins/radius/config.c b/pppd/plugins/radius/config.c
index 39744fca1..e1a481487 100644
--- a/pppd/plugins/radius/config.c
+++ b/pppd/plugins/radius/config.c
@@ -235,24 +235,28 @@ int rc_read_config(char *filename)
switch (option->type) {
case OT_STR:
- if (set_option_str(filename, line, option, p) < 0)
+ if (set_option_str(filename, line, option, p) < 0) {
fclose(configfd);
return (-1);
+ }
break;
case OT_INT:
- if (set_option_int(filename, line, option, p) < 0)
+ if (set_option_int(filename, line, option, p) < 0) {
fclose(configfd);
return (-1);
+ }
break;
case OT_SRV:
- if (set_option_srv(filename, line, option, p) < 0)
+ if (set_option_srv(filename, line, option, p) < 0) {
fclose(configfd);
return (-1);
+ }
break;
case OT_AUO:
- if (set_option_auo(filename, line, option, p) < 0)
+ if (set_option_auo(filename, line, option, p) < 0) {
fclose(configfd);
return (-1);
+ }
break;
default:
fatal("rc_read_config: impossible case branch!");

View File

@ -0,0 +1,82 @@
From 883a65eee0ea9de6aa843614bc2a97bc1dd3ccd2 Mon Sep 17 00:00:00 2001
From: Bmo <35866749+XWwalker@users.noreply.github.com>
Date: Sat, 18 Mar 2023 06:20:43 +0800
Subject: [PATCH] radius plugin: add fclose operation to fix file pointer not
closed after use (#401)
Signed-off-by: Wei Xing <skyxwwalker@gmail.com>
Co-authored-by: Wei Xing <skyxwwalker@gmail.com>
Conflict: NA
Reference: https://github.com/ppp-project/ppp/commit/883a65eee0ea9de6aa843614bc2a97bc1dd3ccd2
---
pppd/plugins/radius/clientid.c | 2 ++
pppd/plugins/radius/config.c | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/pppd/plugins/radius/clientid.c b/pppd/plugins/radius/clientid.c
index b1bbc474..eea51650 100644
--- a/pppd/plugins/radius/clientid.c
+++ b/pppd/plugins/radius/clientid.c
@@ -68,6 +68,7 @@ int rc_read_mapfile(char *filename)
if ((p = (struct map2id_s *)malloc(sizeof(*p))) == NULL) {
novm("rc_read_mapfile");
+ fclose(mapfd);
return (-1);
}
@@ -79,6 +80,7 @@ int rc_read_mapfile(char *filename)
} else {
error("rc_read_mapfile: malformed line in %s, line %d", filename, lnr);
+ fclose(mapfd);
return (-1);
}
diff --git a/pppd/plugins/radius/config.c b/pppd/plugins/radius/config.c
index 47c172cc..39744fca 100644
--- a/pppd/plugins/radius/config.c
+++ b/pppd/plugins/radius/config.c
@@ -212,6 +212,7 @@ int rc_read_config(char *filename)
if ((pos = strcspn(p, "\t ")) == 0) {
error("%s: line %d: bogus format: %s", filename, line, p);
+ fclose(configfd);
return (-1);
}
@@ -224,6 +225,7 @@ int rc_read_config(char *filename)
if (option->status != ST_UNDEF) {
error("%s: line %d: duplicate option line: %s", filename, line, p);
+ fclose(configfd);
return (-1);
}
@@ -234,18 +236,22 @@ int rc_read_config(char *filename)
switch (option->type) {
case OT_STR:
if (set_option_str(filename, line, option, p) < 0)
+ fclose(configfd);
return (-1);
break;
case OT_INT:
if (set_option_int(filename, line, option, p) < 0)
+ fclose(configfd);
return (-1);
break;
case OT_SRV:
if (set_option_srv(filename, line, option, p) < 0)
+ fclose(configfd);
return (-1);
break;
case OT_AUO:
if (set_option_auo(filename, line, option, p) < 0)
+ fclose(configfd);
return (-1);
break;
default:

View File

@ -0,0 +1,86 @@
From a2094eba2406392a7bb69b436155e2d08ea555e8 Mon Sep 17 00:00:00 2001
From: pali <7141871+pali@users.noreply.github.com>
Date: Tue, 26 Jan 2021 03:55:25 +0100
Subject: [PATCH] pppd: Negotiate IP address when only peer addresses are
provided (#236)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
This fixes special case when both ppp ends are configured to send only IP
address of other side and do not send its own IP address. Such setup is
correct because both ends can exchange its IP addresses and therefore they
have full information, they known both local and remote address.
This issue can be triggered by calling pppd with arguments:
./pppd debug local noauth nolock nodetach asyncmap 0 default-asyncmap novj noaccomp nopcomp nodeflate nobsdcomp nomagic noipv6 noipdefault nosendip :10.0.0.1 pty "./pppd debug local noauth nolock nodetach asyncmap 0 default-asyncmap novj noaccomp nopcomp nodeflate nobsdcomp nomagic noipv6 nosendip nodefaultroute :10.0.0.2 notty"
Without this patch IP addresses are not exchanges at all and pppd fails:
rcvd [LCP ConfReq id=0x1]
sent [LCP ConfReq id=0x1]
sent [LCP ConfAck id=0x1]
rcvd [LCP ConfAck id=0x1]
sent [LCP EchoReq id=0x0 magic=0x0]
sent [IPCP ConfReq id=0x1]
rcvd [LCP EchoReq id=0x0 magic=0x0]
sent [LCP EchoRep id=0x0 magic=0x0]
rcvd [IPCP ConfReq id=0x1]
sent [IPCP ConfAck id=0x1]
rcvd [LCP EchoRep id=0x0 magic=0x0]
rcvd [IPCP ConfAck id=0x1]
Could not determine local IP address
After applying this patch exchanging of IP addresses is working fine:
rcvd [LCP ConfReq id=0x1]
sent [LCP ConfReq id=0x1]
sent [LCP ConfAck id=0x1]
rcvd [LCP ConfAck id=0x1]
sent [LCP EchoReq id=0x0 magic=0x0]
sent [IPCP ConfReq id=0x1]
rcvd [LCP EchoReq id=0x0 magic=0x0]
sent [LCP EchoRep id=0x0 magic=0x0]
rcvd [IPCP ConfReq id=0x1]
sent [IPCP ConfNak id=0x1 <addr 10.0.0.1>]
rcvd [LCP EchoRep id=0x0 magic=0x0]
rcvd [IPCP ConfNak id=0x1 <addr 10.0.0.2>]
sent [IPCP ConfReq id=0x2 <addr 10.0.0.2>]
rcvd [IPCP ConfReq id=0x2 <addr 10.0.0.1>]
sent [IPCP ConfAck id=0x2 <addr 10.0.0.1>]
rcvd [IPCP ConfAck id=0x2 <addr 10.0.0.2>]
local IP address 10.0.0.2
remote IP address 10.0.0.1
Signed-off-by: Pali Rohár <pali@kernel.org>
---
pppd/ipcp.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/pppd/ipcp.c b/pppd/ipcp.c
index fcf17b1e..d17dbd28 100644
--- a/pppd/ipcp.c
+++ b/pppd/ipcp.c
@@ -678,8 +678,9 @@ ipcp_resetci(fsm *f)
ipcp_options *go = &ipcp_gotoptions[f->unit];
ipcp_options *ao = &ipcp_allowoptions[f->unit];
- wo->req_addr = (wo->neg_addr || wo->old_addrs) &&
- (ao->neg_addr || ao->old_addrs);
+ wo->req_addr = ((wo->neg_addr || wo->old_addrs) &&
+ (ao->neg_addr || ao->old_addrs)) ||
+ (wo->hisaddr && !wo->accept_remote);
if (wo->ouraddr == 0)
wo->accept_local = 1;
if (wo->hisaddr == 0)
@@ -1648,7 +1649,8 @@ ipcp_reqci(fsm *f, u_char *inp, int *len, int reject_if_disagree)
* option safely.
*/
if (rc != CONFREJ && !ho->neg_addr && !ho->old_addrs &&
- wo->req_addr && !reject_if_disagree && !noremoteip) {
+ wo->req_addr && !reject_if_disagree &&
+ ((wo->hisaddr && !wo->accept_remote) || !noremoteip)) {
if (rc == CONFACK) {
rc = CONFNAK;
ucp = inp; /* reset pointer */

View File

@ -1,6 +1,6 @@
Name: ppp
Version: 2.4.8
Release: 2
Release: 7
Summary: The Point-to-Point Protocol
License: BSD and LGPLv2+ and GPLv2+ and Public Domain
@ -55,8 +55,13 @@ Patch0024: 0024-build-sys-install-pppoatm-plugin-files-with-standard.patch
Patch0025: ppp-2.4.8-pppd-install-pppd-binary-using-standard-perms-755.patch
Patch0026: ppp-2.4.8-eaptls-mppe-1.102.patch
Patch6000: ppp-CVE-2015-3310.patch
Patch6001: ppp-CVE-2020-8597.patch
Patch0027: ppp-CVE-2015-3310.patch
Patch0028: ppp-CVE-2020-8597.patch
Patch0029: backport-pppd-Negotiate-IP-address-when-only-peer-addresses-are-provided.patch
Patch0030: backport-CVE-2022-4603.patch
Patch0031: backport-add-fclose-operation-to-fix-file-pointer-not-closed.patch
Patch0032: backport-Fixing-up-parsing-in-radiusclient.conf.patch
%description
The Point-to-Point Protocol (PPP) provides a standard way to establish
@ -153,6 +158,37 @@ mkdir -p %{buildroot}%{_rundir}/lock/ppp
%{_mandir}/man8/*.8.gz
%changelog
* Fri Feb 14 2025 gaihuiying <eaglegai@163.com> - 2.4.8-7
- Type:bugfix
- CVE:NA
- SUG:NA
- DESC:backport upstream
Fixing up parsing in radiusclient.conf
* Mon Sep 11 2023 xingwei <xingwei14@h-partners.com> - 2.4.8-6
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:correct patch names and commit messages
* Fri Mar 10 2023 xingwei <xingwei14@h-partners.com> - 2.4.8-5
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:add fclose operation to fix file pointer not closed after use
* Thu Dec 29 2022 gaihuiying <eaglegai@163.com> - 2.4.8-4
- Type:cves
- ID:NA
- SUG:NA
- DESC:fix CVE-2022-4603
* Wed Oct 19 2022 gaihuiying <eaglegai@163.com> - 2.4.8-3
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:pppd: Negotiate IP address when only peer addresses are provided
* Tue Sep 06 2022 gaihuiying <eaglegai@163.com> - 2.4.8-2
- Type:bugfix
- ID:NA