commit-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] GNU Inetutils branch, master, updated. v1.9.4.90-15-ga68717a


From: Simon Josefsson
Subject: [SCM] GNU Inetutils branch, master, updated. v1.9.4.90-15-ga68717a
Date: Fri, 29 Jan 2021 03:07:25 -0500 (EST)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Inetutils ".

The branch, master has been updated
       via  a68717a4e573a4d406ce91cdd1de4d06abf95353 (commit)
      from  d92d17e98af1ae393bb9762112519a7bedbe1a8f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/inetutils.git/commit/?id=a68717a4e573a4d406ce91cdd1de4d06abf95353


commit a68717a4e573a4d406ce91cdd1de4d06abf95353
Author: Simon Josefsson <simon@josefsson.org>
Date:   Fri Jan 29 08:49:44 2021 +0100

    ping6: Don't allow unprivileged users to flood ping.
    
    * ping/ping6.c (parse_opt): For non-root users, limit interval
    like ping.c to avoid DoS.  Reported in
    <https://bugs.debian.org/926750>.
    * ping/ping_common.h (PING_MIN_USER_INTERVAL): Add.
    * ping/ping.c (MIN_USER_INTERVAL): Remove, replaced by
    PING_MIN_USER_INTERVAL.
    (parse_opt): Update use.

diff --git a/ChangeLog b/ChangeLog
index 6f2207e..83216e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2021-01-29  Simon Josefsson  <simon@josefsson.org>
+
+       ping6: Don't allow unprivileged users to flood ping.
+
+       * ping/ping6.c (parse_opt): For non-root users, limit interval
+       like ping.c to avoid DoS.  Reported in
+       <https://bugs.debian.org/926750>.
+       * ping/ping_common.h (PING_MIN_USER_INTERVAL): Add.
+       * ping/ping.c (MIN_USER_INTERVAL): Remove, replaced by
+       PING_MIN_USER_INTERVAL.
+       (parse_opt): Update use.
+
 2021-01-28  Simon Josefsson  <simon@josefsson.org>
 
        * telnet/commands.c (logoutcmd): Renamed from logout.  Conflicts
diff --git a/ping/ping.c b/ping/ping.c
index 552230e..149df74 100644
--- a/ping/ping.c
+++ b/ping/ping.c
@@ -80,8 +80,6 @@ int (*decode_type (const char *arg)) (char *hostname);
 static int decode_ip_timestamp (char *arg);
 static int send_echo (PING * ping);
 
-#define MIN_USER_INTERVAL (200000/PING_PRECISION)
-
 const char args_doc[] = "HOST ...";
 const char doc[] = "Send ICMP ECHO_REQUEST packets to network hosts."
                    "\vOptions marked with (root only) are available only to "
@@ -168,7 +166,7 @@ parse_opt (int key, char *arg, struct argp_state *state)
         argp_error (state, "invalid value (`%s' near `%s')", arg, endptr);
       options |= OPT_INTERVAL;
       interval = v * PING_PRECISION;
-      if (!is_root && interval < MIN_USER_INTERVAL)
+      if (!is_root && interval < PING_MIN_USER_INTERVAL)
         error (EXIT_FAILURE, 0, "option value too small: %s", arg);
       break;
 
diff --git a/ping/ping6.c b/ping/ping6.c
index c2dfa55..ffa85b3 100644
--- a/ping/ping6.c
+++ b/ping/ping6.c
@@ -163,6 +163,9 @@ parse_opt (int key, char *arg, struct argp_state *state)
     case 'i':
       options |= OPT_INTERVAL;
       interval = ping_cvt_number (arg, 0, 0);
+      interval *= PING_PRECISION;
+      if (!is_root && interval < PING_MIN_USER_INTERVAL)
+       error (EXIT_FAILURE, 0, "option value too small: %s", arg);
       break;
 
     case 'l':
diff --git a/ping/ping_common.h b/ping/ping_common.h
index 781456c..65e3e60 100644
--- a/ping/ping_common.h
+++ b/ping/ping_common.h
@@ -75,6 +75,9 @@ struct ping_stat
   (t).tv_usec = ((i)%PING_PRECISION)*(1000000/PING_PRECISION) ;\
 } while (0)
 
+
+#define PING_MIN_USER_INTERVAL (200000/PING_PRECISION)
+
 /* FIXME: Adjust IPv6 case for options and their consumption.  */
 #define _PING_BUFLEN(p, u) ((u)? ((p)->ping_datalen + sizeof (struct 
icmp6_hdr)) : \
                                   (MAXIPLEN + (p)->ping_datalen + ICMP_TSLEN))

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog          | 12 ++++++++++++
 ping/ping.c        |  4 +---
 ping/ping6.c       |  3 +++
 ping/ping_common.h |  3 +++
 4 files changed, 19 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GNU Inetutils 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]