NetBSD Problem Report #54433
From htodd@i8u.org Fri Aug 2 22:15:48 2019
Return-Path: <htodd@i8u.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id BAE417A169
for <gnats-bugs@gnats.NetBSD.org>; Fri, 2 Aug 2019 22:15:47 +0000 (UTC)
Message-Id: <20190802221545.BBEFB16C95AC@chris.i8u.org>
Date: Fri, 2 Aug 2019 15:15:45 -0700 (PDT)
From: htodd@twofifty.com
Reply-To: htodd@twofifty.com
To: gnats-bugs@NetBSD.org
Subject: cron keeps crashing
X-Send-Pr-Version: 3.95
>Number: 54433
>Category: bin
>Synopsis: cron keeps crashing
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: bin-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Aug 02 22:20:00 +0000 2019
>Closed-Date: Mon Aug 05 17:54:20 +0000 2019
>Last-Modified: Mon Aug 05 17:55:01 +0000 2019
>Originator: Hisashi Todd Fujinaka
>Release: NetBSD 9.0_BETA
>Organization:
Hisashi T Fujinaka - htodd@twofifty.com
>Environment:
System: NetBSD chris.i8u.org 9.0_BETA NetBSD 9.0_BETA (CHRIS) #321: Wed Jul 31 17:09:31 PDT 2019 htodd@chris.i8u.org:/usr/obj/amd64/sys/arch/amd64/compile/CHRIS amd64
Architecture: x86_64
Machine: amd64
>Description:
Here's the backtrace:
#0 0x0000000107407a6b in safe_p (s=0x0, usernm=0x7189072ae7c8 "root")
at /usr/src/external/bsd/cron/bin/cron/../../dist/do_command.c:662
#1 read_data (e=e@entry=0x7189072b3700, mailto=0x0, usernm=usernm@entry=0x7189072ae7c8 "root", envp=envp@entry=0x7189072b3b40,
jobpid=6045, stdout_pipe=<optimized out>) at /usr/src/external/bsd/cron/bin/cron/../../dist/do_command.c:185
#2 0x0000000107404759 in child_process (e=0x7189072b3700) at /usr/src/external/bsd/cron/bin/cron/../../dist/do_command.c:632
#3 do_command (e=0x7189072b3700, u=<optimized out>) at /usr/src/external/bsd/cron/bin/cron/../../dist/do_command.c:62
#4 0x0000000107405f94 in job_runqueue () at /usr/src/external/bsd/cron/bin/cron/../../dist/job.c:80
#5 0x00000001074081c9 in main (argc=<optimized out>, argv=<optimized out>)
at /usr/src/external/bsd/cron/bin/cron/../../dist/cron.c:238
>How-To-Repeat:
I'm just running cron.
>Fix:
>Release-Note:
>Audit-Trail:
From: mlelstv@serpens.de (Michael van Elst)
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: bin/54433: cron keeps crashing
Date: Sat, 3 Aug 2019 06:46:17 -0000 (UTC)
htodd@twofifty.com writes:
>Here's the backtrace:
>#0 0x0000000107407a6b in safe_p (s=0x0, usernm=0x7189072ae7c8 "root")
> at /usr/src/external/bsd/cron/bin/cron/../../dist/do_command.c:662
>#1 read_data (e=e@entry=0x7189072b3700, mailto=0x0, usernm=usernm@entry=0x7189072ae7c8 "root", envp=envp@entry=0x7189072b3b40,
When mailto is an empty string, a NULL pointer is passed to safe_p().
This can happen when MAILTO is explicitely configured to be empty.
Previously the code (do_command.c 1.9) checked mailto before calling
safe_p.
Maybe:
Index: do_command.c
===================================================================
RCS file: /cvsroot/src/external/bsd/cron/dist/do_command.c,v
retrieving revision 1.13
diff -p -u -r1.13 do_command.c
--- do_command.c 14 Jun 2018 22:04:28 -0000 1.13
+++ do_command.c 3 Aug 2019 06:45:55 -0000
@@ -182,7 +182,7 @@ read_data(entry *e, const char *mailto,
/*
* Unsafe, disable mailing.
*/
- if (!safe_p(usernm, mailto))
+ if (mailto && !safe_p(usernm, mailto))
mailto = NULL;
/* if we are supposed to be mailing, MAILTO will
--
--
Michael van Elst
Internet: mlelstv@serpens.de
"A potential Snark may lurk in every tree."
From: "Christos Zoulas" <christos@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/54433 CVS commit: src/external/bsd/cron/dist
Date: Sat, 3 Aug 2019 03:06:48 -0400
Module Name: src
Committed By: christos
Date: Sat Aug 3 07:06:48 UTC 2019
Modified Files:
src/external/bsd/cron/dist: do_command.c
Log Message:
PR/54433: Hisashi Todd Fujinaka: Empty $MAILTO causes cron to crash
To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/external/bsd/cron/dist/do_command.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/54433 CVS commit: [netbsd-9] src/external/bsd/cron/dist
Date: Sun, 4 Aug 2019 19:22:24 +0000
Module Name: src
Committed By: martin
Date: Sun Aug 4 19:22:24 UTC 2019
Modified Files:
src/external/bsd/cron/dist [netbsd-9]: do_command.c
Log Message:
Pull up following revision(s) (requested by christos in ticket #13):
external/bsd/cron/dist/do_command.c: revision 1.14
PR/54433: Hisashi Todd Fujinaka: Empty $MAILTO causes cron to crash
To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.13.4.1 src/external/bsd/cron/dist/do_command.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
State-Changed-From-To: open->closed
State-Changed-By: htodd@NetBSD.org
State-Changed-When: Mon, 05 Aug 2019 17:54:20 +0000
State-Changed-Why:
Fixed in -current and pulled up to -9.
From: Hisashi T Fujinaka <htodd@twofifty.com>
To: gnats-bugs@netbsd.org
Cc: gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: bin/54433: cron keeps crashing
Date: Mon, 5 Aug 2019 10:53:31 -0700 (PDT)
Looks like this is fixed in -current and pulled up to -9, so I'll close
it.
--
Hisashi T Fujinaka - htodd@twofifty.com
BSEE + BSChem + BAEnglish + MSCS + $2.50 = coffee
>Unformatted:
(Contact us)
$NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.