Skip to content

Latest commit

 

History

History
14297 lines (13852 loc) · 477 KB

ubuntu-2.25.6-git-updates.diff

File metadata and controls

14297 lines (13852 loc) · 477 KB
 
Mar 15, 2019
Mar 15, 2019
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
GIT update of git://sourceware.org/git/glibc.git/release/2.25/master from glibc-2.25
diff --git a/ChangeLog b/ChangeLog
index f140ee67de..a3db9c09f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,750 @@
+2017-12-30 Aurelien Jarno <aurelien@aurel32.net>
+ Dmitry V. Levin <ldv@altlinux.org>
+
+ [BZ #22625]
+ * elf/dl-load.c (fillin_rpath): Check for empty tokens before dynamic
+ string token expansion. Check for NULL pointer or empty string possibly
+ returned by expand_dynamic_string_token.
+ (decompose_rpath): Check for empty path after dynamic string
+ token expansion.
+
+2017-12-18 Dmitry V. Levin <ldv@altlinux.org>
+
+ [BZ #22627]
+ * elf/dl-load.c (_dl_init_paths): Remove _dl_dst_substitute preparatory
+ code and invocation.
+
+2017-12-14 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #22607]
+ CVE-2017-1000409
+ * elf/dl-load.c (_dl_init_paths): Compute number of components in
+ the expanded path string.
+
+2017-12-14 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #22606]
+ CVE-2017-1000408
+ * elf/dl-load.c (system_dirs): Update comment.
+ (nsystem_dirs_len): Use array_length.
+ (_dl_init_paths): Use nsystem_dirs_len to compute the array size.
+
+2017-11-02 Florian Weimer <fweimer@redhat.com>
+
+ Add array_length and array_end macros.
+ * include/array_length.h: New file.
+
+2017-12-12 James Clarke <jrtc27@jrtc27.com>
+
+ * sysdeps/unix/sysv/linux/ia64/ipc_priv.h: New file defining
+ __IPC_64 to 0 to avoid IPC_64 being set.
+
+2017-11-02 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #22332]
+ * posix/tst-glob-tilde.c (do_noescape): New variable.
+ (one_test): Process it.
+ (do_test): Set do_noescape. Add unescaping test case.
+
+2017-10-22 Paul Eggert <eggert@cs.ucla.edu>
+
+ [BZ #22332]
+ * posix/glob.c (__glob): Fix buffer overflow during GLOB_TILDE
+ unescaping.
+
+2017-10-21 Florian Weimer <fweimer@redhat.com>
+
+ * posix/Makefile (tests): Add tst-glob-tilde.
+ (tests-special): Add tst-glob-tilde-mem.out
+ (tst-glob-tilde-ENV): Set MALLOC_TRACE.
+ (tst-glob-tilde-mem.out): Add mtrace check.
+ * posix/tst-glob-tilde.c: New file.
+
+2017-10-20 Paul Eggert <eggert@cs.ucla.edu>
+
+ [BZ #22320]
+ CVE-2017-15670
+ * posix/glob.c (__glob): Fix one-byte overflow.
+
+2017-09-08 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ [BZ #1062]
+ CVE-2017-15671
+ * posix/Makefile (routines): Add globfree, globfree64, and
+ glob_pattern_p.
+ * posix/flexmember.h: New file.
+ * posix/glob_internal.h: Likewise.
+ * posix/glob_pattern_p.c: Likewise.
+ * posix/globfree.c: Likewise.
+ * posix/globfree64.c: Likewise.
+ * sysdeps/gnu/globfree64.c: Likewise.
+ * sysdeps/unix/sysv/linux/alpha/globfree.c: Likewise.
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/globfree64.c: Likewise.
+ * sysdeps/unix/sysv/linux/oldglob.c: Likewise.
+ * sysdeps/unix/sysv/linux/wordsize-64/globfree64.c: Likewise.
+ * sysdeps/unix/sysv/linux/x86_64/x32/globfree.c: Likewise.
+ * sysdeps/wordsize-64/globfree.c: Likewise.
+ * sysdeps/wordsize-64/globfree64.c: Likewise.
+ * posix/glob.c (HAVE_CONFIG_H): Use !_LIBC instead.
+ [NDEBUG): Remove comments.
+ (GLOB_ONLY_P, _AMIGA, VMS): Remove define.
+ (dirent_type): New type. Use uint_fast8_t not
+ uint8_t, as C99 does not require uint8_t.
+ (DT_UNKNOWN, DT_DIR, DT_LNK): New macros.
+ (struct readdir_result): Use dirent_type. Do not define skip_entry
+ unless it is needed; this saves a byte on platforms lacking d_ino.
+ (readdir_result_type, readdir_result_skip_entry):
+ New functions, replacing ...
+ (readdir_result_might_be_symlink, readdir_result_might_be_dir):
+ these functions, which were removed. This makes the callers
+ easier to read. All callers changed.
+ (D_INO_TO_RESULT): Now empty if there is no d_ino.
+ (size_add_wrapv, glob_use_alloca): New static functions.
+ (glob, glob_in_dir): Check for size_t overflow in several places,
+ and fix some size_t checks that were not quite right.
+ Remove old code using SHELL since Bash no longer
+ uses this.
+ (glob, prefix_array): Separate MS code better.
+ (glob_in_dir): Remove old Amiga and VMS code.
+ (globfree, __glob_pattern_type, __glob_pattern_p): Move to
+ separate files.
+ (glob_in_dir): Do not rely on undefined behavior in accessing
+ struct members beyond their bounds. Use a flexible array member
+ instead
+ (link_stat): Rename from link_exists2_p and return -1/0 instead of
+ 0/1. Caller changed.
+ (glob): Fix memory leaks.
+ * posix/glob64 (globfree64): Move to separate file.
+ * sysdeps/gnu/glob64.c (NO_GLOB_PATTERN_P): Remove define.
+ (globfree64): Remove hidden alias.
+ * sysdeps/unix/sysv/linux/Makefile (sysdeps_routines): Add
+ oldglob.
+ * sysdeps/unix/sysv/linux/alpha/glob.c (__new_globfree): Move to
+ separate file.
+ * sysdeps/unix/sysv/linux/i386/glob64.c (NO_GLOB_PATTERN_P): Remove
+ define.
+ Move compat code to separate file.
+ * sysdeps/wordsize-64/glob.c (globfree): Move definitions to
+ separate file.
+
+2017-08-20 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #18822]
+ * sysdeps/unix/sysv/linux/i386/glob64.c (__old_glob64): Add
+ libc_hidden_proto and libc_hidden_def.
+
+2017-03-14 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ [BZ #21232]
+ * sysdeps/unix/sysv/linux/mips/mips64/n64/posix_fadvise64.c: Add
+ posix_fadvise64 weak_alias for static build.
+
+2017-10-23 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * sysdeps/unix/sysv/linux/spawni.c (__spawnix): Use 0 instead of
+ WNOHANG in waitpid call.
+
+2017-10-20 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ [BZ #22273]
+ * sysdeps/unix/sysv/linux/spawni.c (__spawnix): Handle the case where
+ the auxiliary process is terminated by a signal before calling _exit
+ or execve.
+
+2017-08-09 Andreas Schwab <schwab@suse.de>
+
+ * nptl/Makefile (tests) [$(build-shared) = yes]: Add
+ tst-compat-forwarder.
+ (modules-names): Add tst-compat-forwarder-mod.
+ ($(objpfx)tst-compat-forwarder): Depend on
+ $(objpfx)tst-compat-forwarder-mod.so.
+ * nptl/tst-compat-forwarder.c: New file.
+ * nptl/tst-compat-forwarder-mod.c: New file.
+
+2017-08-09 Andreas Schwab <schwab@suse.de>
+
+ * sysdeps/unix/sysv/linux/s390/pt-longjmp.c: Update reference to
+ renamed alias.
+
+2017-08-08 Andreas Schwab <schwab@suse.de>
+
+ [BZ #21041]
+ * nptl/pt-longjmp.c (longjmp, siglongjmp): Don't use IFUNC resolver.
+ * nptl/pt-system.c (system): Likewise.
+
+2017-10-13 James Clarke <jrtc27@jrtc27.com>
+
+ * sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_rela):
+ Assign sym_map to be map for local symbols, as TLS relocations
+ use sym_map to determine whether the symbol is defined and to
+ extract the TLS information.
+ * sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela): Likewise.
+ * sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Likewise.
+
+2017-10-19 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #22322]
+ * sysdeps/mips/bits/long-double.h: Move to ....
+ * sysdeps/mips/ieee754/bits/long-double.h: ... here.
+
+2017-10-22 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #21265]
+ * sysdeps/x86/cpu-features-offsets.sym (XSAVE_STATE_SIZE_OFFSET):
+ New.
+ * sysdeps/x86/cpu-features.c: Include <libc-internal.h>.
+ (get_common_indeces): Set xsave_state_size and
+ bit_arch_XSAVEC_Usable if needed.
+ (init_cpu_features): Remove bit_arch_Use_dl_runtime_resolve_slow
+ and bit_arch_Use_dl_runtime_resolve_opt.
+ * sysdeps/x86/cpu-features.h (bit_arch_Use_dl_runtime_resolve_opt):
+ Removed.
+ (bit_arch_Use_dl_runtime_resolve_slow): Likewise.
+ (bit_arch_Prefer_No_AVX512): Updated.
+ (bit_arch_MathVec_Prefer_No_AVX512): Likewise.
+ (bit_arch_XSAVEC_Usable): New.
+ (STATE_SAVE_OFFSET): Likewise.
+ (STATE_SAVE_MASK): Likewise.
+ [__ASSEMBLER__]: Include <cpu-features-offsets.h>.
+ (cpu_features): Add xsave_state_size.
+ (index_arch_Use_dl_runtime_resolve_opt): Removed.
+ (index_arch_Use_dl_runtime_resolve_slow): Likewise.
+ (index_arch_XSAVEC_Usable): New.
+ * sysdeps/x86_64/dl-machine.h (elf_machine_runtime_setup):
+ Replace _dl_runtime_resolve_sse, _dl_runtime_resolve_avx,
+ _dl_runtime_resolve_avx_slow, _dl_runtime_resolve_avx_opt,
+ _dl_runtime_resolve_avx512 and _dl_runtime_resolve_avx512_opt
+ with _dl_runtime_resolve_fxsave, _dl_runtime_resolve_xsave and
+ _dl_runtime_resolve_xsavec.
+ * sysdeps/x86_64/dl-trampoline.S (DL_RUNTIME_UNALIGNED_VEC_SIZE):
+ Removed.
+ (DL_RUNTIME_RESOLVE_REALIGN_STACK): Check STATE_SAVE_ALIGNMENT
+ instead of VEC_SIZE.
+ (REGISTER_SAVE_BND0): Removed.
+ (REGISTER_SAVE_BND1): Likewise.
+ (REGISTER_SAVE_BND3): Likewise.
+ (REGISTER_SAVE_RAX): Always defined to 0.
+ (VMOV): Removed.
+ (_dl_runtime_resolve_avx): Likewise.
+ (_dl_runtime_resolve_avx_slow): Likewise.
+ (_dl_runtime_resolve_avx_opt): Likewise.
+ (_dl_runtime_resolve_avx512): Likewise.
+ (_dl_runtime_resolve_avx512_opt): Likewise.
+ (_dl_runtime_resolve_sse): Likewise.
+ (_dl_runtime_resolve_sse_vex): Likewise.
+ (USE_FXSAVE): New.
+ (_dl_runtime_resolve_fxsave): Likewise.
+ (USE_XSAVE): Likewise.
+ (_dl_runtime_resolve_xsave): Likewise.
+ (USE_XSAVEC): Likewise.
+ (_dl_runtime_resolve_xsavec): Likewise.
+ * sysdeps/x86_64/dl-trampoline.h (_dl_runtime_resolve_avx512):
+ Removed.
+ (_dl_runtime_resolve_avx512_opt): Likewise.
+ (_dl_runtime_resolve_avx): Likewise.
+ (_dl_runtime_resolve_avx_opt): Likewise.
+ (_dl_runtime_resolve_sse): Likewise.
+ (_dl_runtime_resolve_sse_vex): Likewise.
+ (_dl_runtime_resolve_fxsave): New.
+ (_dl_runtime_resolve_xsave): Likewise.
+ (_dl_runtime_resolve_xsavec): Likewise.
+
+2017-10-19 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/Makefile (tests): Add tst-sse, tst-avx and
+ tst-avx512.
+ (test-extras): Add tst-avx-aux and tst-avx512-aux.
+ (extra-test-objs): Add tst-avx-aux.o and tst-avx512-aux.o.
+ (modules-names): Add tst-ssemod, tst-avxmod and tst-avx512mod.
+ ($(objpfx)tst-sse): New rule.
+ ($(objpfx)tst-avx): Likewise.
+ ($(objpfx)tst-avx512): Likewise.
+ (CFLAGS-tst-avx-aux.c): New.
+ (CFLAGS-tst-avxmod.c): Likewise.
+ (CFLAGS-tst-avx512-aux.c): Likewise.
+ (CFLAGS-tst-avx512mod.c): Likewise.
+ * sysdeps/x86_64/tst-avx-aux.c: New file.
+ * sysdeps/x86_64/tst-avx.c: Likewise.
+ * sysdeps/x86_64/tst-avx512-aux.c: Likewise.
+ * sysdeps/x86_64/tst-avx512.c: Likewise.
+ * sysdeps/x86_64/tst-avx512mod.c: Likewise.
+ * sysdeps/x86_64/tst-avxmod.c: Likewise.
+ * sysdeps/x86_64/tst-sse.c: Likewise.
+ * sysdeps/x86_64/tst-ssemod.c: Likewise.
+
+2017-07-19 DJ Delorie <dj@delorie.com>
+
+ [BZ #21654]
+ * grp/grp-merge.c (libc_hidden_def): Fix cast-after-dereference.
+
+2017-07-14 DJ Delorie <dj@redhat.com>
+
+ [BZ #21654]
+ * grp/grp_merge.c (__copy_grp): Align char** to minimum pointer
+ alignment not char alignment.
+ (__merge_grp): Likewise.
+
+2017-08-22 Joseph Myers <joseph@codesourcery.com>
+
+ [BZ #21987]
+ * sysdeps/unix/sysv/linux/sparc/bits/long-double.h: Remove file
+ and copy to ...
+ * sysdeps/unix/sysv/linux/sparc/sparc32/bits/long-double.h:
+ ... here.
+ * sysdeps/unix/sysv/linux/sparc/sparc64/bits/long-double.h:
+ ... and here.
+
+2017-09-11 H.J. Lu <hongjiu.lu@intel.com>
+ Florian Weimer <fweimer@redhat.com>
+
+ * configure.ac (find_cxx_header): Suppress compiler error message.
+ * configure: Regenerated.
+
+ [BZ #21573]
+ * Makerules [$(c++-bits-std_abs-h) != ""] (before-compile): Add
+ $(common-objpfx)bits/std_abs.h.
+ [$(c++-bits-std_abs-h) != ""] ($(common-objpfx)bits/std_abs.h):
+ New target.
+ * config.make.in (c++-bits-std_abs-h): New.
+ * configure.ac (find_cxx_header): Use "\,$1," with sed.
+ (CXX_BITS_STD_ABS_H): New.
+ (AC_SUBST(CXX_BITS_STD_ABS_H)): Likewise.
+ * configure: Regenerated.
+
+2017-09-11 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #21982]
+ * string/stratcliff.c (do_test): Declare size, nchars, inner,
+ middle and outer with size_t instead of int. Repleace %d and
+ %Zd with %zu in printf. Update "MAX (0, nchars - 128)" and
+ "MAX (outer, nchars - 64)" to support unsigned outer and
+ nchars. Also exit loop when outer == 0.
+
+2017-09-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ * resolv/tst-resolv-qtypes.c (domain): Changed to
+ "const char domain[] =".
+
+2017-08-31 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #22051]
+ * Makerules (build-module-helper-objlist): Filter out
+ $(elf-objpfx)sofini.os.
+ (build-shlib-objlist): Append $(elf-objpfx)sofini.os if it is
+ needed.
+
+2017-07-29 Torvald Riegel <triegel@redhat.com>
+ Carlos O'Donell <carlos@redhat.com>
+
+ [BZ 21778]
+ * nptl/pthread_mutex_timedlock.c (__pthread_mutex_timedlock): Update
+ oldval if the CAS fails.
+ * nptl/pthread_mutex_lock.c (__pthread_mutex_lock_full): Likewise.
+ * nptl/tst-mutex7.c: Add comments explaining template test.
+ (ROBUST, DELAY_NSEC, ROUNDS, N): New.
+ (tf, do_test): Use them.
+ * nptl/tst-mutex7robust.c: New file.
+ * nptl/Makefile (tests): Add new test.
+
+2017-07-28 Torvald Riegel <triegel@redhat.com>
+ Carlos O'Donell <carlos@redhat.com>
+
+ [BZ #21298]
+ * nptl/Makefile (tests): Add tst-rwlock20.
+ * nptl/pthread_rwlock_common.c (__pthread_rwlock_rdlock_full): Fix
+ explicit hand-over.
+ (__pthread_rwlock_wrlock_full): Likewise.
+ * nptl/tst-rwlock20.c: New file.
+
+2017-08-21 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #21972]
+ * assert/assert.h (assert): Use static_cast (bool) for C++.
+ Use the ternary operator in the warning branch for GNU C.
+ * assert/Makefile (tests): Add tst-assert-c++, tst-assert-g++.
+ (CFLAGS-tst-assert-c++.o): Compile in C++11 mode.
+ (CFLAGS-tst-assert-g++.o): Compile in GnU C++11 mode.
+ (LDLIBS-tst-assert-c++, LDLIBS-tst-assert-g++): Link with libstdc++.
+ * assert/tst-assert-c++.cc, assert/tst-assert-g++.cc: New files.
+
+2017-04-13 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #21361]
+ Limit EDNS buffer size to 1200 bytes.
+ * include/resolv.h (__res_nopt): Remove declaration.
+ * resolv/Makefile (tests): tst-resolv-edns.
+ (tst-resolv-edns): Link with -lresolv, -lpthread.
+ * resolv/res_mkquery.c (__res_ntop): Limit EDNS buffer size to the
+ interval [512, 1200].
+ * resolv/res_query.c (__libc_res_nquery): Use 1200 buffer size if
+ we can resize the buffer.
+ * resolv/resolv-internal.h (RESOLV_EDNS_BUFFER_SIZE): Define.
+ (__res_nopt): Declare.
+ * resolv/tst-resolv-edns.c: New file.
+ * resolv/resolv_test.h (struct resolv_edns_info): Define.
+ (struct resolv_response_context): Add edns member.
+ * resolv/resolv_test.c (struct query_info): Add edns member.
+ (parse_query): Extract EDNS information from the query.
+ (server_thread_udp_process_one): Propagate EDNS data.
+ (server_thread_tcp_client): Likewise.
+
+2017-08-12 John David Anglin <danglin@gcc.gnu.org>
+
+ [BZ 19170]
+ * sysdeps/hppa/dl-trampoline.S (_dl_runtime_resolve): Return to caller
+ if _dl_fixup fails.
+
+2017-08-12 John David Anglin <danglin@gcc.gnu.org>
+ Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ [BZ #21512]
+ * sysdeps/unix/sysv/linux/aarch64/clone.S (__clone): Call exit
+ syscall instead of jump to _exit.
+ * sysdeps/unix/sysv/linux/hppa/localplt.data: Remove _exit entry.
+
+2017-08-12 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * sysdeps/unix/sysv/linux/hppa/ipc_priv.h: New file.
+
+2017-08-12 John David Anglin <danglin@gcc.gnu.org>
+
+ * sysdeps/unix/sysv/linux/hppa/clone.S (__clone): Add .cfi annotation.
+ * sysdeps/unix/sysv/linux/hppa/getcontext.S (__getcontext): Likewise.
+ * sysdeps/unix/sysv/linux/hppa/pt-vfork.S (__vfork): Likewise.
+ * sysdeps/unix/sysv/linux/hppa/setcontext.S (__setcontext): Likewise.
+
+ * sysdeps/unix/sysv/linux/hppa/getcontext.S (__getcontext): Fix stack
+ offset for r19 load.
+
+ * sysdeps/unix/sysv/linux/hppa/setcontext.S (__setcontext): Return 0.
+
+ * sysdeps/unix/sysv/linux/hppa/sysdep-cancel.h (PSEUDO): Fix CFA offset.
+ Use .cfi_def_cfa_offset instead of .cfi_offset. Don't record stack
+ pointer offset. Correct PIC register offset. Don't mention frame
+ related instructions in epilogue.
+ (PUSHARGS_1): Correct offset.
+ (PUSHARGS_2): Likewise.
+ (PUSHARGS_3): Likewise.
+ (PUSHARGS_4): Likewise.
+ (PUSHARGS_5): Likewise.
+ (PUSHARGS_6): Likewise.
+ (POPARGS_1): Don't mention register restore.
+ (POPARGS_2): Likewise.
+ (POPARGS_3): Likewise.
+ (POPARGS_4): Likewise.
+ (POPARGS_5): Likewise.
+ (POPARGS_6): Likewise.
+ * sysdeps/unix/sysv/linux/hppa/sysdep.h (SAVE_PIC): Don't mention
+ copy of PIC register.
+ (LOAD_PIC): Likewise don't mention restore.
+ (DO_CALL): Fix CFA offset. Use .cfi_def_cfa_offset instead of
+ .cfi_offset. Don't record stack pointer offset. Correct PIC register
+ offset. Don't mention frame related instructions in epilogue.
+
+ [BZ 20098]
+ * sysdeps/hppa/dl-fptr.c (_dl_read_access_allowed): New.
+ (_dl_lookup_address): Return address if it is not consistent with
+ being a linker defined function pointer. Likewise, return address
+ if address and function descriptor addresses are not accessible.
+
+ [BZ locale/19838]
+ * sysdeps/unix/sysv/linux/hppa/bits/shm.h (SHMLBA): Set to page size.
+
+ * nptl/allocatestack.c (allocate_stack): Align old and new guard
+ addresses to page boundaries when the stack grows up.
+
+ * sysdeps/hppa/math-tests.h: New.
+
+ [BZ #21016]
+ * sysdeps/hppa/nptl/bits/pthreadtypes.h: Update pthread_cond_t typedef.
+ * sysdeps/unix/sysv/linux/hppa/pthread.h: Include
+ bits/types/struct_timespec.h.
+ (PTHREAD_MUTEX_INITIALIZER): Revise define.
+ (PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Likewise.
+ (PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
+ (PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
+ (PTHREAD_RWLOCK_INITIALIZER): Likewise.
+ (PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
+ (PTHREAD_COND_INITIALIZER): Likewise.
+ Remove old definitions.
+ * sysdeps/unix/sysv/linux/hppa/internaltypes.h: Delete.
+ * sysdeps/unix/sysv/linux/hppa/pthread_cond_broadcast.c: Delete.
+ * sysdeps/unix/sysv/linux/hppa/pthread_cond_destroy.c: Delete.
+ * sysdeps/unix/sysv/linux/hppa/pthread_cond_init.c: Delete.
+ * sysdeps/unix/sysv/linux/hppa/pthread_cond_signal.c: Delete.
+ * sysdeps/unix/sysv/linux/hppa/pthread_cond_wait.c: Delete.
+
+2017-08-11 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #21242]
+ * assert/assert.h [__GNUC__ && !__STRICT_ANSI__] (assert):
+ Suppress pedantic warning resulting from statement expression.
+ (__ASSERT_FUNCTION): Add missing __extension__.
+
+2017-08-08 Helge Deller <deller@gmx.de>
+
+ [BZ #21049]
+ * sysdeps/hppa/__longjmp.c (__longjmp): Move call to CHECK_SP up
+ to avoid clobbering r26.
+
+2017-08-06 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #21871]
+ * sysdeps/x86/cpu-features.c (init_cpu_features): Set
+ bit_arch_Use_dl_runtime_resolve_opt only with AVX512F.
+
+2017-08-04 Aurelien Jarno <aurelien@aurel32.net>
+
+ * sysdeps/i386/i686/fpu/multiarch/libm-test-ulps: Regenerated.
+
+2017-08-03 Aurelien Jarno <aurelien@aurel32.net>
+
+ * stdlib/getentropy.c (getentropy): Change return type to int.
+
+2017-04-28 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
+
+ [BZ #21280]
+ * sysdeps/powerpc/power7/fpu/s_logbl.c (__logbl): Ignore the
+ signal of subnormals and adjust the exponent of power of 2 down
+ when low part has opposite sign.
+
+2017-07-26 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #21666]
+ * misc/regexp.c (loc1): Add __attribute__ ((nocommon));
+ (loc2): Likewise.
+ (locs): Likewise.
+
+2017-07-12 Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ * sysdeps/aarch64/dl-machine.h (RTLD_START_1): Change _dl_argv to the
+ hidden __GI__dl_argv symbol.
+
+2017-07-06 Florian Weimer <fweimer@redhat.com>
+ H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #21609]
+ * sysdeps/x86_64/Makefile (sysdep-dl-routines): Add tls_get_addr.
+ (gen-as-const-headers): Add rtld-offsets.sym.
+ * sysdeps/x86_64/dl-tls.c: New file.
+ * sysdeps/x86_64/rtld-offsets.sym: Likwise.
+ * sysdeps/x86_64/tls_get_addr.S: Likewise.
+ * sysdeps/x86_64/dl-tls.h: Add multiple inclusion guards.
+ * sysdeps/x86_64/tlsdesc.sym (TI_MODULE_OFFSET): New.
+ (TI_OFFSET_OFFSET): Likwise.
+
+2017-06-14 Florian Weimer <fweimer@redhat.com>
+
+ * sysdeps/i386/i686/multiarch/strcspn-c.c: Add IS_IN (libc) guard.
+ * sysdeps/i386/i686/multiarch/varshift.c: Likewise.
+
+2017-03-07 Siddhesh Poyarekar <siddhesh@sourceware.org>
+
+ [BZ #21209]
+ * elf/rtld.c (process_envvars): Ignore LD_HWCAP_MASK for
+ AT_SECURE processes.
+ * sysdeps/generic/unsecvars.h: Add LD_HWCAP_MASK.
+ * elf/tst-env-setuid.c (test_parent): Test LD_HWCAP_MASK.
+ (test_child): Likewise.
+ * elf/Makefile (tst-env-setuid-ENV): Add LD_HWCAP_MASK.
+
+2017-06-19 Florian Weimer <fweimer@redhat.com>
+
+ * elf/rtld.c (audit_list_string): New variable.
+ (audit_list): Update comment.
+ (struct audit_list_iter): Define.
+ (audit_list_iter_init, audit_list_iter_next): New function.
+ (dl_main): Use struct audit_list_iter to process audit modules.
+ (process_dl_audit): Call dso_name_valid_for_suid.
+ (process_envvars): Set audit_list_string instead of calling
+ process_dl_audit.
+
+2017-06-19 Florian Weimer <fweimer@redhat.com>
+
+ * elf/rtld.c (SECURE_NAME_LIMIT, SECURE_PATH_LIMIT): Define.
+ (dso_name_valid_for_suid): New function.
+ (handle_ld_preload): Likewise.
+ (dl_main): Call it. Remove alloca.
+
+2017-06-19 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #21624]
+ CVE-2017-1000366
+ * elf/rtld.c (process_envvars): Ignore LD_LIBRARY_PATH for
+ __libc_enable_secure.
+
+2017-05-12 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #21386]
+ * sysdeps/nptl/fork.c (__libc_fork): Remove assertions on the
+ parent PID. The assertion in the child is incorrect with PID
+ namespaces.
+
+2017-03-15 Joseph Myers <joseph@codesourcery.com>
+
+ * sysdeps/x86/fpu/test-math-vector-sincos.h (INIT_VEC_PTRS_LOOP):
+ Use a union when storing pointers.
+ (VECTOR_WRAPPER_fFF_2): Do not take address of integer vector and
+ cast result when passing to INIT_VEC_PTRS_LOOP.
+ (VECTOR_WRAPPER_fFF_3): Likewise.
+ (VECTOR_WRAPPER_fFF_4): Likewise.
+
+2017-05-01 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ [BZ# 21182]
+ * string/test-memchr.c (do_test): Add BZ#21182 checks for address
+ near end of a page.
+ * sysdeps/i386/i686/multiarch/memchr-sse2.S (__memchr): Fix
+ overflow calculation.
+
+2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #21396]
+ * sysdeps/x86/cpu-features.c (init_cpu_features): Set
+ Prefer_No_AVX512 if AVX512ER isn't available.
+ * sysdeps/x86/cpu-features.h (bit_arch_Prefer_No_AVX512): New.
+ (index_arch_Prefer_No_AVX512): Likewise.
+ * sysdeps/x86_64/multiarch/memcpy.S (__new_memcpy): Don't use
+ AVX512 version if Prefer_No_AVX512 is set.
+ * sysdeps/x86_64/multiarch/memcpy_chk.S (__memcpy_chk):
+ Likewise.
+ * sysdeps/x86_64/multiarch/memmove.S (__libc_memmove): Likewise.
+ * sysdeps/x86_64/multiarch/memmove_chk.S (__memmove_chk):
+ Likewise.
+ * sysdeps/x86_64/multiarch/mempcpy.S (__mempcpy): Likewise.
+ * sysdeps/x86_64/multiarch/mempcpy_chk.S (__mempcpy_chk):
+ Likewise.
+ * sysdeps/x86_64/multiarch/memset.S (memset): Likewise.
+ * sysdeps/x86_64/multiarch/memset_chk.S (__memset_chk):
+ Likewise.
+
+2017-04-28 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86/cpu-features.c (init_cpu_features): Set
+ Prefer_No_VZEROUPPER if AVX512ER is available.
+ * sysdeps/x86/cpu-features.h
+ (bit_cpu_AVX512PF): New.
+ (bit_cpu_AVX512ER): Likewise.
+ (bit_cpu_AVX512CD): Likewise.
+ (bit_cpu_AVX512BW): Likewise.
+ (bit_cpu_AVX512VL): Likewise.
+ (index_cpu_AVX512PF): Likewise.
+ (index_cpu_AVX512ER): Likewise.
+ (index_cpu_AVX512CD): Likewise.
+ (index_cpu_AVX512BW): Likewise.
+ (index_cpu_AVX512VL): Likewise.
+ (reg_AVX512PF): Likewise.
+ (reg_AVX512ER): Likewise.
+ (reg_AVX512CD): Likewise.
+ (reg_AVX512BW): Likewise.
+ (reg_AVX512VL): Likewise.
+
+2017-04-11 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * posix/globtest.sh: Add cleanup routine on trap 0.
+
+2017-04-07 H.J. Lu <hongjiu.lu@intel.com>
+
+ [BZ #21258]
+ * sysdeps/x86_64/dl-trampoline.S (_dl_runtime_resolve_opt):
+ Define only if _dl_runtime_resolve is defined to
+ _dl_runtime_resolve_sse_vex.
+ * sysdeps/x86_64/dl-trampoline.h (_dl_runtime_resolve_opt):
+ Fallthrough to _dl_runtime_resolve_sse_vex.
+
+2017-04-03 Mike Frysinger <vapier@gentoo.org>
+
+ [BZ #21253]
+ * sysdeps/unix/sysv/linux/spawni.c (__spawnix): Increase argv_size
+ slack space by 32KiB.
+
+2017-04-03 Wladimir van der Laan <laanwj@gmail.com>
+
+ [BZ# 21338]
+ * malloc/malloc.c: Call do_set_arena_max for M_ARENA_MAX
+ instead of incorrect do_set_arena_test
+
+2017-03-31 Slava Barinov <v.barinov@samsung.com>
+
+ [BZ #21289]
+ * io/fts.h (fts_set): Replace __REDIRECT with __REDIRECT_NTH.
+
+2017-03-20 Mike Frysinger <vapier@gentoo.org>
+
+ [BZ #21275]
+ * sysdeps/unix/sysv/linux/spawni.c [__ia64__] (CLONE): Rename
+ __stack to __stackbase.
+ (STACK): Invert _STACK_GROWS_DOWN and _STACK_GROWS_UP order of
+ checks so we can include defined(__ia64__) first.
+
+2017-03-15 Mike Frysinger <vapier@gentoo.org>
+
+ * sysdeps/x86_64/mempcpy_chk.S (__mempcpy_chk): Check for SHARED
+ instead of PIC.
+
+2017-03-15 John David Anglin <danglin@gcc.gnu.org>
+
+ * sysdeps/hppa/dl-machine.h (DL_STACK_END): Define.
+ (RTLD_START): Don't record stack end address in _dl_start_user.
+
+2017-03-02 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #21015]
+ * manual/install.texi (Configuring and compiling): Document
+ --enable-bind-now.
+ * Makeconfig [bind-now] (LDFLAGS-lib.so): Set.
+ (build-shlib-helper): Use $(LDFLAGS-lib.so).
+ (format.lds): Likewise.
+ [bind-now] (LDFLAGS-c.so): Remove.
+ * sysdeps/x86_64/localplt.data (libm.so): matherr relocation can
+ be R_X86_64_GLOB_DAT.
+ * sysdeps/unix/sysv/linux/i386/localplt.data (libm.so): matherr
+ relocation can be R_386_GLOB_DAT.
+ * sysdeps/unix/sysv/linux/alpha/localplt.data (libm.so): matherr
+ relocaiton can be R_ALPHA_GLOB_DAT.
+ * iconvdata/Makefile [bind-now] (LDFLAGS.so): Add -Wl,-z,now.
+
+2017-02-28 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #20257]
+ * inet/Makefile (routines): Add deadline.
+ (tests-static): Add tst-deadline.
+ * inet/net-internal.h (struct deadline_current_time)
+ (__deadline_current_time, struct deadline, __deadline_is_infinite)
+ (__deadline_elapsed, __deadline_first, __deadline_from_timeval)
+ (__deadline_to_ms, __is_timeval_valid_timeout): Declare.
+ * inet/deadline.c: New file.
+ * inet/tst-deadline.c: Likewise.
+ * sunrpc/Makefile (tests): Add tst-udp-nonblocking,
+ tst-udp-timeout, tst-udp-garbage.
+ (tst-udp-nonblocking, tst-udp-timeout): Link against libc.so
+ explicitly.
+ (tst-udp-garbage): Likewise. Also link against thread library.
+ * sunrpc/clnt_udp.c (struct cu_data): Mention in comment that the
+ struct layout is part of the ABI.
+ (clntudp_call): Rework timeout handling.
+ * sunrpc/tst-udp-garbage.c: New file.
+ * sunrpc/tst-udp-nonblocking.c: Likewise.
+ * sunrpc/tst-udp-timeout.c: Likewise.
+
+2017-02-27 Florian Weimer <fweimer@redhat.com>
+
+ [BZ #21115]
+ * sunrpc/clnt_udp.c (clntudp_call): Free ancillary data later.
+ * sunrpc/Makefile (tests): Add tst-udp-error.
+ (tst-udp-error): Link against libc.so explicitly.
+ * sunrpc/tst-udp-error: New file.
+
+2017-02-08 Siddhesh Poyarekar <siddhesh@sourceware.org>
+
+ [BZ #21109]
+ * elf/dl-tunable-types.h (tunable_callback_t): Accept
+ tunable_val_t as argument.
+ * elf/dl-tunables.c (__tunable_set_val): Add comment.
+ * malloc/arena.c (set_mallopt_check): Take tunable_val_t as
+ argument.
+ (DL_TUNABLE_CALLBACK_FNDECL): Likewise.
+
2017-02-05 Siddhesh Poyarekar <siddhesh@sourceware.org>
* version.h (RELEASE): Set to "stable"
diff --git a/INSTALL b/INSTALL
index 3b3fd121b2..e77cb2d4e2 100644
--- a/INSTALL
+++ b/INSTALL
@@ -146,6 +146,12 @@ will be used, and CFLAGS sets optimization options for the compiler.
of routines called directly from assembler are excluded from this
protection.
+'--enable-bind-now'
+ Disable lazy binding for installed shared objects. This provides
+ additional security hardening because it enables full RELRO and a
+ read-only global offset table (GOT), at the cost of slightly
+ increased program load times.
+
'--enable-pt_chown'
The file 'pt_chown' is a helper binary for 'grantpt' (*note
Pseudo-Terminals: Allocation.) that is installed setuid root to fix
diff --git a/Makeconfig b/Makeconfig
index 97a15b569e..1c815113b9 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -386,6 +386,13 @@ LDFLAGS.so += $(hashstyle-LDFLAGS)
LDFLAGS-rtld += $(hashstyle-LDFLAGS)
endif
+# If lazy relocations are disabled, add the -z now flag. Use
+# LDFLAGS-lib.so instead of LDFLAGS.so, to avoid adding the flag to
+# test modules.
+ifeq ($(bind-now),yes)
+LDFLAGS-lib.so += -Wl,-z,now
+endif
+
# Command to run after every final link (executable or shared object).
# This is invoked with $(call after-link,...), so it should operate on
# the file $1. This can be set to do some sort of post-processing on
diff --git a/Makerules b/Makerules
index e9194e54cf..43343f03ee 100644
--- a/Makerules
+++ b/Makerules
@@ -127,6 +127,14 @@ $(common-objpfx)cstdlib: $(c++-cstdlib-header)
$(common-objpfx)cmath: $(c++-cmath-header)
$(INSTALL_DATA) $< $@T
$(move-if-change) $@T $@
+ifneq (,$(c++-bits-std_abs-h))
+# Also make a copy of <bits/std_abs.h> from GCC 7 to prevent it from
+# including /usr/include/stdlib.h.
+before-compile := $(common-objpfx)bits/std_abs.h $(before-compile)
+$(common-objpfx)bits/std_abs.h: $(c++-bits-std_abs-h)
+ $(INSTALL_DATA) $< $@T
+ $(move-if-change) $@T $@
+endif
endif
before-compile := $(common-objpfx)libc-abis.h $(before-compile)
@@ -588,7 +596,7 @@ $(LINK.o) -shared -static-libgcc -Wl,-O1 $(sysdep-LDFLAGS) \
$(extra-B-$(@F:lib%.so=%).so) -B$(csu-objpfx) \
$(extra-B-$(@F:lib%.so=%).so) $(load-map-file) \
-Wl,-soname=lib$(libprefix)$(@F:lib%.so=%).so$($(@F)-version) \
- $(LDFLAGS.so) $(LDFLAGS-$(@F:lib%.so=%).so) \
+ $(LDFLAGS.so) $(LDFLAGS-lib.so) $(LDFLAGS-$(@F:lib%.so=%).so) \
-L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link)
endef
@@ -669,14 +677,17 @@ $(build-module-helper) -o $@ $(shlib-lds-flags) \
$(call after-link,$@)
endef
+# sofini.os must be placed last since it terminates .eh_frame section.
build-module-helper-objlist = \
$(patsubst %_pic.a,$(whole-archive) %_pic.a $(no-whole-archive),\
$(filter-out %.lds $(map-file) $(+preinit) $(+postinit) \
+ $(elf-objpfx)sofini.os \
$(link-libc-deps),$^))
build-module-objlist = $(build-module-helper-objlist) $(LDLIBS-$(@F:%.so=%).so)
build-shlib-objlist = $(build-module-helper-objlist) \
- $(LDLIBS-$(@F:lib%.so=%).so)
+ $(LDLIBS-$(@F:lib%.so=%).so) \
+ $(filter $(elf-objpfx)sofini.os,$^)
# Don't try to use -lc when making libc.so itself.
# Also omits crti.o and crtn.o, which we do not want
@@ -686,10 +697,6 @@ LDFLAGS-c.so = -nostdlib -nostartfiles
LDLIBS-c.so += $(libc.so-gnulib)
# Give libc.so an entry point and make it directly runnable itself.
LDFLAGS-c.so += -e __libc_main
-# If lazy relocation is disabled add the -z now flag.
-ifeq ($(bind-now),yes)
-LDFLAGS-c.so += -Wl,-z,now
-endif
# Pre-link the objects of libc_pic.a so that we can locally resolve
# COMMON symbols before we link against ld.so. This is because ld.so
# contains some of libc_pic.a already, which will prevent the COMMONs
@@ -1104,7 +1111,8 @@ $(common-objpfx)format.lds: $(..)scripts/output-format.sed \
ifneq (unknown,$(output-format))
echo > $@.new 'OUTPUT_FORMAT($(output-format))'
else
- $(LINK.o) -shared $(sysdep-LDFLAGS) $(rtld-LDFLAGS) $(LDFLAGS.so) \
+ $(LINK.o) -shared $(sysdep-LDFLAGS) $(rtld-LDFLAGS) \
+ $(LDFLAGS.so) $(LDFLAGS-lib.so) \
-x c /dev/null -o $@.so -Wl,--verbose -v 2>&1 \
| sed -n -f $< > $@.new
test -s $@.new
diff --git a/NEWS b/NEWS
index ec15dde761..7c44ba2a8a 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,60 @@ See the end for copying conditions.
Please send GNU C library bug reports via <http://sourceware.org/bugzilla/>
using `glibc' in the "product" field.
+Version 2.25.1
+
+Security related changes:
+
+* The DNS stub resolver limits the advertised UDP buffer size to 1200 bytes,
+ to avoid fragmentation-based spoofing attacks.
+
+ CVE-2017-15670: The glob function, when invoked with GLOB_TILDE, suffered
+ from a one-byte overflow during ~ operator processing (either on the stack
+ or the heap, depending on the length of the user name).
+
+ CVE-2017-15671: The glob function, when invoked with GLOB_TILDE,
+ would sometimes fail to free memory allocated during ~ operator
+ processing, leading to a memory leak and, potentially, to a denial
+ of service.
+
+ CVE-2017-15804: The glob function, when invoked with GLOB_TILDE and
+ without GLOB_NOESCAPE, could write past the end of a buffer while
+ unescaping user names. Reported by Tim Rühsen.
+
+ CVE-2017-1000408: Incorrect array size computation in _dl_init_paths leads
+ to the allocation of too much memory. (This is not a security bug per se,
+ it is mentioned here only because of the CVE assignment.) Reported by
+ Qualys.
+
+ CVE-2017-1000409: Buffer overflow in _dl_init_paths due to miscomputation
+ of the number of search path components. (This is not a security
+ vulnerability per se because no trust boundary is crossed if the fix for
+ CVE-2017-1000366 has been applied, but it is mentioned here only because
+ of the CVE assignment.) Reported by Qualys.
+
+ CVE-2017-16997: Incorrect handling of RPATH or RUNPATH containing $ORIGIN
+ for AT_SECURE or SUID binaries could be used to load libraries from the
+ current directory.
+
+The following bugs are resolved with this release:
+
+ [20257] sunrpc: clntudp_call does not enforce timeout when receiving data
+ [21015] Document and fix --enable-bind-now
+ [21109] Tunables broken on big-endian
+ [21115] sunrpc: Use-after-free in error path in clntudp_call
+ [21209] Ignore and remove LD_HWCAP_MASK for AT_SECURE programs
+ [21242] assert: Suppress pedantic warning caused by statement expression
+ [21265] x86-64: Use fxsave/xsave/xsavec in _dl_runtime_resolve
+ [21289] Fix symbol redirect for fts_set
+ [21298] rwlock can deadlock on frequent reader/writer phase switching
+ [21386] Assertion in fork for distinct parent PID is incorrect
+ [21624] Unsafe alloca allows local attackers to alias stack and heap (CVE-2017-1000366)
+ [21654] nss: Fix invalid cast in group merging
+ [21778] Robust mutex may deadlock
+ [21972] assert macro requires operator== (int) for its argument type
+ [22322] libc: [mips64] wrong bits/long-double.h installed
+ [22627] $ORIGIN in $LD_LIBRARY_PATH is substituted twice
+
Version 2.25
* The feature test macro __STDC_WANT_LIB_EXT2__, from ISO/IEC TR
diff --git a/assert/Makefile b/assert/Makefile
index 1c3be9b01f..9ec1be81a9 100644
--- a/assert/Makefile
+++ b/assert/Makefile
@@ -25,6 +25,15 @@ include ../Makeconfig
headers := assert.h
routines := assert assert-perr __assert
-tests := test-assert test-assert-perr
+tests := test-assert test-assert-perr tst-assert-c++ tst-assert-g++
include ../Rules
+
+ifeq ($(have-cxx-thread_local),yes)
+CFLAGS-tst-assert-c++.o = -std=c++11
+LDLIBS-tst-assert-c++ = -lstdc++
+CFLAGS-tst-assert-g++.o = -std=gnu++11
+LDLIBS-tst-assert-g++ = -lstdc++
+else
+tests-unsupported += tst-assert-c++ tst-assert-g++
+endif
diff --git a/assert/assert.h b/assert/assert.h
index 22f019537c..640c95c063 100644
--- a/assert/assert.h
+++ b/assert/assert.h
@@ -85,19 +85,29 @@ __END_DECLS
/* When possible, define assert so that it does not add extra
parentheses around EXPR. Otherwise, those added parentheses would
suppress warnings we'd expect to be detected by gcc's -Wparentheses. */
-# if !defined __GNUC__ || defined __STRICT_ANSI__
+# if defined __cplusplus
+# define assert(expr) \
+ (static_cast <bool> (expr) \
+ ? void (0) \
+ : __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION))
+# elif !defined __GNUC__ || defined __STRICT_ANSI__
# define assert(expr) \
((expr) \
? __ASSERT_VOID_CAST (0) \
: __assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION))
# else
+/* The first occurrence of EXPR is not evaluated due to the sizeof,
+ but will trigger any pedantic warnings masked by the __extension__
+ for the second occurrence. The ternary operator is required to
+ support function pointers and bit fields in this context, and to
+ suppress the evaluation of variable length arrays. */
# define assert(expr) \
- ({ \
+ ((void) sizeof ((expr) ? 1 : 0), __extension__ ({ \
if (expr) \
; /* empty */ \
else \
__assert_fail (#expr, __FILE__, __LINE__, __ASSERT_FUNCTION); \
- })
+ }))
# endif
# ifdef __USE_GNU
@@ -113,7 +123,7 @@ __END_DECLS
C9x has a similar variable called __func__, but prefer the GCC one since
it demangles C++ function names. */
# if defined __cplusplus ? __GNUC_PREREQ (2, 6) : __GNUC_PREREQ (2, 4)
-# define __ASSERT_FUNCTION __PRETTY_FUNCTION__
+# define __ASSERT_FUNCTION __extension__ __PRETTY_FUNCTION__
# else
# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
# define __ASSERT_FUNCTION __func__
diff --git a/assert/tst-assert-c++.cc b/assert/tst-assert-c++.cc
new file mode 100644
index 0000000000..12a5e690cb
--- /dev/null
+++ b/assert/tst-assert-c++.cc
@@ -0,0 +1,78 @@
+/* Tests for interactions between C++ and assert.
+ Copyright (C) 2017 Free Software Foundation, Inc.