Commit e4aa446
selftests/landlock: NULL-terminate unix pathname addresses
The size of Unix pathname addresses is computed in selftests using
offsetof(struct sockaddr_un, sun_path) + strlen(xxx). It should have
been that +1, which makes addresses passed to the libc and kernel
non-NULL-terminated. unix_mkname_bsd() fixes that in Linux so there is
no harm, but just using sizeof(the address struct) should improve
readability.
Signed-off-by: Matthieu Buffet <matthieu@buffet.re>
Reviewed-by: Günther Noack <gnoack@google.com>
Link: https://lore.kernel.org/r/20251202215141.689986-1-matthieu@buffet.re
Signed-off-by: Mickaël Salaün <mic@digikod.net>1 parent e1a57c3 commit e4aa446
2 files changed
Lines changed: 20 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4362 | 4362 | | |
4363 | 4363 | | |
4364 | 4364 | | |
4365 | | - | |
4366 | | - | |
| 4365 | + | |
| 4366 | + | |
| 4367 | + | |
| 4368 | + | |
| 4369 | + | |
| 4370 | + | |
4367 | 4371 | | |
4368 | 4372 | | |
4369 | 4373 | | |
4370 | 4374 | | |
4371 | 4375 | | |
4372 | | - | |
4373 | | - | |
4374 | | - | |
4375 | 4376 | | |
4376 | 4377 | | |
4377 | 4378 | | |
4378 | 4379 | | |
4379 | | - | |
4380 | | - | |
| 4380 | + | |
| 4381 | + | |
| 4382 | + | |
4381 | 4383 | | |
4382 | 4384 | | |
4383 | 4385 | | |
| |||
4387 | 4389 | | |
4388 | 4390 | | |
4389 | 4391 | | |
4390 | | - | |
4391 | 4392 | | |
4392 | 4393 | | |
4393 | 4394 | | |
4394 | | - | |
4395 | | - | |
4396 | 4395 | | |
4397 | | - | |
4398 | | - | |
4399 | | - | |
| 4396 | + | |
| 4397 | + | |
4400 | 4398 | | |
4401 | 4399 | | |
4402 | 4400 | | |
| |||
Lines changed: 9 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
779 | 779 | | |
780 | 780 | | |
781 | 781 | | |
782 | | - | |
783 | 782 | | |
784 | 783 | | |
785 | 784 | | |
| |||
798 | 797 | | |
799 | 798 | | |
800 | 799 | | |
801 | | - | |
802 | | - | |
803 | 800 | | |
804 | 801 | | |
805 | | - | |
806 | | - | |
807 | 802 | | |
808 | 803 | | |
809 | 804 | | |
| |||
841 | 836 | | |
842 | 837 | | |
843 | 838 | | |
844 | | - | |
845 | | - | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
846 | 842 | | |
847 | 843 | | |
848 | 844 | | |
849 | 845 | | |
850 | 846 | | |
851 | 847 | | |
852 | 848 | | |
853 | | - | |
| 849 | + | |
854 | 850 | | |
855 | 851 | | |
856 | 852 | | |
857 | | - | |
858 | | - | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
859 | 856 | | |
860 | 857 | | |
861 | 858 | | |
| |||
910 | 907 | | |
911 | 908 | | |
912 | 909 | | |
913 | | - | |
| 910 | + | |
914 | 911 | | |
915 | 912 | | |
916 | 913 | | |
917 | 914 | | |
918 | 915 | | |
919 | | - | |
| 916 | + | |
920 | 917 | | |
921 | 918 | | |
922 | 919 | | |
| |||
0 commit comments