Bug 199559 - [patch][regression] ggatel(8) broken on i386 after r238119
Summary: [patch][regression] ggatel(8) broken on i386 after r238119
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.1-RELEASE
Hardware: i386 Any
: --- Affects Only Me
Assignee: Christian Brueffer
URL:
Keywords: patch, regression
Depends on:
Blocks:
 
Reported: 2015-04-20 13:46 UTC by Fabian Keil
Modified: 2015-07-21 14:28 UTC (History)
1 user (show)

See Also:


Attachments
ggatel: In g_gatel_create(), don't pass stack garbage to the kernel (917 bytes, patch)
2015-04-20 13:46 UTC, Fabian Keil
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Keil 2015-04-20 13:46:46 UTC
Created attachment 155770 [details]
ggatel: In g_gatel_create(), don't pass stack garbage to the kernel

r238119 broke ggatel(8) on i386.

"ggatel create ..." passes stack garbage to the kernel,
the ioctl fails and no provider is created:

Apr 20 13:09:52 electrobsd-r51 ggatel: ggatel: ioctl(/dev/ggctl): Invalid argument.
Apr 20 13:09:52 electrobsd-r51 ggatel: Exiting.

This is the same issue as reported in #197309 for ggatec(8).

The attached patch fixes this.

Obtained from: ElectroBSD
Comment 1 commit-hook freebsd_committer 2015-07-14 10:49:55 UTC
A commit references this bug:

Author: brueffer
Date: Tue Jul 14 10:49:37 UTC 2015
New revision: 285531
URL: https://svnweb.freebsd.org/changeset/base/285531

Log:
  Unbreak ggatec and ggatel on i386 after r238119, which added two more
  'struct g_gate_ctl_create' fields.

  While the behaviour was technically undefined on other architectures
  as well, on the reporter's amd64 systems the uninitialized bytes the
  kernel cares about were always zero so everything worked as expected.

  PR:		197309, 199559
  Submitted by:	ota@j.email.ne.jp, Fabian Keil
  Reviewed by:	pjd
  MFC after:	1 week

Changes:
  head/sbin/ggate/ggatec/ggatec.c
  head/sbin/ggate/ggatel/ggatel.c
Comment 2 Christian Brueffer freebsd_committer 2015-07-14 10:52:02 UTC
Fixed in HEAD, I'll MFC this in a week.  Thanks!
Comment 3 commit-hook freebsd_committer 2015-07-21 14:25:37 UTC
A commit references this bug:

Author: brueffer
Date: Tue Jul 21 14:25:22 UTC 2015
New revision: 285748
URL: https://svnweb.freebsd.org/changeset/base/285748

Log:
  MFC: r285531

  Unbreak ggatec and ggatel on i386 after r238119, which added two more
  'struct g_gate_ctl_create' fields.

  While the behaviour was technically undefined on other architectures
  as well, on the reporter's amd64 systems the uninitialized bytes the
  kernel cares about were always zero so everything worked as expected.

  PR:		197309, 199559
  Submitted by:	ota@j.email.ne.jp, Fabian Keil
  Reviewed by:	pjd
  Approved by:	re (gjb)

Changes:
_U  stable/10/
  stable/10/sbin/ggate/ggatec/ggatec.c
  stable/10/sbin/ggate/ggatel/ggatel.c
Comment 4 Christian Brueffer freebsd_committer 2015-07-21 14:28:57 UTC
Merge done; thanks again!