NetBSD Problem Report #54627

From ncadmin@nagler-company.com  Fri Oct 18 13:01:05 2019
Return-Path: <ncadmin@nagler-company.com>
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 CB2347A173
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 18 Oct 2019 13:01:05 +0000 (UTC)
Message-Id: <201910181131.x9IBVGJZ000946@s048.nagler-company.com>
Date: Fri, 18 Oct 2019 13:31:16 +0200 (CEST)
From: ncadmin@nagler-company.com
Reply-To: ncadmin@nagler-company.com
To: gnats-bugs@NetBSD.org
Cc: it-infra@nagler-company.com
Subject: MySql-5.7 - bad pkgsrc-patch
X-Send-Pr-Version: 3.95

>Number:         54627
>Category:       pkg
>Synopsis:       mysql57: current-pkgsrc-patch lead to random data passed to kqueue call
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 18 13:05:00 +0000 2019
>Last-Modified:  Fri Aug 14 01:21:47 +0000 2020
>Originator:     Wolfgang Stukenbrock
>Release:        NetBSD 8.1_STABLE / pkgsrc-2019Q2
>Organization:
Dr. Nagler & Comapny GmbH

>Environment:


System: NetBSD s048 8.1_STABLE NetBSD 8.1_STABLE (NSW-S050) #19: Thu Oct 17 10:04:17 CEST 2019 cawinkle@s012:/export2/NetBSD-8.0/N+C-build/.OBJDIR_amd64/export2/NetBSD-8.0/src/sys/arch/amd64/compile/NSW-S050 amd64
Architecture: x86_64
Machine: amd64
>Description:
	netbsd does not support EVFILT_USER macro in contents kernel-queue.
	Someone has added a patch to mysql57-server (and client) that simply avoids use of the macro.
	Accedently now some uninitializd data is passsed to kqueue() call.
	Here (one of) the affected code parts: (from mysys/kqueue_timers.c)

static int
start_helper_thread(void)
{
  struct kevent kev;

#ifdef EVFILT_USER
  EV_SET(&kev, 0, EVFILT_USER, EV_ADD, 0, 0, 0);
#endif

  if (kevent(kq_fd, &kev, 1, NULL, 0, NULL) < 0)
  {
    my_message_local(ERROR_LEVEL, "Failed to create event (errno= %d).", errno);
    return -1;
  }

  return mysql_thread_create(key_thread_timer_notifier, &timer_notify_thread,
                             NULL, timer_notify_thread_func, NULL);
}

	The patch added the #ifdef and now variable kev is not initialized anymore ...
	In most cases this will simply lead to errno = 22 message, but it may do 'something' if the
	random data is not invalid.
>How-To-Repeat:
	Compile and install mysql57-server. start it. you will see the ERROR messages with errno = 22
>Fix:
	Do not simply include setup-macro with patch, make shure that whole routine is disabled.
	(or implement EVFILT_USER in NetBSD ...)

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: gnats-admin->pkg-manager
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Fri, 14 Aug 2020 01:21:47 +0000
Responsible-Changed-Why:
PR landed in "pending" for no visible reason


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: gnats-precook-prs,v 1.4 2018/12/21 14:20:20 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.