svn commit: r198267 - head/usr.sbin/tzsetup

2009-10-20 Thread Edwin Groothuis
Author: edwin
Date: Tue Oct 20 06:54:31 2009
New Revision: 198267
URL: http://svn.freebsd.org/changeset/base/198267

Log:
  Instead of having to know which timezone was picked last time, you
  now can run tzsetup -r which will reinstall the last choice. This
  data is recorded in /var/db/zoneinfo.
  
  MFC after: 1 week

Modified:
  head/usr.sbin/tzsetup/tzsetup.8
  head/usr.sbin/tzsetup/tzsetup.c

Modified: head/usr.sbin/tzsetup/tzsetup.8
==
--- head/usr.sbin/tzsetup/tzsetup.8 Tue Oct 20 05:40:51 2009
(r198266)
+++ head/usr.sbin/tzsetup/tzsetup.8 Tue Oct 20 06:54:31 2009
(r198267)
@@ -31,7 +31,7 @@
 .Nd set local timezone
 .Sh SYNOPSIS
 .Nm
-.Op Fl ns
+.Op Fl nrs
 .Op Ar zoneinfo file
 .Sh DESCRIPTION
 The
@@ -51,6 +51,9 @@ The following option is available:
 .Bl -tag -offset indent -width Fl
 .It Fl n
 Do not create or copy files.
+.It Fl r
+Reinstall the zoneinfo file installed last time. The name is obtained from
+.Pa /var/db/zoneinfo .
 .It Fl s 
 Skip the initial question about adjusting the clock if not set to
 .Tn UTC .
@@ -106,6 +109,8 @@ mapping of
 directory for zoneinfo files
 .It Pa /usr/share/zoneinfo/zone.tab
 mapping of timezone file to country and location
+.It Pa /var/db/zoneinfo
+saved name of the timezone file installed last.
 .El
 .Sh SEE ALSO
 .Xr date 1 ,

Modified: head/usr.sbin/tzsetup/tzsetup.c
==
--- head/usr.sbin/tzsetup/tzsetup.c Tue Oct 20 05:40:51 2009
(r198266)
+++ head/usr.sbin/tzsetup/tzsetup.c Tue Oct 20 06:54:31 2009
(r198267)
@@ -45,6 +45,7 @@ __FBSDID($FreeBSD$);
 #include unistd.h
 
 #include sys/fcntl.h
+#include sys/param.h
 #include sys/queue.h
 #include sys/stat.h
 
@@ -52,9 +53,11 @@ __FBSDID($FreeBSD$);
 #define_PATH_ISO3166   /usr/share/misc/iso3166
 #define_PATH_ZONEINFO  /usr/share/zoneinfo
 #define_PATH_LOCALTIME /etc/localtime
+#define_PATH_DB/var/db/zoneinfo
 #define_PATH_WALL_CMOS_CLOCK   /etc/wall_cmos_clock
 
 static int reallydoit = 1;
+static int reinstall = 0;
 
 static voidusage(void);
 static int continent_country_menu(dialogMenuItem *);
@@ -495,13 +498,14 @@ set_zone_menu(dialogMenuItem *dmi)
 }
 
 static int
-install_zone_file(const char *filename)
+install_zone_file(const char *filename, int usedialog)
 {
charbuf[1024];
chartitle[64], prompt[64];
struct stat sb;
ssize_t len;
int fd1, fd2, copymode;
+   FILE*f;
 
if (lstat(_PATH_LOCALTIME, sb)  0) {
/* Nothing there yet... */
@@ -519,7 +523,10 @@ install_zone_file(const char *filename)
snprintf(prompt, sizeof(prompt),
Creating symbolic link  _PATH_LOCALTIME  to %s,
filename);
-   dialog_notify(prompt);
+   if (usedialog)
+   dialog_notify(prompt);
+   else
+   fprintf(stderr, %s\n, prompt);
 #endif
 
if (reallydoit) {
@@ -530,7 +537,10 @@ install_zone_file(const char *filename)
snprintf(prompt, sizeof(prompt),
Could not open %s: %s, filename,
strerror(errno));
-   dialog_mesgbox(title, prompt, 8, 72);
+   if (usedialog)
+   dialog_mesgbox(title, prompt, 8, 72);
+   else
+   fprintf(stderr, %s\n, prompt);
return (DITEM_FAILURE | DITEM_RECREATE);
}
 
@@ -542,7 +552,10 @@ install_zone_file(const char *filename)
snprintf(prompt, sizeof(prompt),
Could not open  _PATH_LOCALTIME : %s,
strerror(errno));
-   dialog_mesgbox(title, prompt, 8, 72);
+   if (usedialog)
+   dialog_mesgbox(title, prompt, 8, 72);
+   else
+   fprintf(stderr, %s\n, prompt);
return (DITEM_FAILURE | DITEM_RECREATE);
}
 
@@ -554,7 +567,10 @@ install_zone_file(const char *filename)
snprintf(prompt, sizeof(prompt),
Error copying %s to  _PATH_LOCALTIME
: %s, filename, strerror(errno));
-   dialog_mesgbox(title, prompt, 8, 72);
+   if (usedialog)
+   dialog_mesgbox(title, prompt, 8, 72);
+   

svn commit: r198268 - vendor/tzdata/dist

2009-10-20 Thread Edwin Groothuis
Author: edwin
Date: Tue Oct 20 07:00:00 2009
New Revision: 198268
URL: http://svn.freebsd.org/changeset/base/198268

Log:
  Vendor import of tzdata2009o:
  
  - Somoa has not moved to DST this year (comment only)
  - Bangladesh stays on DST for now.
  - Pakistan went back to standard time in 1 October 2009
  
  Obtained from:ftp://elsie.nci.nih.gov/pub/

Modified:
  vendor/tzdata/dist/asia
  vendor/tzdata/dist/australasia

Modified: vendor/tzdata/dist/asia
==
--- vendor/tzdata/dist/asia Tue Oct 20 06:54:31 2009(r198267)
+++ vendor/tzdata/dist/asia Tue Oct 20 07:00:00 2009(r198268)
@@ -1,5 +1,5 @@
 # pre
-# @(#)asia 8.41
+# @(#)asia 8.42
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -172,11 +172,30 @@ Zone  Asia/Bahrain3:22:20 -   LMT 1920
# 
 #
 # No DST end date has been announced yet.
 
-# From Arthur David Olson (2009-07-11):
-# Arbitrarily end DST at the end of 2009 so that a POSIX-sytle time zone string
-# can appear in the Dhaka binary file and for the benefit of old glibc
-# reimplementations of the time zone software that mishandle permanent DST.
-# A change will be required once the end date is known.
+# From Alexander Krivenyshev (2009-09-25):
+# Bangladesh won't go back to Standard Time from October 1, 2009, 
+# instead it will continue DST measure till the cabinet makes a fresh 
decision. 
+#
+# Following report by same newspaper-The Daily Star Friday:
+# DST change awaits cabinet decision-Clock won't go back by 1-hr from Oct 1
+# a href=http://www.thedailystar.net/newDesign/news-details.php?nid=107021;
+# http://www.thedailystar.net/newDesign/news-details.php?nid=107021
+# /a
+# or
+# a href=http://www.worldtimezone.com/dst_news/dst_news_bangladesh04.html;
+# http://www.worldtimezone.com/dst_news/dst_news_bangladesh04.html
+# /a
+
+# From Steffen Thorsen (2009-10-13):
+# IANS (Indo-Asian News Service) now reports:
+# Bangladesh has decided that the clock advanced by an hour to make 
+# maximum use of daylight hours as an energy saving measure would 
+# continue for an indefinite period.
+#
+# One of many places where it is published:
+# a 
href=http://www.thaindian.com/newsportal/business/bangladesh-to-continue-indefinitely-with-advanced-time_100259987.html;
+# 
http://www.thaindian.com/newsportal/business/bangladesh-to-continue-indefinitely-with-advanced-time_100259987.html
+# /a
 
 # Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
 Zone   Asia/Dhaka  6:01:40 -   LMT 1890
@@ -186,8 +205,7 @@ ZoneAsia/Dhaka  6:01:40 -   LMT 1890
6:30-   BURT1951 Sep 30
6:00-   DACT1971 Mar 26 # Dacca Time
6:00-   BDT 2009 Jun 19 23:00 # Bangladesh 
Time
-   6:001:00BDST2010
-   6:00-   BDT
+   6:001:00BDST
 
 # Bhutan
 # Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
@@ -1684,13 +1702,56 @@ ZoneAsia/Muscat 3:54:20 -   LMT 1920
 # http://www.thenews.com.pk/updates.asp?id=87168
 # /a
 
+# From Alexander Krivenyshev (2009-09-28):
+# According to Associated Press Of Pakistan, it is confirmed that
+# Pakistan clocks across the country would be turned back by an hour from 
October
+# 1, 2009.
+#
+# Clocks to go back one hour from 1 Oct
+# a 
href=http://www.app.com.pk/en_/index.php?option=com_contenttask=viewid=86715Itemid=2;
+# 
http://www.app.com.pk/en_/index.php?option=com_contenttask=viewid=86715Itemid=2
+# /a
+# or
+# a href=http://www.worldtimezone.com/dst_news/dst_news_pakistan07.htm;
+# http://www.worldtimezone.com/dst_news/dst_news_pakistan07.htm
+# /a
+
+# From Steffen Thorsen (2009-09-29):
+# Alexander Krivenyshev wrote:
+#  According to Associated Press Of Pakistan, it is confirmed that
+#  Pakistan clocks across the country would be turned back by an hour from 
October
+#  1, 2009.
+#
+# Now they seem to have changed their mind, November 1 is the new date:
+# a href=http://www.thenews.com.pk/top_story_detail.asp?Id=24742;
+# http://www.thenews.com.pk/top_story_detail.asp?Id=24742
+# /a
+# The country's clocks will be reversed by one hour on November 1.
+# Officials of Federal Ministry for Interior told this to Geo News on
+# Monday.
+#
+# And more importantly, it seems that these dates will be kept every year:
+# It has now been decided that clocks will be wound forward by one hour
+# on April 15 and reversed by an hour on November 1 every year without
+# obtaining prior approval, the officials added.
+#
+# We have confirmed this year's end date with both with the Ministry of
+# Water and Power and the Pakistan Electric Power Company:
+# a href=http://www.timeanddate.com/news/time/pakistan-ends-dst09.html;
+# 

svn commit: r198269 - vendor/tzdata/tzdata2009o

2009-10-20 Thread Edwin Groothuis
Author: edwin
Date: Tue Oct 20 07:00:56 2009
New Revision: 198269
URL: http://svn.freebsd.org/changeset/base/198269

Log:
  Tag of tzdata2009o

Added:
  vendor/tzdata/tzdata2009o/
 - copied from r198268, vendor/tzdata/dist/
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198270 - head/share/zoneinfo

2009-10-20 Thread Edwin Groothuis
Author: edwin
Date: Tue Oct 20 07:03:06 2009
New Revision: 198270
URL: http://svn.freebsd.org/changeset/base/198270

Log:
  MFV of tzdata2009o:
  
  - Somoa has not moved to DST this year (comment only)
  - Bangladesh stays on DST for now.
  - Pakistan went back to standard time in 1 October 2009
  
  MFC after:1 week

Modified:
  head/share/zoneinfo/   (props changed)
  head/share/zoneinfo/asia
  head/share/zoneinfo/australasia

Modified: head/share/zoneinfo/asia
==
--- head/share/zoneinfo/asiaTue Oct 20 07:00:56 2009(r198269)
+++ head/share/zoneinfo/asiaTue Oct 20 07:03:06 2009(r198270)
@@ -1,5 +1,5 @@
 # pre
-# @(#)asia 8.41
+# @(#)asia 8.42
 # This file is in the public domain, so clarified as of
 # 2009-05-17 by Arthur David Olson.
 
@@ -172,11 +172,30 @@ Zone  Asia/Bahrain3:22:20 -   LMT 1920
# 
 #
 # No DST end date has been announced yet.
 
-# From Arthur David Olson (2009-07-11):
-# Arbitrarily end DST at the end of 2009 so that a POSIX-sytle time zone string
-# can appear in the Dhaka binary file and for the benefit of old glibc
-# reimplementations of the time zone software that mishandle permanent DST.
-# A change will be required once the end date is known.
+# From Alexander Krivenyshev (2009-09-25):
+# Bangladesh won't go back to Standard Time from October 1, 2009, 
+# instead it will continue DST measure till the cabinet makes a fresh 
decision. 
+#
+# Following report by same newspaper-The Daily Star Friday:
+# DST change awaits cabinet decision-Clock won't go back by 1-hr from Oct 1
+# a href=http://www.thedailystar.net/newDesign/news-details.php?nid=107021;
+# http://www.thedailystar.net/newDesign/news-details.php?nid=107021
+# /a
+# or
+# a href=http://www.worldtimezone.com/dst_news/dst_news_bangladesh04.html;
+# http://www.worldtimezone.com/dst_news/dst_news_bangladesh04.html
+# /a
+
+# From Steffen Thorsen (2009-10-13):
+# IANS (Indo-Asian News Service) now reports:
+# Bangladesh has decided that the clock advanced by an hour to make 
+# maximum use of daylight hours as an energy saving measure would 
+# continue for an indefinite period.
+#
+# One of many places where it is published:
+# a 
href=http://www.thaindian.com/newsportal/business/bangladesh-to-continue-indefinitely-with-advanced-time_100259987.html;
+# 
http://www.thaindian.com/newsportal/business/bangladesh-to-continue-indefinitely-with-advanced-time_100259987.html
+# /a
 
 # Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
 Zone   Asia/Dhaka  6:01:40 -   LMT 1890
@@ -186,8 +205,7 @@ ZoneAsia/Dhaka  6:01:40 -   LMT 1890
6:30-   BURT1951 Sep 30
6:00-   DACT1971 Mar 26 # Dacca Time
6:00-   BDT 2009 Jun 19 23:00 # Bangladesh 
Time
-   6:001:00BDST2010
-   6:00-   BDT
+   6:001:00BDST
 
 # Bhutan
 # Zone NAMEGMTOFF  RULES   FORMAT  [UNTIL]
@@ -1684,13 +1702,56 @@ ZoneAsia/Muscat 3:54:20 -   LMT 1920
 # http://www.thenews.com.pk/updates.asp?id=87168
 # /a
 
+# From Alexander Krivenyshev (2009-09-28):
+# According to Associated Press Of Pakistan, it is confirmed that
+# Pakistan clocks across the country would be turned back by an hour from 
October
+# 1, 2009.
+#
+# Clocks to go back one hour from 1 Oct
+# a 
href=http://www.app.com.pk/en_/index.php?option=com_contenttask=viewid=86715Itemid=2;
+# 
http://www.app.com.pk/en_/index.php?option=com_contenttask=viewid=86715Itemid=2
+# /a
+# or
+# a href=http://www.worldtimezone.com/dst_news/dst_news_pakistan07.htm;
+# http://www.worldtimezone.com/dst_news/dst_news_pakistan07.htm
+# /a
+
+# From Steffen Thorsen (2009-09-29):
+# Alexander Krivenyshev wrote:
+#  According to Associated Press Of Pakistan, it is confirmed that
+#  Pakistan clocks across the country would be turned back by an hour from 
October
+#  1, 2009.
+#
+# Now they seem to have changed their mind, November 1 is the new date:
+# a href=http://www.thenews.com.pk/top_story_detail.asp?Id=24742;
+# http://www.thenews.com.pk/top_story_detail.asp?Id=24742
+# /a
+# The country's clocks will be reversed by one hour on November 1.
+# Officials of Federal Ministry for Interior told this to Geo News on
+# Monday.
+#
+# And more importantly, it seems that these dates will be kept every year:
+# It has now been decided that clocks will be wound forward by one hour
+# on April 15 and reversed by an hour on November 1 every year without
+# obtaining prior approval, the officials added.
+#
+# We have confirmed this year's end date with both with the Ministry of
+# Water and Power and the Pakistan Electric Power Company:
+# a href=http://www.timeanddate.com/news/time/pakistan-ends-dst09.html;
+# 

svn commit: r198271 - head/sys/i386/conf

2009-10-20 Thread Andriy Gapon
Author: avg
Date: Tue Oct 20 09:31:57 2009
New Revision: 198271
URL: http://svn.freebsd.org/changeset/base/198271

Log:
  add amdtemp to i386 NOTES
  
  essentially this is a MFamd64
  
  Nod from: rpaulo

Modified:
  head/sys/i386/conf/NOTES

Modified: head/sys/i386/conf/NOTES
==
--- head/sys/i386/conf/NOTESTue Oct 20 07:03:06 2009(r198270)
+++ head/sys/i386/conf/NOTESTue Oct 20 09:31:57 2009(r198271)
@@ -792,8 +792,10 @@ device ichwd
 # Temperature sensors:
 #
 # coretemp: on-die sensor on Intel Core and newer CPUs
+# amdtemp: on-die sensor on AMD K8/K10/K11 CPUs
 #
 device coretemp
+device amdtemp
 
 #
 # CPU control pseudo-device. Provides access to MSRs, CPUID info and
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198272 - head/share/man/man4

2009-10-20 Thread Andriy Gapon
Author: avg
Date: Tue Oct 20 09:32:22 2009
New Revision: 198272
URL: http://svn.freebsd.org/changeset/base/198272

Log:
  ichwd.4: remove a stray line
  
  Nod from: des
  MFC after:3 days

Modified:
  head/share/man/man4/ichwd.4

Modified: head/share/man/man4/ichwd.4
==
--- head/share/man/man4/ichwd.4 Tue Oct 20 09:31:57 2009(r198271)
+++ head/share/man/man4/ichwd.4 Tue Oct 20 09:32:22 2009(r198272)
@@ -66,7 +66,6 @@ it believes the WDT is disabled.
 .Sh SEE ALSO
 .Xr watchdog 4 ,
 .Xr watchdog 8 ,
-.Xr watchdogd 8,
 .Xr watchdog 9
 .Rs
 .%T Using the Intel ICH Family Watchdog Timer (WDT)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198276 - stable/8/bin/csh

2009-10-20 Thread Hajimu UMEMOTO
Author: ume
Date: Tue Oct 20 11:52:39 2009
New Revision: 198276
URL: http://svn.freebsd.org/changeset/base/198276

Log:
  MFC r198189: Check error of dlfunc(3).
  
  Approved by:  re (kib)

Modified:
  stable/8/bin/csh/   (props changed)
  stable/8/bin/csh/iconv_stub.c

Modified: stable/8/bin/csh/iconv_stub.c
==
--- stable/8/bin/csh/iconv_stub.c   Tue Oct 20 10:40:01 2009
(r198275)
+++ stable/8/bin/csh/iconv_stub.c   Tue Oct 20 11:52:39 2009
(r198276)
@@ -61,9 +61,20 @@ dl_iconv_open(const char *tocode, const 
if (iconvlib == NULL)
return (iconv_t)-1;
iconv_open = (iconv_open_t *)dlfunc(iconvlib, ICONV_OPEN);
+   if (iconv_open == NULL)
+   goto dlfunc_err;
dl_iconv = (dl_iconv_t *)dlfunc(iconvlib, ICONV_ENGINE);
+   if (dl_iconv == NULL)
+   goto dlfunc_err;
dl_iconv_close = (dl_iconv_close_t *)dlfunc(iconvlib,
ICONV_CLOSE);
+   if (dl_iconv_close == NULL)
+   goto dlfunc_err;
}
return iconv_open(tocode, fromcode);
+
+dlfunc_err:
+   dlclose(iconvlib);
+   iconvlib = NULL;
+   return (iconv_t)-1;
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198277 - head/sys/tools

2009-10-20 Thread Max Khon
Author: fjoe
Date: Tue Oct 20 11:54:06 2009
New Revision: 198277
URL: http://svn.freebsd.org/changeset/base/198277

Log:
  Allow KMOD with hypens and dots.
  
  MFC after:1 week

Modified:
  head/sys/tools/fw_stub.awk

Modified: head/sys/tools/fw_stub.awk
==
--- head/sys/tools/fw_stub.awk  Tue Oct 20 11:52:39 2009(r198276)
+++ head/sys/tools/fw_stub.awk  Tue Oct 20 11:54:06 2009(r198277)
@@ -118,6 +118,8 @@ if (!num_files || !opt_m)
 
 cfilename = opt_c;
 ctmpfilename = cfilename .tmp;
+modname = opt_m;
+gsub(/[-\.]/, _, modname);
 
 printc(#include sys/param.h\
 #include sys/errno.h\
@@ -139,7 +141,7 @@ for (file_i = 0; file_i  num_files; fil
 }
 
 printc(\nstatic int\n\
-opt_m _fw_modevent(module_t mod, int type, void *unused)\
+modname _fw_modevent(module_t mod, int type, void *unused)\
 {\
const struct firmware *fp, *parent;\
int error;\
@@ -206,14 +208,14 @@ printc(\t\treturn (error);\
return (EINVAL);\
 }\
 \
-static moduledata_t  opt_m _fw_mod = {\
-\ opt_m _fw\,\
- opt_m _fw_modevent,\
+static moduledata_t  modname _fw_mod = {\
+\ modname _fw\,\
+ modname _fw_modevent,\
 0\
 };\
-DECLARE_MODULE( opt_m _fw,  opt_m _fw_mod, SI_SUB_DRIVERS, 
SI_ORDER_FIRST);\
-MODULE_VERSION( opt_m _fw, 1);\
-MODULE_DEPEND( opt_m _fw, firmware, 1, 1, 1);\
+DECLARE_MODULE( modname _fw,  modname _fw_mod, SI_SUB_DRIVERS, 
SI_ORDER_FIRST);\
+MODULE_VERSION( modname _fw, 1);\
+MODULE_DEPEND( modname _fw, firmware, 1, 1, 1);\
 );
 
 if (opt_c)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198279 - in head: share/man/man4 sys/modules

2009-10-20 Thread Andriy Gapon
Author: avg
Date: Tue Oct 20 13:22:54 2009
New Revision: 198279
URL: http://svn.freebsd.org/changeset/base/198279

Log:
  minor: fix sorting of some amd* entries in some makefiles
  
  MFC after:1 week

Modified:
  head/share/man/man4/Makefile
  head/sys/modules/Makefile

Modified: head/share/man/man4/Makefile
==
--- head/share/man/man4/MakefileTue Oct 20 12:21:36 2009
(r198278)
+++ head/share/man/man4/MakefileTue Oct 20 13:22:54 2009
(r198279)
@@ -30,8 +30,8 @@ MAN=  aac.4 \
ale.4 \
altq.4 \
amd.4 \
-   ${_amdtemp.4} \
${_amdsmb.4} \
+   ${_amdtemp.4} \
amr.4 \
an.4 \
arcmsr.4 \

Modified: head/sys/modules/Makefile
==
--- head/sys/modules/Makefile   Tue Oct 20 12:21:36 2009(r198278)
+++ head/sys/modules/Makefile   Tue Oct 20 13:22:54 2009(r198279)
@@ -18,10 +18,10 @@ SUBDIR= ${_3dfx} \
${_aic} \
aic7xxx \
aio \
-   ${_amd} \
-   ${_amdtemp} \
alc \
ale \
+   ${_amd} \
+   ${_amdtemp} \
amr \
${_an} \
${_aout} \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198281 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci kern

2009-10-20 Thread Konstantin Belousov
Author: kib
Date: Tue Oct 20 13:30:06 2009
New Revision: 198281
URL: http://svn.freebsd.org/changeset/base/198281

Log:
  MFC r197932:
  Do not map elf segments of zero length.
  
  Approved by:  re (kensmith)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/kern/imgact_elf.c

Modified: stable/8/sys/kern/imgact_elf.c
==
--- stable/8/sys/kern/imgact_elf.c  Tue Oct 20 13:26:58 2009
(r198280)
+++ stable/8/sys/kern/imgact_elf.c  Tue Oct 20 13:30:06 2009
(r198281)
@@ -632,7 +632,8 @@ __elfN(load_file)(struct proc *p, const 
}
 
for (i = 0, numsegs = 0; i  hdr-e_phnum; i++) {
-   if (phdr[i].p_type == PT_LOAD) {/* Loadable segment */
+   if (phdr[i].p_type == PT_LOAD  phdr[i].p_memsz != 0) {
+   /* Loadable segment */
prot = 0;
if (phdr[i].p_flags  PF_X)
prot |= VM_PROT_EXECUTE;
@@ -761,6 +762,8 @@ __CONCAT(exec_, __elfN(imgact))(struct i
for (i = 0; i  hdr-e_phnum; i++) {
switch (phdr[i].p_type) {
case PT_LOAD:   /* Loadable segment */
+   if (phdr[i].p_memsz == 0)
+   break;
prot = 0;
if (phdr[i].p_flags  PF_X)
prot |= VM_PROT_EXECUTE;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198283 - in stable/8/sys: . amd64/include amd64/include/xen arm/include cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci i386/include ia64/include mips/include pow...

2009-10-20 Thread Konstantin Belousov
Author: kib
Date: Tue Oct 20 13:32:28 2009
New Revision: 198283
URL: http://svn.freebsd.org/changeset/base/198283

Log:
  MFC r197933:
  Define architectural load bases for PIE binaries.
  
  MFC r198203 (by marius):
  Change load base for sparc to match default gcc memory layout model.
  
  Approved by:  re (kensmith)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/elf.h
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/arm/include/elf.h
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/i386/include/elf.h
  stable/8/sys/ia64/include/elf.h
  stable/8/sys/mips/include/elf.h
  stable/8/sys/powerpc/include/elf.h
  stable/8/sys/sparc64/include/elf.h
  stable/8/sys/sun4v/include/elf.h

Modified: stable/8/sys/amd64/include/elf.h
==
--- stable/8/sys/amd64/include/elf.hTue Oct 20 13:32:18 2009
(r198282)
+++ stable/8/sys/amd64/include/elf.hTue Oct 20 13:32:28 2009
(r198283)
@@ -106,4 +106,10 @@ __ElfType(Auxinfo);
 #defineELF_TARG_MACH   EM_X86_64
 #defineELF_TARG_VER1
 
+#if __ELF_WORD_SIZE == 32
+#defineET_DYN_LOAD_ADDR 0x01001000
+#else
+#defineET_DYN_LOAD_ADDR 0x01021000
+#endif
+
 #endif /* !_MACHINE_ELF_H_ */

Modified: stable/8/sys/arm/include/elf.h
==
--- stable/8/sys/arm/include/elf.h  Tue Oct 20 13:32:18 2009
(r198282)
+++ stable/8/sys/arm/include/elf.h  Tue Oct 20 13:32:28 2009
(r198283)
@@ -97,4 +97,7 @@ __ElfType(Auxinfo);
  * value.
  */
 #define MAGIC_TRAMP_NUMBER 0x5c03
+
+#defineET_DYN_LOAD_ADDR 0x12000
+
 #endif /* !_MACHINE_ELF_H_ */

Modified: stable/8/sys/i386/include/elf.h
==
--- stable/8/sys/i386/include/elf.h Tue Oct 20 13:32:18 2009
(r198282)
+++ stable/8/sys/i386/include/elf.h Tue Oct 20 13:32:28 2009
(r198283)
@@ -105,4 +105,6 @@ __ElfType(Auxinfo);
 #defineELF_TARG_MACH   EM_386
 #defineELF_TARG_VER1
 
+#defineET_DYN_LOAD_ADDR 0x01001000
+
 #endif /* !_MACHINE_ELF_H_ */

Modified: stable/8/sys/ia64/include/elf.h
==
--- stable/8/sys/ia64/include/elf.h Tue Oct 20 13:32:18 2009
(r198282)
+++ stable/8/sys/ia64/include/elf.h Tue Oct 20 13:32:28 2009
(r198283)
@@ -141,4 +141,6 @@ __ElfType(Auxinfo);
 
 #defineDT_IA_64_PLT_RESERVE0x7000
 
+#defineET_DYN_LOAD_ADDR 0x2500
+
 #endif /* !_MACHINE_ELF_H_ */

Modified: stable/8/sys/mips/include/elf.h
==
--- stable/8/sys/mips/include/elf.h Tue Oct 20 13:32:18 2009
(r198282)
+++ stable/8/sys/mips/include/elf.h Tue Oct 20 13:32:28 2009
(r198283)
@@ -250,4 +250,6 @@ __ElfType(Auxinfo);
 
 #defineAT_COUNT16  /* Count of defined aux entry types. */
 
+#defineET_DYN_LOAD_ADDR 0x012
+
 #endif /* !_MACHINE_ELF_H_ */

Modified: stable/8/sys/powerpc/include/elf.h
==
--- stable/8/sys/powerpc/include/elf.h  Tue Oct 20 13:32:18 2009
(r198282)
+++ stable/8/sys/powerpc/include/elf.h  Tue Oct 20 13:32:28 2009
(r198283)
@@ -96,4 +96,6 @@ __ElfType(Auxinfo);
 #defineELF_TARG_MACH   EM_PPC
 #defineELF_TARG_VER1
 
+#defineET_DYN_LOAD_ADDR 0x0101
+
 #endif /* !_MACHINE_ELF_H_ */

Modified: stable/8/sys/sparc64/include/elf.h
==
--- stable/8/sys/sparc64/include/elf.h  Tue Oct 20 13:32:18 2009
(r198282)
+++ stable/8/sys/sparc64/include/elf.h  Tue Oct 20 13:32:28 2009
(r198283)
@@ -97,4 +97,6 @@ __ElfType(Auxinfo);
 #defineELF_TARG_MACH   ELF_ARCH
 #defineELF_TARG_VER1
 
+#defineET_DYN_LOAD_ADDR 0x10
+
 #endif /* !_MACHINE_ELF_H_ */

Modified: stable/8/sys/sun4v/include/elf.h
==
--- stable/8/sys/sun4v/include/elf.hTue Oct 20 13:32:18 2009
(r198282)
+++ stable/8/sys/sun4v/include/elf.hTue Oct 20 13:32:28 2009
(r198283)
@@ -97,4 +97,6 @@ __ElfType(Auxinfo);
 #defineELF_TARG_MACH   ELF_ARCH
 #defineELF_TARG_VER1
 
+#defineET_DYN_LOAD_ADDR 0x10
+
 #endif /* !_MACHINE_ELF_H_ */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to 

svn commit: r198284 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci kern

2009-10-20 Thread Konstantin Belousov
Author: kib
Date: Tue Oct 20 13:34:41 2009
New Revision: 198284
URL: http://svn.freebsd.org/changeset/base/198284

Log:
  MFC r197934:
  Map PIE binaries at non-zero base address.
  
  MFC r198202:
  Honour non-zero mapbase for PIE binaries. Inform interpreter-less PIE
  binary about its relocbase.
  
  Approved by:  re (kensmith)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/kern/imgact_elf.c

Modified: stable/8/sys/kern/imgact_elf.c
==
--- stable/8/sys/kern/imgact_elf.c  Tue Oct 20 13:32:28 2009
(r198283)
+++ stable/8/sys/kern/imgact_elf.c  Tue Oct 20 13:34:41 2009
(r198284)
@@ -685,9 +685,9 @@ __CONCAT(exec_, __elfN(imgact))(struct i
u_long text_size = 0, data_size = 0, total_size = 0;
u_long text_addr = 0, data_addr = 0;
u_long seg_size, seg_addr;
-   u_long addr, entry = 0, proghdr = 0;
+   u_long addr, baddr, et_dyn_addr, entry = 0, proghdr = 0;
int32_t osrel = 0;
-   int error = 0, i;
+   int error = 0, i, n;
const char *interp = NULL, *newinterp = NULL;
Elf_Brandinfo *brand_info;
char *path;
@@ -716,14 +716,22 @@ __CONCAT(exec_, __elfN(imgact))(struct i
phdr = (const Elf_Phdr *)(imgp-image_header + hdr-e_phoff);
if (!aligned(phdr, Elf_Addr))
return (ENOEXEC);
+   n = 0;
+   baddr = 0;
for (i = 0; i  hdr-e_phnum; i++) {
+   if (phdr[i].p_type == PT_LOAD) {
+   if (n == 0)
+   baddr = phdr[i].p_vaddr;
+   n++;
+   continue;
+   }
if (phdr[i].p_type == PT_INTERP) {
/* Path to interpreter */
if (phdr[i].p_filesz  MAXPATHLEN ||
phdr[i].p_offset + phdr[i].p_filesz  PAGE_SIZE)
return (ENOEXEC);
interp = imgp-image_header + phdr[i].p_offset;
-   break;
+   continue;
}
}
 
@@ -733,9 +741,19 @@ __CONCAT(exec_, __elfN(imgact))(struct i
hdr-e_ident[EI_OSABI]);
return (ENOEXEC);
}
-   if (hdr-e_type == ET_DYN 
-   (brand_info-flags  BI_CAN_EXEC_DYN) == 0)
-   return (ENOEXEC);
+   if (hdr-e_type == ET_DYN) {
+   if ((brand_info-flags  BI_CAN_EXEC_DYN) == 0)
+   return (ENOEXEC);
+   /*
+* Honour the base load address from the dso if it is
+* non-zero for some reason.
+*/
+   if (baddr == 0)
+   et_dyn_addr = ET_DYN_LOAD_ADDR;
+   else
+   et_dyn_addr = 0;
+   } else
+   et_dyn_addr = 0;
sv = brand_info-sysvec;
if (interp != NULL  brand_info-interp_newpath != NULL)
newinterp = brand_info-interp_newpath;
@@ -783,7 +801,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i
 
if ((error = __elfN(load_section)(vmspace,
imgp-object, phdr[i].p_offset,
-   (caddr_t)(uintptr_t)phdr[i].p_vaddr,
+   (caddr_t)(uintptr_t)phdr[i].p_vaddr + et_dyn_addr,
phdr[i].p_memsz, phdr[i].p_filesz, prot,
sv-sv_pagesize)) != 0)
return (error);
@@ -797,11 +815,12 @@ __CONCAT(exec_, __elfN(imgact))(struct i
if (phdr[i].p_offset == 0 
hdr-e_phoff + hdr-e_phnum * hdr-e_phentsize
= phdr[i].p_filesz)
-   proghdr = phdr[i].p_vaddr + hdr-e_phoff;
+   proghdr = phdr[i].p_vaddr + hdr-e_phoff +
+   et_dyn_addr;
 
-   seg_addr = trunc_page(phdr[i].p_vaddr);
+   seg_addr = trunc_page(phdr[i].p_vaddr + et_dyn_addr);
seg_size = round_page(phdr[i].p_memsz +
-   phdr[i].p_vaddr - seg_addr);
+   phdr[i].p_vaddr + et_dyn_addr - seg_addr);
 
/*
 * Is this .text or .data?  We can't use
@@ -823,7 +842,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i
phdr[i].p_memsz)) {
text_size = seg_size;
text_addr = seg_addr;
-   entry = (u_long)hdr-e_entry;
+  

svn commit: r198280 - stable/8/libexec/rtld-elf

2009-10-20 Thread Konstantin Belousov
Author: kib
Date: Tue Oct 20 13:26:58 2009
New Revision: 198280
URL: http://svn.freebsd.org/changeset/base/198280

Log:
  MFC r197931:
  Apply relocations for PIE binary ELF data structures pointers in rtld.
  
  Approved by:  re (kensmith)

Modified:
  stable/8/libexec/rtld-elf/   (props changed)
  stable/8/libexec/rtld-elf/rtld.c

Modified: stable/8/libexec/rtld-elf/rtld.c
==
--- stable/8/libexec/rtld-elf/rtld.cTue Oct 20 13:22:54 2009
(r198279)
+++ stable/8/libexec/rtld-elf/rtld.cTue Oct 20 13:26:58 2009
(r198280)
@@ -474,6 +474,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_
 /* Initialize a fake symbol for resolving undefined weak references. */
 sym_zero.st_info = ELF_ST_INFO(STB_GLOBAL, STT_NOTYPE);
 sym_zero.st_shndx = SHN_UNDEF;
+sym_zero.st_value = -(uintptr_t)obj_main-relocbase;
 
 if (!libmap_disable)
 libmap_disable = (bool)lm_init(libmap_override);
@@ -991,26 +992,26 @@ digest_phdr(const Elf_Phdr *phdr, int ph
 
 obj = obj_new();
 for (ph = phdr;  ph  phlimit;  ph++) {
-   switch (ph-p_type) {
+   if (ph-p_type != PT_PHDR)
+   continue;
 
-   case PT_PHDR:
-   if ((const Elf_Phdr *)ph-p_vaddr != phdr) {
-   _rtld_error(%s: invalid PT_PHDR, path);
-   return NULL;
-   }
-   obj-phdr = (const Elf_Phdr *) ph-p_vaddr;
-   obj-phsize = ph-p_memsz;
-   break;
+   obj-phdr = phdr;
+   obj-phsize = ph-p_memsz;
+   obj-relocbase = (caddr_t)phdr - ph-p_vaddr;
+   break;
+}
+
+for (ph = phdr;  ph  phlimit;  ph++) {
+   switch (ph-p_type) {
 
case PT_INTERP:
-   obj-interp = (const char *) ph-p_vaddr;
+   obj-interp = (const char *)(ph-p_vaddr + obj-relocbase);
break;
 
case PT_LOAD:
if (nsegs == 0) {   /* First load segment */
obj-vaddrbase = trunc_page(ph-p_vaddr);
-   obj-mapbase = (caddr_t) obj-vaddrbase;
-   obj-relocbase = obj-mapbase - obj-vaddrbase;
+   obj-mapbase = obj-vaddrbase + obj-relocbase;
obj-textsize = round_page(ph-p_vaddr + ph-p_memsz) -
  obj-vaddrbase;
} else {/* Last load segment */
@@ -1021,7 +1022,7 @@ digest_phdr(const Elf_Phdr *phdr, int ph
break;
 
case PT_DYNAMIC:
-   obj-dynamic = (const Elf_Dyn *) ph-p_vaddr;
+   obj-dynamic = (const Elf_Dyn *)(ph-p_vaddr + obj-relocbase);
break;
 
case PT_TLS:
@@ -1029,7 +1030,7 @@ digest_phdr(const Elf_Phdr *phdr, int ph
obj-tlssize = ph-p_memsz;
obj-tlsalign = ph-p_align;
obj-tlsinitsize = ph-p_filesz;
-   obj-tlsinit = (void*) ph-p_vaddr;
+   obj-tlsinit = (void*)(ph-p_vaddr + obj-relocbase);
break;
}
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198285 - stable/7/bin/csh

2009-10-20 Thread Hajimu UMEMOTO
Author: ume
Date: Tue Oct 20 13:47:05 2009
New Revision: 198285
URL: http://svn.freebsd.org/changeset/base/198285

Log:
  MFC r198189: Check error of dlfunc(3).

Modified:
  stable/7/bin/csh/   (props changed)
  stable/7/bin/csh/iconv_stub.c

Modified: stable/7/bin/csh/iconv_stub.c
==
--- stable/7/bin/csh/iconv_stub.c   Tue Oct 20 13:34:41 2009
(r198284)
+++ stable/7/bin/csh/iconv_stub.c   Tue Oct 20 13:47:05 2009
(r198285)
@@ -61,9 +61,20 @@ dl_iconv_open(const char *tocode, const 
if (iconvlib == NULL)
return (iconv_t)-1;
iconv_open = (iconv_open_t *)dlfunc(iconvlib, ICONV_OPEN);
+   if (iconv_open == NULL)
+   goto dlfunc_err;
dl_iconv = (dl_iconv_t *)dlfunc(iconvlib, ICONV_ENGINE);
+   if (dl_iconv == NULL)
+   goto dlfunc_err;
dl_iconv_close = (dl_iconv_close_t *)dlfunc(iconvlib,
ICONV_CLOSE);
+   if (dl_iconv_close == NULL)
+   goto dlfunc_err;
}
return iconv_open(tocode, fromcode);
+
+dlfunc_err:
+   dlclose(iconvlib);
+   iconvlib = NULL;
+   return (iconv_t)-1;
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198286 - stable/6/bin/csh

2009-10-20 Thread Hajimu UMEMOTO
Author: ume
Date: Tue Oct 20 13:49:34 2009
New Revision: 198286
URL: http://svn.freebsd.org/changeset/base/198286

Log:
  MFC r198189: Check error of dlfunc(3).

Modified:
  stable/6/bin/csh/   (props changed)
  stable/6/bin/csh/iconv_stub.c

Modified: stable/6/bin/csh/iconv_stub.c
==
--- stable/6/bin/csh/iconv_stub.c   Tue Oct 20 13:47:05 2009
(r198285)
+++ stable/6/bin/csh/iconv_stub.c   Tue Oct 20 13:49:34 2009
(r198286)
@@ -61,9 +61,20 @@ dl_iconv_open(const char *tocode, const 
if (iconvlib == NULL)
return (iconv_t)-1;
iconv_open = (iconv_open_t *)dlfunc(iconvlib, ICONV_OPEN);
+   if (iconv_open == NULL)
+   goto dlfunc_err;
dl_iconv = (dl_iconv_t *)dlfunc(iconvlib, ICONV_ENGINE);
+   if (dl_iconv == NULL)
+   goto dlfunc_err;
dl_iconv_close = (dl_iconv_close_t *)dlfunc(iconvlib,
ICONV_CLOSE);
+   if (dl_iconv_close == NULL)
+   goto dlfunc_err;
}
return iconv_open(tocode, fromcode);
+
+dlfunc_err:
+   dlclose(iconvlib);
+   iconvlib = NULL;
+   return (iconv_t)-1;
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198287 - head/release/scripts

2009-10-20 Thread Ken Smith
Author: kensmith
Date: Tue Oct 20 13:58:30 2009
New Revision: 198287
URL: http://svn.freebsd.org/changeset/base/198287

Log:
  Update package list for 8.0-REL.
  
  Reviewed by:  re@, portmgr@
  MFC after:1 day

Modified:
  head/release/scripts/package-split.py

Modified: head/release/scripts/package-split.py
==
--- head/release/scripts/package-split.py   Tue Oct 20 13:49:34 2009
(r198286)
+++ head/release/scripts/package-split.py   Tue Oct 20 13:58:30 2009
(r198287)
@@ -51,50 +51,53 @@ def disc1_packages():
'misc/freebsd-doc-zh_tw']
 
 if doing_dvd:
-   pkgs.extend(['lang/perl5.8',
-   'x11/xorg',
-   'devel/imake',
-   'emulators/linux_base-fc4',
-   'x11/gnome2',
-   'x11/kde4',
-   'x11-wm/afterstep',
-   'x11-wm/windowmaker',
-   'x11-wm/fvwm2',
-   'archivers/unzip',
+   pkgs.extend(['archivers/unzip',
'astro/xearth',
'devel/gmake',
+   'devel/imake',
'editors/emacs',
'editors/vim-lite',
+   'emulators/linux_base-f10',
'emulators/mtools',
'graphics/png',
'graphics/xv',
'irc/xchat',
+   'lang/perl5.8',
+   'mail/alpine',
'mail/exim',
'mail/fetchmail',
'mail/mutt',
-   'mail/alpine',
'mail/popd',
-   'mail/xfmail',
'mail/postfix',
+   'mail/xfmail',
'net/cvsup-without-gui',
'net/rsync',
'net/samba3',
'news/slrn',
'news/tin',
+   'ports-mgmt/p5-FreeBSD-Portindex',
+   'ports-mgmt/portaudit',
+   'ports-mgmt/portmaster',
'ports-mgmt/portupgrade',
'print/a2ps-letter',
'print/apsfilter',
'print/ghostscript7-nox11',
-   'print/gv',
'print/psutils-letter',
+   'print/gv',
'shells/bash',
'shells/pdksh',
'shells/zsh',
'security/sudo',
+   'sysutils/screen',
'www/links',
'www/lynx',
+   'x11/gnome2',
+   'x11/kde4',
'x11/rxvt',
-   'ports-mgmt/portaudit'])
+   'x11/xorg',
+   'x11-wm/afterstep',
+   'x11-wm/fvwm2',
+   'x11-wm/windowmaker'])
 return pkgs
 
 # The list of desired packages
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198288 - head/share/man/man4

2009-10-20 Thread Andriy Gapon
Author: avg
Date: Tue Oct 20 14:06:07 2009
New Revision: 198288
URL: http://svn.freebsd.org/changeset/base/198288

Log:
  ichwd.4: fix r198272, restore watchdogd(8) reference
  
  In r198272 I didn't notice that watchdog(8) and watchdogd(8)
  are different things and instead of fixing watchdogd markup
  I simply nuked the line.
  
  Noticed by:   emaste
  Pointy hat to:avg

Modified:
  head/share/man/man4/ichwd.4

Modified: head/share/man/man4/ichwd.4
==
--- head/share/man/man4/ichwd.4 Tue Oct 20 13:58:30 2009(r198287)
+++ head/share/man/man4/ichwd.4 Tue Oct 20 14:06:07 2009(r198288)
@@ -66,6 +66,7 @@ it believes the WDT is disabled.
 .Sh SEE ALSO
 .Xr watchdog 4 ,
 .Xr watchdog 8 ,
+.Xr watchdogd 8 ,
 .Xr watchdog 9
 .Rs
 .%T Using the Intel ICH Family Watchdog Timer (WDT)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198290 - head/sys/fs/nfsclient

2009-10-20 Thread Jaakko Heinonen
Author: jh
Date: Tue Oct 20 15:01:46 2009
New Revision: 198290
URL: http://svn.freebsd.org/changeset/base/198290

Log:
  Fix ordering of nfscl_modevent() and ncl_uninit(). nfscl_modevent() must
  be called after ncl_uninit() when unloading the nfscl module because
  ncl_uninit() uses ncl_iod_mutex which is destroyed in nfscl_modevent().
  
  Reviewed by:  rmacklem
  Approved by:  trasz (mentor)

Modified:
  head/sys/fs/nfsclient/nfs_clport.c

Modified: head/sys/fs/nfsclient/nfs_clport.c
==
--- head/sys/fs/nfsclient/nfs_clport.c  Tue Oct 20 14:57:26 2009
(r198289)
+++ head/sys/fs/nfsclient/nfs_clport.c  Tue Oct 20 15:01:46 2009
(r198290)
@@ -1261,7 +1261,7 @@ static moduledata_t nfscl_mod = {
nfscl_modevent,
NULL,
 };
-DECLARE_MODULE(nfscl, nfscl_mod, SI_SUB_VFS, SI_ORDER_ANY);
+DECLARE_MODULE(nfscl, nfscl_mod, SI_SUB_VFS, SI_ORDER_FIRST);
 
 /* So that loader and kldload(2) can find us, wherever we are.. */
 MODULE_VERSION(nfscl, 1);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198289 - head/sys/fs/nfsclient

2009-10-20 Thread Jaakko Heinonen
Author: jh
Date: Tue Oct 20 14:57:26 2009
New Revision: 198289
URL: http://svn.freebsd.org/changeset/base/198289

Log:
  Fix comment typos.
  
  Reviewed by:  rmacklem
  Approved by:  trasz (mentor)

Modified:
  head/sys/fs/nfsclient/nfs_clstate.c

Modified: head/sys/fs/nfsclient/nfs_clstate.c
==
--- head/sys/fs/nfsclient/nfs_clstate.c Tue Oct 20 14:06:07 2009
(r198288)
+++ head/sys/fs/nfsclient/nfs_clstate.c Tue Oct 20 14:57:26 2009
(r198289)
@@ -36,9 +36,9 @@ __FBSDID($FreeBSD$);
  * - The correct granularity of an OpenOwner is not nearly so
  *   obvious. An OpenOwner does the following:
  *   - provides a serial sequencing of Open/Close/Lock-with-new-lockowner
- *   - is used to check for Open/SHare contention (not applicable to
+ *   - is used to check for Open/Share contention (not applicable to
  * this client, since all Opens are Deny_None)
- *   As such, I considered both extrema.
+ *   As such, I considered both extreme.
  *   1 OpenOwner per ClientID - Simple to manage, but fully serializes
  *   all Open, Close and Lock (with a new lockowner) Ops.
  *   1 OpenOwner for each Open - This one results in an OpenConfirm for
@@ -50,8 +50,8 @@ __FBSDID($FreeBSD$);
  *   which of these the vnodeop close applies to. This is handled by
  *   delaying the Close Op(s) until all of the Opens have been closed.
  *   (It is not yet obvious if this is the correct granularity.)
- * - How the code handles serailization:
- *   - For the ClientId, is uses an exclusive lock while getting its
+ * - How the code handles serialization:
+ *   - For the ClientId, it uses an exclusive lock while getting its
  * SetClientId and during recovery. Otherwise, it uses a shared
  * lock via a reference count.
  *   - For the rest of the data structures, it uses an SMP mutex
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198291 - head/sys/fs/nfsclient

2009-10-20 Thread Jaakko Heinonen
Author: jh
Date: Tue Oct 20 15:06:18 2009
New Revision: 198291
URL: http://svn.freebsd.org/changeset/base/198291

Log:
  Unloading of the nfscl module is unsupported because newnfslock doesn't
  support unloading. It's not trivial to implement newnfslock unloading so
  for now just admit that unloading is unsupported and refuse to attempt
  unload in all nfscl module event handlers.
  
  Reviewed by:  rmacklem
  Approved by:  trasz (mentor)

Modified:
  head/sys/fs/nfsclient/nfs_clport.c
  head/sys/fs/nfsclient/nfs_clsubs.c

Modified: head/sys/fs/nfsclient/nfs_clport.c
==
--- head/sys/fs/nfsclient/nfs_clport.c  Tue Oct 20 15:01:46 2009
(r198290)
+++ head/sys/fs/nfsclient/nfs_clport.c  Tue Oct 20 15:06:18 2009
(r198291)
@@ -1243,6 +1243,10 @@ nfscl_modevent(module_t mod, int type, v
break;
}
 
+   /*
+* XXX: Unloading of nfscl module is unsupported.
+*/
+#if 0
ncl_call_invalcaches = NULL;
nfsd_call_nfscl = NULL;
/* and get rid of the mutexes */
@@ -1250,6 +1254,9 @@ nfscl_modevent(module_t mod, int type, v
mtx_destroy(ncl_iod_mutex);
loaded = 0;
break;
+#else
+   /* FALLTHROUGH */
+#endif
default:
error = EOPNOTSUPP;
break;

Modified: head/sys/fs/nfsclient/nfs_clsubs.c
==
--- head/sys/fs/nfsclient/nfs_clsubs.c  Tue Oct 20 15:01:46 2009
(r198290)
+++ head/sys/fs/nfsclient/nfs_clsubs.c  Tue Oct 20 15:06:18 2009
(r198291)
@@ -87,6 +87,10 @@ extern struct nfsstats newnfsstats;
 int
 ncl_uninit(struct vfsconf *vfsp)
 {
+   /*
+* XXX: Unloading of nfscl module is unsupported.
+*/
+#if 0
int i;
 
/*
@@ -104,6 +108,9 @@ ncl_uninit(struct vfsconf *vfsp)
mtx_unlock(ncl_iod_mutex);
ncl_nhuninit();
return (0);
+#else
+   return (EOPNOTSUPP);
+#endif
 }
 
 void 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198293 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet

2009-10-20 Thread Robert Watson
Author: rwatson
Date: Tue Oct 20 16:22:31 2009
New Revision: 198293
URL: http://svn.freebsd.org/changeset/base/198293

Log:
  Merge r198196 from head to stable/8:
  
Rewrap ip_input() comment so that it prints more nicely.
  
  Approved by:  re (kib)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/ip_input.c

Modified: stable/8/sys/netinet/ip_input.c
==
--- stable/8/sys/netinet/ip_input.c Tue Oct 20 15:49:32 2009
(r198292)
+++ stable/8/sys/netinet/ip_input.c Tue Oct 20 16:22:31 2009
(r198293)
@@ -530,9 +530,9 @@ tooshort:
}
if ((dchg = (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL)) != 0) {
/*
-* Directly ship on the packet.  This allows to forward packets
-* that were destined for us to some other directly connected
-* host.
+* Directly ship on the packet.  This allows to forward
+* packets that were destined for us to some other directly
+* connected host.
 */
ip_forward(m, dchg);
return;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198295 - in head/sys: kern sys

2009-10-20 Thread Ruslan Ermilov
Author: ru
Date: Tue Oct 20 16:36:51 2009
New Revision: 198295
URL: http://svn.freebsd.org/changeset/base/198295

Log:
  Random number generator initialization cleanup:
  
  - Introduce new SI_SUB_RANDOM point in boot sequence to make it
  clear from where one may start using random(9).  It should be as
  early as possible, so place it just after SI_SUB_CPU where we
  have some randomness on most platforms via get_cyclecount().
  
  - Move stack protector initialization to be after SI_SUB_RANDOM
  as before this point we have no randomness at all.  This fixes
  stack protector to actually protect stack with some random guard
  value instead of a well-known one.
  
  Note that this patch doesn't try to address arc4random(9) issues.
  With current code, it will be implicitly seeded by stack protector
  and hence will get the same entropy as random(9).  It will be
  securely reseeded once /dev/random is feeded by some entropy from
  userland.
  
  Submitted by: Maxim Dounin mdou...@mdounin.ru
  MFC after:3 days

Modified:
  head/sys/kern/init_main.c
  head/sys/kern/stack_protector.c
  head/sys/sys/kernel.h

Modified: head/sys/kern/init_main.c
==
--- head/sys/kern/init_main.c   Tue Oct 20 16:32:38 2009(r198294)
+++ head/sys/kern/init_main.c   Tue Oct 20 16:36:51 2009(r198295)
@@ -570,6 +570,19 @@ proc0_post(void *dummy __unused)
 }
 SYSINIT(p0post, SI_SUB_INTRINSIC_POST, SI_ORDER_FIRST, proc0_post, NULL);
 
+static void
+random_init(void *dummy __unused)
+{
+
+   /*
+* After CPU has been started we have some randomness on most
+* platforms via get_cyclecount().  For platforms that don't
+* we will reseed random(9) in proc0_post() as well.
+*/
+   srandom(get_cyclecount());
+}
+SYSINIT(random, SI_SUB_RANDOM, SI_ORDER_FIRST, random_init, NULL);
+
 /*
  ***
  

Modified: head/sys/kern/stack_protector.c
==
--- head/sys/kern/stack_protector.c Tue Oct 20 16:32:38 2009
(r198294)
+++ head/sys/kern/stack_protector.c Tue Oct 20 16:36:51 2009
(r198295)
@@ -28,5 +28,4 @@ __stack_chk_init(void *dummy __unused)
for (i = 0; i  __arraycount(guard); i++)
__stack_chk_guard[i] = guard[i];
 }
-/* SI_SUB_EVENTHANDLER is right after SI_SUB_LOCK used by arc4rand() init. */
-SYSINIT(stack_chk, SI_SUB_EVENTHANDLER, SI_ORDER_ANY, __stack_chk_init, NULL);
+SYSINIT(stack_chk, SI_SUB_RANDOM, SI_ORDER_ANY, __stack_chk_init, NULL);

Modified: head/sys/sys/kernel.h
==
--- head/sys/sys/kernel.h   Tue Oct 20 16:32:38 2009(r198294)
+++ head/sys/sys/kernel.h   Tue Oct 20 16:36:51 2009(r198295)
@@ -109,6 +109,7 @@ enum sysinit_sub_id {
SI_SUB_VNET_PRELINK = 0x1E0,/* vnet init before modules */
SI_SUB_KLD  = 0x200,/* KLD and module setup */
SI_SUB_CPU  = 0x210,/* CPU resource(s)*/
+   SI_SUB_RANDOM   = 0x212,/* random number generator */
SI_SUB_KDTRACE  = 0x214,/* Kernel dtrace hooks */
SI_SUB_MAC  = 0x218,/* TrustedBSD MAC subsystem */
SI_SUB_MAC_POLICY   = 0x21C,/* TrustedBSD MAC policies */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198296 - stable/8/sys/dev/bge

2009-10-20 Thread Stanislav Sedov
Author: stas
Date: Tue Oct 20 16:41:23 2009
New Revision: 198296
URL: http://svn.freebsd.org/changeset/base/198296

Log:
  - Disable ASF by default in STABLE_8.  This causes a lot
of problems on non-DELL branded machines with IPMI
support.  The proposed fix was committed to HEAD but has
not received much test coverage yet.
  
  Discussed with:   bz
  Approved by:  re (kensmith)

Modified:
  stable/8/sys/dev/bge/if_bge.c

Modified: stable/8/sys/dev/bge/if_bge.c
==
--- stable/8/sys/dev/bge/if_bge.c   Tue Oct 20 16:36:51 2009
(r198295)
+++ stable/8/sys/dev/bge/if_bge.c   Tue Oct 20 16:41:23 2009
(r198296)
@@ -446,7 +446,7 @@ static devclass_t bge_devclass;
 DRIVER_MODULE(bge, pci, bge_driver, bge_devclass, 0, 0);
 DRIVER_MODULE(miibus, bge, miibus_driver, miibus_devclass, 0, 0);
 
-static int bge_allow_asf = 1;
+static int bge_allow_asf = 0;
 
 TUNABLE_INT(hw.bge.allow_asf, bge_allow_asf);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198298 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet

2009-10-20 Thread Qing Li
Author: qingli
Date: Tue Oct 20 17:44:50 2009
New Revision: 198298
URL: http://svn.freebsd.org/changeset/base/198298

Log:
  MFC   r198111
  
  This patch fixes the following issues in the ARP operation:
  
  1. There is a regression issue in the ARP code. The incomplete
 ARP entry was timing out too quickly (1 second timeout), as
 such, a new entry is created each time arpresolve() is called.
 Therefore the maximum attempts made is always 1. Consequently
 the error code returned to the application is always 0.
  2. Set the expiration of each incomplete entry to a 20-second
 lifetime.
  3. Return incomplete entries to the application.
  4. The return error code was incorrect.
  
  Reviewed by:  kmacy
  Approved by:  re

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/if_ether.c
  stable/8/sys/netinet/in.c

Modified: stable/8/sys/netinet/if_ether.c
==
--- stable/8/sys/netinet/if_ether.c Tue Oct 20 16:46:39 2009
(r198297)
+++ stable/8/sys/netinet/if_ether.c Tue Oct 20 17:44:50 2009
(r198298)
@@ -87,10 +87,13 @@ VNET_DEFINE(int, useloopback) = 1;  /* us
 /* timer values */
 static VNET_DEFINE(int, arpt_keep) = (20*60);  /* once resolved, good for 20
 * minutes */
+static VNET_DEFINE(int, arpt_down) = 20;  /* keep incomplete entries for
+  * 20 seconds */
 static VNET_DEFINE(int, arp_maxtries) = 5;
 static VNET_DEFINE(int, arp_proxyall);
 
 #defineV_arpt_keep VNET(arpt_keep)
+#defineV_arpt_down VNET(arpt_down)
 #defineV_arp_maxtries  VNET(arp_maxtries)
 #defineV_arp_proxyall  VNET(arp_proxyall)
 
@@ -299,7 +302,7 @@ retry:
} 
 
if ((la-la_flags  LLE_VALID) 
-   ((la-la_flags  LLE_STATIC) || la-la_expire  time_uptime)) {
+   ((la-la_flags  LLE_STATIC) || la-la_expire  time_second)) {
bcopy(la-ll_addr, desten, ifp-if_addrlen);
/*
 * If entry has an expiry time and it is approaching,
@@ -307,7 +310,7 @@ retry:
 * arpt_down interval.
 */
if (!(la-la_flags  LLE_STATIC) 
-   time_uptime + la-la_preempt  la-la_expire) {
+   time_second + la-la_preempt  la-la_expire) {
arprequest(ifp, NULL,
SIN(dst)-sin_addr, IF_LLADDR(ifp));
 
@@ -327,7 +330,7 @@ retry:
goto done;
}
 
-   renew = (la-la_asked == 0 || la-la_expire != time_uptime);
+   renew = (la-la_asked == 0 || la-la_expire != time_second);
if ((renew || m != NULL)  (flags  LLE_EXCLUSIVE) == 0) {
flags |= LLE_EXCLUSIVE;
LLE_RUNLOCK(la);
@@ -358,12 +361,12 @@ retry:
error = EWOULDBLOCK;/* First request. */
else
error =
-   (rt0-rt_flags  RTF_GATEWAY) ? EHOSTDOWN : EHOSTUNREACH;
+   (rt0-rt_flags  RTF_GATEWAY) ? EHOSTUNREACH : 
EHOSTDOWN;
 
if (renew) {
LLE_ADDREF(la);
-   la-la_expire = time_uptime;
-   callout_reset(la-la_timer, hz, arptimer, la);
+   la-la_expire = time_second;
+   callout_reset(la-la_timer, hz * V_arpt_down, arptimer, la);
la-la_asked++;
LLE_WUNLOCK(la);
arprequest(ifp, NULL, SIN(dst)-sin_addr,
@@ -668,7 +671,7 @@ match:
la-la_flags |= LLE_VALID;
 
if (!(la-la_flags  LLE_STATIC)) {
-   la-la_expire = time_uptime + V_arpt_keep;
+   la-la_expire = time_second + V_arpt_keep;
callout_reset(la-la_timer, hz * V_arpt_keep,
arptimer, la);
}

Modified: stable/8/sys/netinet/in.c
==
--- stable/8/sys/netinet/in.c   Tue Oct 20 16:46:39 2009(r198297)
+++ stable/8/sys/netinet/in.c   Tue Oct 20 17:44:50 2009(r198298)
@@ -1439,7 +1439,7 @@ in_lltable_dump(struct lltable *llt, str
struct sockaddr_dl *sdl;

/* skip deleted entries */
-   if ((lle-la_flags  (LLE_DELETED|LLE_VALID)) != 
LLE_VALID)
+   if ((lle-la_flags  LLE_DELETED) == LLE_DELETED)
continue;
/* Skip if jailed and not a valid IP of the prison. */
if 

svn commit: r198300 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/usb/wlan dev/xen/xenpci

2009-10-20 Thread Weongyo Jeong
Author: weongyo
Date: Tue Oct 20 17:50:36 2009
New Revision: 198300
URL: http://svn.freebsd.org/changeset/base/198300

Log:
  MFC r198098:
fixes a TX hang bug that it could happen when if_start callback didn't
be restarted by full of the output queue.
  
Tested by:  bsduser bsd at acd.homelinux.org
  
  MFC r198099:
fixes a TX hang that could be possible to happen when the trasfers are
in the high speed that some drivers don't call if_start callback after
marking ~IFF_DRV_OACTIVE.
  
  Approved by:  re (kib)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/usb/wlan/if_rum.c
  stable/8/sys/dev/usb/wlan/if_uath.c
  stable/8/sys/dev/usb/wlan/if_upgt.c
  stable/8/sys/dev/usb/wlan/if_ural.c
  stable/8/sys/dev/usb/wlan/if_urtw.c
  stable/8/sys/dev/usb/wlan/if_zyd.c
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/usb/wlan/if_rum.c
==
--- stable/8/sys/dev/usb/wlan/if_rum.c  Tue Oct 20 17:50:27 2009
(r198299)
+++ stable/8/sys/dev/usb/wlan/if_rum.c  Tue Oct 20 17:50:36 2009
(r198300)
@@ -826,6 +826,9 @@ tr_setup:
 
usbd_transfer_submit(xfer);
}
+   RUM_UNLOCK(sc);
+   rum_start(ifp);
+   RUM_LOCK(sc);
break;
 
default:/* Error */
@@ -930,8 +933,8 @@ tr_setup:
 * the private mutex of a device! That is why we do the
 * ieee80211_input here, and not some lines up!
 */
+   RUM_UNLOCK(sc);
if (m) {
-   RUM_UNLOCK(sc);
ni = ieee80211_find_rxnode(ic,
mtod(m, struct ieee80211_frame_min *));
if (ni != NULL) {
@@ -941,8 +944,11 @@ tr_setup:
} else
(void) ieee80211_input_all(ic, m, rssi,
RT2573_NOISE_FLOOR);
-   RUM_LOCK(sc);
}
+   if ((ifp-if_drv_flags  IFF_DRV_OACTIVE) == 0 
+   !IFQ_IS_EMPTY(ifp-if_snd))
+   rum_start(ifp);
+   RUM_LOCK(sc);
return;
 
default:/* Error */

Modified: stable/8/sys/dev/usb/wlan/if_uath.c
==
--- stable/8/sys/dev/usb/wlan/if_uath.c Tue Oct 20 17:50:27 2009
(r198299)
+++ stable/8/sys/dev/usb/wlan/if_uath.c Tue Oct 20 17:50:36 2009
(r198300)
@@ -2762,6 +2762,9 @@ setup:
m = NULL;
desc = NULL;
}
+   if ((ifp-if_drv_flags  IFF_DRV_OACTIVE) == 0 
+   !IFQ_IS_EMPTY(ifp-if_snd))
+   uath_start(ifp);
UATH_LOCK(sc);
break;
default:

Modified: stable/8/sys/dev/usb/wlan/if_upgt.c
==
--- stable/8/sys/dev/usb/wlan/if_upgt.c Tue Oct 20 17:50:27 2009
(r198299)
+++ stable/8/sys/dev/usb/wlan/if_upgt.c Tue Oct 20 17:50:36 2009
(r198300)
@@ -2293,6 +2293,9 @@ setup:
(void) ieee80211_input_all(ic, m, rssi, nf);
m = NULL;
}
+   if ((ifp-if_drv_flags  IFF_DRV_OACTIVE) == 0 
+   !IFQ_IS_EMPTY(ifp-if_snd))
+   upgt_start(ifp);
UPGT_LOCK(sc);
break;
default:

Modified: stable/8/sys/dev/usb/wlan/if_ural.c
==
--- stable/8/sys/dev/usb/wlan/if_ural.c Tue Oct 20 17:50:27 2009
(r198299)
+++ stable/8/sys/dev/usb/wlan/if_ural.c Tue Oct 20 17:50:36 2009
(r198300)
@@ -837,6 +837,9 @@ tr_setup:
 
usbd_transfer_submit(xfer);
}
+   RAL_UNLOCK(sc);
+   ural_start(ifp);
+   RAL_LOCK(sc);
break;
 
default:/* Error */
@@ -945,8 +948,8 @@ tr_setup:
 * the private mutex of a device! That is why we do the
 * ieee80211_input here, and not some lines up!
 */
+   RAL_UNLOCK(sc);
if (m) {
-   RAL_UNLOCK(sc);
ni = ieee80211_find_rxnode(ic,
mtod(m, struct ieee80211_frame_min *));
if (ni != NULL) {
@@ -954,8 +957,11 @@ tr_setup:
ieee80211_free_node(ni);

svn commit: r198301 - head/sys/netinet

2009-10-20 Thread Qing Li
Author: qingli
Date: Tue Oct 20 17:55:42 2009
New Revision: 198301
URL: http://svn.freebsd.org/changeset/base/198301

Log:
  In the ARP callout timer expiration function, the current time_second
  is compared against the entry expiration time value (that was set based
  on time_second) to check if the current time is larger than the set
  expiration time. Due to the +/- timer granularity value, the comparison
  returns false, causing the alternative code to be executed. The
  alternative code path freed the memory without removing that entry
  from the table list, causing a use-after-free bug.
  
  Reviewed by:  discussed with kmacy
  MFC after:immediately
  Verified by:  rnoland, yongari

Modified:
  head/sys/netinet/if_ether.c

Modified: head/sys/netinet/if_ether.c
==
--- head/sys/netinet/if_ether.c Tue Oct 20 17:50:36 2009(r198300)
+++ head/sys/netinet/if_ether.c Tue Oct 20 17:55:42 2009(r198301)
@@ -175,18 +175,18 @@ arptimer(void *arg)
CURVNET_SET(ifp-if_vnet);
IF_AFDATA_LOCK(ifp);
LLE_WLOCK(lle);
-   if (((lle-la_flags  LLE_DELETED) ||
-   (time_second = lle-la_expire)) 
-   (!callout_pending(lle-la_timer) 
+   if ((!callout_pending(lle-la_timer) 
callout_active(lle-la_timer))) {
(void) llentry_free(lle);
ARPSTAT_INC(timeouts);
-   } else {
-   /*
-* Still valid, just drop our reference
-*/
-   LLE_FREE_LOCKED(lle);
+   } 
+#ifdef DIAGNOSTICS
+   else {
+   struct sockaddr *l3addr = L3_ADDR(lle);
+   log(LOG_INFO, arptimer issue: %p, IPv4 address: \%s\\n, lle,
+   inet_ntoa(((const struct sockaddr_in *)l3addr)-sin_addr));
}
+#endif
IF_AFDATA_UNLOCK(ifp);
CURVNET_RESTORE();
 }
@@ -377,7 +377,7 @@ retry:
 
if (renew) {
LLE_ADDREF(la);
-   la-la_expire = time_second;
+   la-la_expire = time_second + V_arpt_down;
callout_reset(la-la_timer, hz * V_arpt_down, arptimer, la);
la-la_asked++;
LLE_WUNLOCK(la);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r198295 - in head/sys: kern sys

2009-10-20 Thread Doug Barton
Was this patch publicly reviewed anywhere? If so and I missed it I
apologize. Otherwise it would be very nice if it got some discussion,
review, etc. before it proceeds any further.

Something as important as how we use random numbers, especially in the
kernel, and especially as the system is initializing and entropy is
low really needs a lot of review. This is not meant as an aspersion on
Ruslan, Mr. Dounin, or anyone else involved.


Doug


Ruslan Ermilov wrote:
 Author: ru
 Date: Tue Oct 20 16:36:51 2009
 New Revision: 198295
 URL: http://svn.freebsd.org/changeset/base/198295
 
 Log:
   Random number generator initialization cleanup:
   
   - Introduce new SI_SUB_RANDOM point in boot sequence to make it
   clear from where one may start using random(9).  It should be as
   early as possible, so place it just after SI_SUB_CPU where we
   have some randomness on most platforms via get_cyclecount().
   
   - Move stack protector initialization to be after SI_SUB_RANDOM
   as before this point we have no randomness at all.  This fixes
   stack protector to actually protect stack with some random guard
   value instead of a well-known one.
   
   Note that this patch doesn't try to address arc4random(9) issues.
   With current code, it will be implicitly seeded by stack protector
   and hence will get the same entropy as random(9).  It will be
   securely reseeded once /dev/random is feeded by some entropy from
   userland.
   
   Submitted by:   Maxim Dounin mdou...@mdounin.ru
   MFC after:  3 days
 
 Modified:
   head/sys/kern/init_main.c
   head/sys/kern/stack_protector.c
   head/sys/sys/kernel.h
 
 Modified: head/sys/kern/init_main.c
 ==
 --- head/sys/kern/init_main.c Tue Oct 20 16:32:38 2009(r198294)
 +++ head/sys/kern/init_main.c Tue Oct 20 16:36:51 2009(r198295)
 @@ -570,6 +570,19 @@ proc0_post(void *dummy __unused)
  }
  SYSINIT(p0post, SI_SUB_INTRINSIC_POST, SI_ORDER_FIRST, proc0_post, NULL);
  
 +static void
 +random_init(void *dummy __unused)
 +{
 +
 + /*
 +  * After CPU has been started we have some randomness on most
 +  * platforms via get_cyclecount().  For platforms that don't
 +  * we will reseed random(9) in proc0_post() as well.
 +  */
 + srandom(get_cyclecount());
 +}
 +SYSINIT(random, SI_SUB_RANDOM, SI_ORDER_FIRST, random_init, NULL);
 +
  /*
   ***
   
 
 Modified: head/sys/kern/stack_protector.c
 ==
 --- head/sys/kern/stack_protector.c   Tue Oct 20 16:32:38 2009
 (r198294)
 +++ head/sys/kern/stack_protector.c   Tue Oct 20 16:36:51 2009
 (r198295)
 @@ -28,5 +28,4 @@ __stack_chk_init(void *dummy __unused)
   for (i = 0; i  __arraycount(guard); i++)
   __stack_chk_guard[i] = guard[i];
  }
 -/* SI_SUB_EVENTHANDLER is right after SI_SUB_LOCK used by arc4rand() init. */
 -SYSINIT(stack_chk, SI_SUB_EVENTHANDLER, SI_ORDER_ANY, __stack_chk_init, 
 NULL);
 +SYSINIT(stack_chk, SI_SUB_RANDOM, SI_ORDER_ANY, __stack_chk_init, NULL);
 
 Modified: head/sys/sys/kernel.h
 ==
 --- head/sys/sys/kernel.h Tue Oct 20 16:32:38 2009(r198294)
 +++ head/sys/sys/kernel.h Tue Oct 20 16:36:51 2009(r198295)
 @@ -109,6 +109,7 @@ enum sysinit_sub_id {
   SI_SUB_VNET_PRELINK = 0x1E0,/* vnet init before modules */
   SI_SUB_KLD  = 0x200,/* KLD and module setup */
   SI_SUB_CPU  = 0x210,/* CPU resource(s)*/
 + SI_SUB_RANDOM   = 0x212,/* random number generator */
   SI_SUB_KDTRACE  = 0x214,/* Kernel dtrace hooks */
   SI_SUB_MAC  = 0x218,/* TrustedBSD MAC subsystem */
   SI_SUB_MAC_POLICY   = 0x21C,/* TrustedBSD MAC policies */
 


-- 

Improve the effectiveness of your Internet presence with
a domain name makeover!http://SupersetSolutions.com/

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r198296 - stable/8/sys/dev/bge

2009-10-20 Thread Marius Strobl
On Tue, Oct 20, 2009 at 04:41:23PM +, Stanislav Sedov wrote:
 Author: stas
 Date: Tue Oct 20 16:41:23 2009
 New Revision: 198296
 URL: http://svn.freebsd.org/changeset/base/198296
 
 Log:
   - Disable ASF by default in STABLE_8.  This causes a lot
 of problems on non-DELL branded machines with IPMI
 support.  The proposed fix was committed to HEAD but has
 not received much test coverage yet.

You probably want to adjust bge.4 to indicate that the default
has changed as well.

Marius

___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198302 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci net

2009-10-20 Thread Robert Watson
Author: rwatson
Date: Tue Oct 20 18:54:51 2009
New Revision: 198302
URL: http://svn.freebsd.org/changeset/base/198302

Log:
  Merge r198218 from head to stable/8:
  
Sort function prototypes in pfil.h, clean up white space, and better
align fields for printing.
  
  Approved by:  re (kensmith)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/net/pfil.h

Modified: stable/8/sys/net/pfil.h
==
--- stable/8/sys/net/pfil.h Tue Oct 20 17:55:42 2009(r198301)
+++ stable/8/sys/net/pfil.h Tue Oct 20 18:54:51 2009(r198302)
@@ -50,7 +50,7 @@ struct inpcb;
 struct packet_filter_hook {
 TAILQ_ENTRY(packet_filter_hook) pfil_link;
int (*pfil_func)(void *, struct mbuf **, struct ifnet *, int,
-   struct inpcb *);
+   struct inpcb *);
void*pfil_arg;
int pfil_flags;
 };
@@ -80,14 +80,13 @@ struct pfil_head {
LIST_ENTRY(pfil_head) ph_list;
 };
 
+intpfil_add_hook(int (*func)(void *, struct mbuf **, struct ifnet *,
+   int, struct inpcb *), void *, int, struct pfil_head *);
+intpfil_remove_hook(int (*func)(void *, struct mbuf **, struct ifnet *,
+   int, struct inpcb *), void *, int, struct pfil_head *);
 intpfil_run_hooks(struct pfil_head *, struct mbuf **, struct ifnet *,
int, struct inpcb *inp);
 
-intpfil_add_hook(int (*func)(void *, struct mbuf **,
-   struct ifnet *, int, struct inpcb *), void *, int, struct pfil_head 
*);
-intpfil_remove_hook(int (*func)(void *, struct mbuf **,
-   struct ifnet *, int, struct inpcb *), void *, int, struct pfil_head 
*);
-
 intpfil_head_register(struct pfil_head *);
 intpfil_head_unregister(struct pfil_head *);
 
@@ -107,6 +106,7 @@ struct pfil_head *pfil_head_get(int, u_l
 static __inline struct packet_filter_hook *
 pfil_hook_get(int dir, struct pfil_head *ph)
 {
+
if (dir == PFIL_IN)
return (TAILQ_FIRST(ph-ph_in));
else if (dir == PFIL_OUT)
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198303 - head/sys/dev/mxge

2009-10-20 Thread Andrew Gallatin
Author: gallatin
Date: Tue Oct 20 18:58:28 2009
New Revision: 198303
URL: http://svn.freebsd.org/changeset/base/198303

Log:
  Make mxge do a better job recovering from NIC h/w faults
  by checking PCI config space when the NIC is not
  transmitting.  Previously, a h/w fault would not have been
  detected if the NIC was down, or handling an RX only
  workload.

Modified:
  head/sys/dev/mxge/if_mxge.c

Modified: head/sys/dev/mxge/if_mxge.c
==
--- head/sys/dev/mxge/if_mxge.c Tue Oct 20 18:54:51 2009(r198302)
+++ head/sys/dev/mxge/if_mxge.c Tue Oct 20 18:58:28 2009(r198303)
@@ -3640,7 +3640,6 @@ mxge_open(mxge_softc_t *sc)
 #endif
sc-ifp-if_drv_flags |= IFF_DRV_RUNNING;
sc-ifp-if_drv_flags = ~IFF_DRV_OACTIVE;
-   callout_reset(sc-co_hdl, mxge_ticks, mxge_tick, sc);
 
return 0;
 
@@ -3661,7 +3660,6 @@ mxge_close(mxge_softc_t *sc, int down)
int slice;
 #endif
 
-   callout_stop(sc-co_hdl);
 #ifdef IFNET_BUF_RING
for (slice = 0; slice  sc-num_slices; slice++) {
ss = sc-ss[slice];
@@ -3836,9 +3834,9 @@ mxge_watchdog_reset(mxge_softc_t *sc)
if (err) {
device_printf(sc-dev, watchdog reset failed\n);
} else {
-   if (sc-ifp-if_drv_flags  IFF_DRV_RUNNING)
-   callout_reset(sc-co_hdl, mxge_ticks,
- mxge_tick, sc);
+   if (sc-dying == 2)
+   sc-dying = 0;
+   callout_reset(sc-co_hdl, mxge_ticks, mxge_tick, sc);
}
 }
 
@@ -3909,10 +3907,11 @@ mxge_watchdog(mxge_softc_t *sc)
return (err);
 }
 
-static void
+static u_long
 mxge_update_stats(mxge_softc_t *sc)
 {
struct mxge_slice_state *ss;
+   u_long pkts = 0;
u_long ipackets = 0;
u_long opackets = 0;
 #ifdef IFNET_BUF_RING
@@ -3934,6 +3933,8 @@ mxge_update_stats(mxge_softc_t *sc)
 #endif
oerrors += ss-oerrors;
}
+   pkts = (ipackets - sc-ifp-if_ipackets);
+   pkts += (opackets - sc-ifp-if_opackets);
sc-ifp-if_ipackets = ipackets;
sc-ifp-if_opackets = opackets;
 #ifdef IFNET_BUF_RING
@@ -3942,23 +3943,45 @@ mxge_update_stats(mxge_softc_t *sc)
sc-ifp-if_snd.ifq_drops = odrops;
 #endif
sc-ifp-if_oerrors = oerrors;
+   return pkts;
 }
 
 static void
 mxge_tick(void *arg)
 {
mxge_softc_t *sc = arg;
+   u_long pkts = 0;
int err = 0;
+   int running, ticks;
+   uint16_t cmd;
 
-   /* aggregate stats from different slices */
-   mxge_update_stats(sc);
-   if (!sc-watchdog_countdown) {
-   err = mxge_watchdog(sc);
-   sc-watchdog_countdown = 4;
+   ticks = mxge_ticks;
+   mtx_lock(sc-driver_mtx);
+   running = sc-ifp-if_drv_flags  IFF_DRV_RUNNING;
+   mtx_unlock(sc-driver_mtx);
+   if (running) {
+   /* aggregate stats from different slices */
+   pkts = mxge_update_stats(sc);
+   if (!sc-watchdog_countdown) {
+   err = mxge_watchdog(sc);
+   sc-watchdog_countdown = 4;
+   }
+   sc-watchdog_countdown--;
+   }
+   if (pkts == 0) {
+   /* ensure NIC did not suffer h/w fault while idle */
+   cmd = pci_read_config(sc-dev, PCIR_COMMAND, 2);
+   if ((cmd  PCIM_CMD_BUSMASTEREN) == 0) {
+   sc-dying = 2;
+   taskqueue_enqueue(sc-tq, sc-watchdog_task);
+   err = ENXIO;
+   }
+   /* look less often if NIC is idle */
+   ticks *= 4;
}
-   sc-watchdog_countdown--;
+
if (err == 0)
-   callout_reset(sc-co_hdl, mxge_ticks, mxge_tick, sc);
+   callout_reset(sc-co_hdl, ticks, mxge_tick, sc);
 
 }
 
@@ -4747,6 +4770,7 @@ mxge_attach(device_t dev)
ifp-if_transmit = mxge_transmit;
ifp-if_qflush = mxge_qflush;
 #endif
+   callout_reset(sc-co_hdl, mxge_ticks, mxge_tick, sc);
return 0;
 
 abort_with_rings:
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r198296 - stable/8/sys/dev/bge

2009-10-20 Thread Stanislav Sedov
On Tue, 20 Oct 2009 20:51:45 +0200
Marius Strobl mar...@alchemy.franken.de mentioned:

 On Tue, Oct 20, 2009 at 04:41:23PM +, Stanislav Sedov wrote:
  Author: stas
  Date: Tue Oct 20 16:41:23 2009
  New Revision: 198296
  URL: http://svn.freebsd.org/changeset/base/198296
  
  Log:
- Disable ASF by default in STABLE_8.  This causes a lot
  of problems on non-DELL branded machines with IPMI
  support.  The proposed fix was committed to HEAD but has
  not received much test coverage yet.
 
 You probably want to adjust bge.4 to indicate that the default
 has changed as well.
 

Sure, thanks!

-- 
Stanislav Sedov
ST4096-RIPE


pgpBNwKU1rrNw.pgp
Description: PGP signature


svn commit: r198306 - head/sys/net

2009-10-20 Thread Qing Li
Author: qingli
Date: Tue Oct 20 21:27:03 2009
New Revision: 198306
URL: http://svn.freebsd.org/changeset/base/198306

Log:
  The flow-table function flowtable_route_flush() may be called
  during system initialization time. Since the flow-table is
  designed to maintain per CPU flow cache, the existing code
  did not check whether smp_started is true before calling
  sched_bind() and sched_unbind(), which triggers a page fault.
  
  Reviewed by:  jeff
  MFC after:immediately

Modified:
  head/sys/net/flowtable.c

Modified: head/sys/net/flowtable.c
==
--- head/sys/net/flowtable.cTue Oct 20 21:08:32 2009(r198305)
+++ head/sys/net/flowtable.cTue Oct 20 21:27:03 2009(r198306)
@@ -930,16 +930,20 @@ flowtable_route_flush(struct flowtable *
for (i = 0; i = mp_maxid; i++) {
if (CPU_ABSENT(i))
continue;
-
-   thread_lock(curthread);
-   sched_bind(curthread, i);
-   thread_unlock(curthread);
+   
+   if (smp_started == 1) {
+   thread_lock(curthread);
+   sched_bind(curthread, i);
+   thread_unlock(curthread);
+   }
 
flowtable_free_stale(ft, rt);
 
-   thread_lock(curthread);
-   sched_unbind(curthread);
-   thread_unlock(curthread);
+   if (smp_started == 1) {
+   thread_lock(curthread);
+   sched_unbind(curthread);
+   thread_unlock(curthread);
+   }
}
} else {
flowtable_free_stale(ft, rt);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198307 - head/sys/dev/usb/storage

2009-10-20 Thread Andrew Thompson
Author: thompsa
Date: Tue Oct 20 21:29:46 2009
New Revision: 198307
URL: http://svn.freebsd.org/changeset/base/198307

Log:
  Change from CAM_TID_INVALID to CAM_SEL_TIMEOUT error code when the usb device
  has been yanked, this works around a cam recounting bug when
  CAM_DEV_UNCONFIGURED is set late in the detach. In certain conditions the
  reference to the XPT device would not be released which would cause the usb
  explore thread to sleep forever on simfree, preventing any new usb devices 
to
  be found/ejected on the bus.
  
  This is intended to be a quick workaround to the problem without touching CAM
  so it can be merged to 8.0.
  
  Suggested by: mav
  MFC after:3 days

Modified:
  head/sys/dev/usb/storage/umass.c

Modified: head/sys/dev/usb/storage/umass.c
==
--- head/sys/dev/usb/storage/umass.cTue Oct 20 21:27:03 2009
(r198306)
+++ head/sys/dev/usb/storage/umass.cTue Oct 20 21:29:46 2009
(r198307)
@@ -2860,8 +2860,9 @@ umass_cam_action(struct cam_sim *sim, un
 {
struct umass_softc *sc = (struct umass_softc *)sim-softc;
 
-   if (sc == UMASS_GONE) {
-   ccb-ccb_h.status = CAM_TID_INVALID;
+   if (sc == UMASS_GONE ||
+   (sc != NULL  !usbd_device_attached(sc-sc_udev))) {
+   ccb-ccb_h.status = CAM_SEL_TIMEOUT;
xpt_done(ccb);
return;
}
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198308 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci netinet

2009-10-20 Thread Qing Li
Author: qingli
Date: Tue Oct 20 21:36:56 2009
New Revision: 198308
URL: http://svn.freebsd.org/changeset/base/198308

Log:
  MFC   198301
  
  In the ARP callout timer expiration function, the current time_second
  is compared against the entry expiration time value (that was set based
  on time_second) to check if the current time is larger than the set
  expiration time. Due to the +/- timer granularity value, the comparison
  returns false, causing the alternative code to be executed. The
  alternative code path freed the memory without removing that entry
  from the table list, causing a use-after-free bug.
  
  Reviewed by:  discussed with kmacy
  Approved by:  re
  Verified by:  rnoland, yongari

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/netinet/if_ether.c

Modified: stable/8/sys/netinet/if_ether.c
==
--- stable/8/sys/netinet/if_ether.c Tue Oct 20 21:29:46 2009
(r198307)
+++ stable/8/sys/netinet/if_ether.c Tue Oct 20 21:36:56 2009
(r198308)
@@ -168,17 +168,17 @@ arptimer(void *arg)
ifp = lle-lle_tbl-llt_ifp;
IF_AFDATA_LOCK(ifp);
LLE_WLOCK(lle);
-   if (((lle-la_flags  LLE_DELETED)
-   || (time_second = lle-la_expire))
-(!callout_pending(lle-la_timer) 
-   callout_active(lle-la_timer)))
+   if ((!callout_pending(lle-la_timer) 
+   callout_active(lle-la_timer))) {
(void) llentry_free(lle);
+   }
+#ifdef DIAGNOSTICS
else {
-   /*
-* Still valid, just drop our reference
-*/
-   LLE_FREE_LOCKED(lle);
+   struct sockaddr *l3addr = L3_ADDR(lle);
+   log(LOG_INFO, arptimer issue: %p, IPv4 address: \%s\\n, lle,
+   inet_ntoa(((const struct sockaddr_in *)l3addr)-sin_addr));
}
+#endif
IF_AFDATA_UNLOCK(ifp);
 }
 
@@ -365,7 +365,7 @@ retry:
 
if (renew) {
LLE_ADDREF(la);
-   la-la_expire = time_second;
+   la-la_expire = time_second + V_arpt_down;
callout_reset(la-la_timer, hz * V_arpt_down, arptimer, la);
la-la_asked++;
LLE_WUNLOCK(la);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


svn commit: r198309 - stable/8/share/man/man4

2009-10-20 Thread Stanislav Sedov
Author: stas
Date: Tue Oct 20 22:11:17 2009
New Revision: 198309
URL: http://svn.freebsd.org/changeset/base/198309

Log:
  - Note that ASF is now disabled by default in 8.0.
  
  Approved by:  re (kib)

Modified:
  stable/8/share/man/man4/bge.4

Modified: stable/8/share/man/man4/bge.4
==
--- stable/8/share/man/man4/bge.4   Tue Oct 20 21:36:56 2009
(r198308)
+++ stable/8/share/man/man4/bge.4   Tue Oct 20 22:11:17 2009
(r198309)
@@ -31,7 +31,7 @@
 .\
 .\ $FreeBSD$
 .\
-.Dd May 19, 2009
+.Dd Oct 21, 2009
 .Dt BGE 4
 .Os
 .Sh NAME
@@ -217,7 +217,7 @@ prompt before booting the kernel, or sto
 .It Va hw.bge.allow_asf
 Allow the ASF feature for cooperating with IPMI.
 Can cause system lockup problems on a small number of systems.
-Enabled by default.
+Disabled by default.
 .El
 .Sh DIAGNOSTICS
 .Bl -diag
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org


Re: svn commit: r198295 - in head/sys: kern sys

2009-10-20 Thread Maxim Dounin
Hello!

On Tue, Oct 20, 2009 at 11:09:16AM -0700, Doug Barton wrote:

 Was this patch publicly reviewed anywhere? If so and I missed it I
 apologize.

Not really.  It was part of suggested patch during secteam@ work 
on FreeBSD-SA-08:11.arc4random, but was dropped as irrelevant to 
advisory itself.

 Otherwise it would be very nice if it got some discussion,
 review, etc. before it proceeds any further.

 Something as important as how we use random numbers, especially in the
 kernel, and especially as the system is initializing and entropy is
 low really needs a lot of review. This is not meant as an aspersion on
 Ruslan, Mr. Dounin, or anyone else involved.

Sure.  Feel free to ask if you have questions.

But actually the bad thing is that this patch just can't break 
anything as there is nothing to break.  Without the patch kernel 
has no entropy in random(9) until after proc0_post(), and no 
entropy in arc4random(9) until after reseed from userland.

Maxim Dounin

 
 
 Doug
 
 
 Ruslan Ermilov wrote:
  Author: ru
  Date: Tue Oct 20 16:36:51 2009
  New Revision: 198295
  URL: http://svn.freebsd.org/changeset/base/198295
  
  Log:
Random number generator initialization cleanup:

- Introduce new SI_SUB_RANDOM point in boot sequence to make it
clear from where one may start using random(9).  It should be as
early as possible, so place it just after SI_SUB_CPU where we
have some randomness on most platforms via get_cyclecount().

- Move stack protector initialization to be after SI_SUB_RANDOM
as before this point we have no randomness at all.  This fixes
stack protector to actually protect stack with some random guard
value instead of a well-known one.

Note that this patch doesn't try to address arc4random(9) issues.
With current code, it will be implicitly seeded by stack protector
and hence will get the same entropy as random(9).  It will be
securely reseeded once /dev/random is feeded by some entropy from
userland.

Submitted by: Maxim Dounin mdou...@mdounin.ru
MFC after:3 days
  
  Modified:
head/sys/kern/init_main.c
head/sys/kern/stack_protector.c
head/sys/sys/kernel.h
  
  Modified: head/sys/kern/init_main.c
  ==
  --- head/sys/kern/init_main.c   Tue Oct 20 16:32:38 2009
  (r198294)
  +++ head/sys/kern/init_main.c   Tue Oct 20 16:36:51 2009
  (r198295)
  @@ -570,6 +570,19 @@ proc0_post(void *dummy __unused)
   }
   SYSINIT(p0post, SI_SUB_INTRINSIC_POST, SI_ORDER_FIRST, proc0_post, NULL);
   
  +static void
  +random_init(void *dummy __unused)
  +{
  +
  +   /*
  +* After CPU has been started we have some randomness on most
  +* platforms via get_cyclecount().  For platforms that don't
  +* we will reseed random(9) in proc0_post() as well.
  +*/
  +   srandom(get_cyclecount());
  +}
  +SYSINIT(random, SI_SUB_RANDOM, SI_ORDER_FIRST, random_init, NULL);
  +
   /*

  ***

  
  Modified: head/sys/kern/stack_protector.c
  ==
  --- head/sys/kern/stack_protector.c Tue Oct 20 16:32:38 2009
  (r198294)
  +++ head/sys/kern/stack_protector.c Tue Oct 20 16:36:51 2009
  (r198295)
  @@ -28,5 +28,4 @@ __stack_chk_init(void *dummy __unused)
  for (i = 0; i  __arraycount(guard); i++)
  __stack_chk_guard[i] = guard[i];
   }
  -/* SI_SUB_EVENTHANDLER is right after SI_SUB_LOCK used by arc4rand() init. 
  */
  -SYSINIT(stack_chk, SI_SUB_EVENTHANDLER, SI_ORDER_ANY, __stack_chk_init, 
  NULL);
  +SYSINIT(stack_chk, SI_SUB_RANDOM, SI_ORDER_ANY, __stack_chk_init, NULL);
  
  Modified: head/sys/sys/kernel.h
  ==
  --- head/sys/sys/kernel.h   Tue Oct 20 16:32:38 2009(r198294)
  +++ head/sys/sys/kernel.h   Tue Oct 20 16:36:51 2009(r198295)
  @@ -109,6 +109,7 @@ enum sysinit_sub_id {
  SI_SUB_VNET_PRELINK = 0x1E0,/* vnet init before modules */
  SI_SUB_KLD  = 0x200,/* KLD and module setup */
  SI_SUB_CPU  = 0x210,/* CPU resource(s)*/
  +   SI_SUB_RANDOM   = 0x212,/* random number generator */
  SI_SUB_KDTRACE  = 0x214,/* Kernel dtrace hooks */
  SI_SUB_MAC  = 0x218,/* TrustedBSD MAC subsystem */
  SI_SUB_MAC_POLICY   = 0x21C,/* TrustedBSD MAC policies */
  
 
 
 -- 
 
   Improve the effectiveness of your Internet presence with
   a domain name makeover!http://SupersetSolutions.com/
 
 ___
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to 

Re: svn commit: r198301 - head/sys/netinet

2009-10-20 Thread Ruslan Ermilov
On Tue, Oct 20, 2009 at 05:55:42PM +, Qing Li wrote:
 Modified: head/sys/netinet/if_ether.c
[...]
 +#ifdef DIAGNOSTICS
 + else {
 + struct sockaddr *l3addr = L3_ADDR(lle);
 + log(LOG_INFO, arptimer issue: %p, IPv4 address: \%s\\n, lle,
 + inet_ntoa(((const struct sockaddr_in *)l3addr)-sin_addr));
   }
 +#endif

The actual option's name is DIAGNOSTIC, not DIAGNOSTICS.

netinet/in.c:#ifdef DIAGNOSTICS
netinet/in.c:#ifdef DIAGNOSTICS
netinet/in.c:#ifdef DIAGNOSTICS
netinet/if_ether.c:#ifdef DIAGNOSTICS
netinet6/in6.c:#ifdef DIAGNOSTICS

fs/smbfs/smbfs_vfsops.c:#ifdef DIAGNOSTICS


Cheers,
-- 
Ruslan Ermilov
r...@freebsd.org
FreeBSD committer
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org