github.com/google/syzkaller@v0.0.0-20240517125934-c0f1611a36d6/pkg/email/parser_test.go (about) 1 // Copyright 2017 syzkaller project authors. All rights reserved. 2 // Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. 3 4 package email 5 6 import ( 7 "fmt" 8 "strings" 9 "testing" 10 "time" 11 12 "github.com/google/go-cmp/cmp" 13 ) 14 15 func TestExtractCommand(t *testing.T) { 16 for i, test := range extractCommandTests { 17 t.Run(fmt.Sprint(i), func(t *testing.T) { 18 cmd, _ := extractCommand(test.body) 19 if diff := cmp.Diff(test.cmd, cmd); diff != "" { 20 t.Fatal(diff) 21 } 22 cmd, _ = extractCommand(strings.Replace(test.body, "\n", "\r\n", -1)) 23 if diff := cmp.Diff(test.cmd, cmd); diff != "" { 24 t.Fatal(diff) 25 } 26 }) 27 } 28 } 29 30 func TestAddRemoveAddrContext(t *testing.T) { 31 email := `"Foo Bar" <foo@bar.com>` 32 email00, context00, err := RemoveAddrContext(email) 33 if err != nil { 34 t.Fatal(err) 35 } 36 if email != email00 { 37 t.Fatalf("want: %q, got %q", email, email00) 38 } 39 if context00 != "" { 40 t.Fatalf("want context: %q, got %q", "", context00) 41 } 42 context1 := "context1" 43 email1, err := AddAddrContext(email, context1) 44 if err != nil { 45 t.Fatal(err) 46 } 47 want1 := `"Foo Bar" <foo+context1@bar.com>` 48 if want1 != email1 { 49 t.Fatalf("want: %q, got %q", want1, email1) 50 } 51 context2 := "context2" 52 email2, err := AddAddrContext(email1, context2) 53 if err != nil { 54 t.Fatal(err) 55 } 56 want2 := `"Foo Bar" <foo+context1+context2@bar.com>` 57 if want2 != email2 { 58 t.Fatalf("want: %q, got %q", want2, email2) 59 } 60 email1, context20, err := RemoveAddrContext(email2) 61 if err != nil { 62 t.Fatal(err) 63 } 64 if want1 != email1 { 65 t.Fatalf("want: %q, got %q", want1, email1) 66 } 67 if context2 != context20 { 68 t.Fatalf("want context: %q, got %q", context2, context20) 69 } 70 email0, context10, err := RemoveAddrContext(email1) 71 if err != nil { 72 t.Fatal(err) 73 } 74 if email != email0 { 75 t.Fatalf("want: %q, got %q", email, email0) 76 } 77 if context1 != context10 { 78 t.Fatalf("want context: %q, got %q", context1, context10) 79 } 80 } 81 82 func TestAddAddrContextEmptyName(t *testing.T) { 83 email := "<foo@bar.com>" 84 email1, err := AddAddrContext(email, "context") 85 if err != nil { 86 t.Fatal(err) 87 } 88 if want := "foo+context@bar.com"; want != email1 { 89 t.Fatalf("want: %q, got %q", want, email1) 90 } 91 email2, context1, err := RemoveAddrContext(email1) 92 if err != nil { 93 t.Fatal(err) 94 } 95 if email != email2 { 96 t.Fatalf("want: %q, got %q", email, email2) 97 } 98 if context1 != "context" { 99 t.Fatalf("got context %q", context1) 100 } 101 } 102 103 func TestCanonicalEmail(t *testing.T) { 104 canonical := "foo@bar.com" 105 emails := []string{ 106 "\"Foo Bar\" <foo+123+456@Bar.com>", 107 "<Foo@bar.com>", 108 } 109 for _, email := range emails { 110 if got := CanonicalEmail(email); got != canonical { 111 t.Errorf("got %q, want %q", got, canonical) 112 } 113 } 114 } 115 116 func TestParse(t *testing.T) { 117 for i, test := range parseTests { 118 body := func(t *testing.T, test ParseTest) { 119 email, err := Parse(strings.NewReader(test.email), 120 []string{"bot <foo@bar.com>"}, 121 []string{"list@googlegroups.com"}, 122 []string{"bar.com"}, 123 ) 124 if err != nil { 125 t.Fatal(err) 126 } 127 if diff := cmp.Diff(&test.res, email); diff != "" { 128 t.Error(diff) 129 } 130 } 131 t.Run(fmt.Sprint(i), func(t *testing.T) { body(t, test) }) 132 133 test.email = strings.Replace(test.email, "\n", "\r\n", -1) 134 test.res.Body = strings.Replace(test.res.Body, "\n", "\r\n", -1) 135 t.Run(fmt.Sprint(i)+"rn", func(t *testing.T) { body(t, test) }) 136 } 137 } 138 139 var extractCommandTests = []struct { 140 body string 141 cmd *SingleCommand 142 }{ 143 { 144 body: `Hello, 145 146 line1 147 #syz fix: bar baz `, 148 cmd: &SingleCommand{ 149 Command: CmdFix, 150 Str: "fix:", 151 Args: "bar baz", 152 }, 153 }, 154 { 155 body: `Hello, 156 157 line1 158 #syz fix bar baz 159 line 2 160 `, 161 cmd: &SingleCommand{ 162 Command: CmdFix, 163 Str: "fix", 164 Args: "bar baz", 165 }, 166 }, 167 { 168 body: ` 169 line1 170 > #syz fix: bar baz 171 line 2 172 `, 173 cmd: nil, 174 }, 175 { 176 body: `#syz-fix: bar baz`, 177 cmd: &SingleCommand{ 178 Command: CmdFix, 179 Str: "fix:", 180 Args: "bar baz", 181 }, 182 }, 183 { 184 body: `#syz-fix bar baz`, 185 cmd: &SingleCommand{ 186 Command: CmdFix, 187 Str: "fix", 188 Args: "bar baz", 189 }, 190 }, 191 { 192 body: `#syz: fix: bar baz`, 193 cmd: &SingleCommand{ 194 Command: CmdFix, 195 Str: "fix:", 196 Args: "bar baz", 197 }, 198 }, 199 // This is unfortunate case when a command is split by email client 200 // due to 80-column limitation. 201 { 202 body: ` 203 #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 204 locking/core 205 `, 206 cmd: &SingleCommand{ 207 Command: CmdTest, 208 Str: "test:", 209 Args: "git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core", 210 }, 211 }, 212 { 213 body: ` 214 #syz test 215 git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core 216 `, 217 cmd: &SingleCommand{ 218 Command: CmdTest, 219 Str: "test", 220 // We only look for arguments if there's ":" after "#syz test". 221 Args: "", 222 }, 223 }, 224 { 225 body: ` 226 #syz test: 227 git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 228 locking/core 229 locking/core 230 `, 231 cmd: &SingleCommand{ 232 Command: CmdTest, 233 Str: "test:", 234 Args: "git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git locking/core", 235 }, 236 }, 237 { 238 body: `#syz test: repo commit`, 239 cmd: &SingleCommand{ 240 Command: CmdTest, 241 Str: "test:", 242 Args: "repo commit", 243 }, 244 }, 245 { 246 body: `#syz test: repo commit`, 247 cmd: &SingleCommand{ 248 Command: CmdTest, 249 Str: "test:", 250 Args: "repo commit", 251 }, 252 }, 253 { 254 body: `#syz test 255 patch-begins 256 `, 257 cmd: &SingleCommand{ 258 Command: CmdTest, 259 Str: "test", 260 Args: "", 261 }, 262 }, 263 { 264 body: ` 265 #syz test_5_arg_cmd arg1 266 267 arg2 arg3 268 269 arg4 270 arg5 271 `, 272 cmd: &SingleCommand{ 273 Command: cmdTest5, 274 Str: "test_5_arg_cmd", 275 Args: "arg1 arg2 arg3 arg4 arg5", 276 }, 277 }, 278 { 279 body: `#syz test_5_arg_cmd arg1 arg2 arg3 arg4 arg5`, 280 cmd: &SingleCommand{ 281 Command: cmdTest5, 282 Str: "test_5_arg_cmd", 283 Args: "arg1 arg2 arg3 arg4 arg5", 284 }, 285 }, 286 { 287 body: ` 288 #syz test_5_arg_cmd arg1 289 arg2`, 290 cmd: &SingleCommand{ 291 Command: cmdTest5, 292 Str: "test_5_arg_cmd", 293 Args: "arg1 arg2", 294 }, 295 }, 296 { 297 body: ` 298 #syz test_5_arg_cmd arg1 299 arg2 300 `, 301 cmd: &SingleCommand{ 302 Command: cmdTest5, 303 Str: "test_5_arg_cmd", 304 Args: "arg1 arg2", 305 }, 306 }, 307 { 308 body: ` 309 #syz test_5_arg_cmd arg1 310 arg2 311 312 313 `, 314 cmd: &SingleCommand{ 315 Command: cmdTest5, 316 Str: "test_5_arg_cmd", 317 Args: "arg1 arg2", 318 }, 319 }, 320 { 321 body: ` 322 #syz fix: 323 arg1 arg2 arg3 324 arg4 arg5 325 326 `, 327 cmd: &SingleCommand{ 328 Command: CmdFix, 329 Str: "fix:", 330 Args: "arg1 arg2 arg3", 331 }, 332 }, 333 { 334 body: ` 335 #syz fix: arg1 arg2 arg3 336 arg4 arg5 337 `, 338 cmd: &SingleCommand{ 339 Command: CmdFix, 340 Str: "fix:", 341 Args: "arg1 arg2 arg3", 342 }, 343 }, 344 { 345 body: ` 346 #syz dup: title goes here 347 baz 348 `, 349 cmd: &SingleCommand{ 350 Command: CmdDup, 351 Str: "dup:", 352 Args: "title goes here", 353 }, 354 }, 355 { 356 body: ` 357 #syz dup 358 title on the next line goes here 359 but not this one 360 `, 361 cmd: &SingleCommand{ 362 Command: CmdDup, 363 Str: "dup", 364 Args: "title on the next line goes here", 365 }, 366 }, 367 { 368 body: ` 369 #syz foo bar 370 baz 371 `, 372 cmd: &SingleCommand{ 373 Command: CmdUnknown, 374 Str: "foo", 375 }, 376 }, 377 { 378 body: ` 379 #syz set subsystems: net, fs 380 `, 381 cmd: &SingleCommand{ 382 Command: CmdSet, 383 Str: "set", 384 Args: "subsystems: net, fs", 385 }, 386 }, 387 { 388 body: ` 389 #syz unset some tag 390 `, 391 cmd: &SingleCommand{ 392 Command: CmdUnset, 393 Str: "unset", 394 Args: "some tag", 395 }, 396 }, 397 { 398 body: ` 399 #syz fix: abcd 400 #syz fix: xyz 401 `, 402 // Should only extract the first one. 403 cmd: &SingleCommand{ 404 Command: CmdFix, 405 Str: "fix:", 406 Args: "abcd", 407 }, 408 }, 409 } 410 411 type ParseTest struct { 412 email string 413 res Email 414 } 415 416 var parseTestZone = time.FixedZone("", -7*60*60) 417 418 // nolint: lll 419 var parseTests = []ParseTest{ 420 {`Date: Sun, 7 May 2017 19:54:00 -0700 421 Message-ID: <123> 422 Subject: test subject 423 From: Bob <bob@example.com> 424 To: syzbot <foo+4564456@bar.com> 425 Content-Type: text/plain; charset="UTF-8" 426 427 text body 428 second line 429 #syz fix: arg1 arg2 arg3 430 last line 431 -- 432 You received this message because you are subscribed to the Google Groups "syzkaller" group. 433 To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller+unsubscribe@googlegroups.com. 434 To post to this group, send email to syzkaller@googlegroups.com. 435 To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller/abcdef@google.com. 436 For more options, visit https://groups.google.com/d/optout.`, 437 Email{ 438 BugIDs: []string{"4564456"}, 439 MessageID: "<123>", 440 Date: time.Date(2017, time.May, 7, 19, 54, 0, 0, parseTestZone), 441 Link: "https://groups.google.com/d/msgid/syzkaller/abcdef@google.com", 442 Subject: "test subject", 443 Author: "bob@example.com", 444 Cc: []string{"bob@example.com"}, 445 Body: `text body 446 second line 447 #syz fix: arg1 arg2 arg3 448 last line 449 -- 450 You received this message because you are subscribed to the Google Groups "syzkaller" group. 451 To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller+unsubscribe@googlegroups.com. 452 To post to this group, send email to syzkaller@googlegroups.com. 453 To view this discussion on the web visit https://groups.google.com/d/msgid/syzkaller/abcdef@google.com. 454 For more options, visit https://groups.google.com/d/optout.`, 455 Patch: "", 456 Commands: []*SingleCommand{ 457 { 458 Command: CmdFix, 459 Str: "fix:", 460 Args: "arg1 arg2 arg3", 461 }, 462 }, 463 }}, 464 465 {`Date: Sun, 7 May 2017 19:54:00 -0700 466 Message-ID: <123> 467 Subject: test subject 468 From: syzbot <foo+4564456@bar.com> 469 To: Bob <bob@example.com> 470 Content-Type: text/plain; charset="UTF-8" 471 472 text body 473 last line`, 474 Email{ 475 BugIDs: []string{"4564456"}, 476 MessageID: "<123>", 477 Date: time.Date(2017, time.May, 7, 19, 54, 0, 0, parseTestZone), 478 Subject: "test subject", 479 Author: "foo@bar.com", 480 OwnEmail: true, 481 Cc: []string{"bob@example.com"}, 482 Body: `text body 483 last line`, 484 Patch: "", 485 }}, 486 487 {`Date: Sun, 7 May 2017 19:54:00 -0700 488 Message-ID: <123> 489 Subject: test subject 490 From: Bob <bob@example.com> 491 To: syzbot <bot@example.com>, Alice <alice@example.com> 492 493 #syz invalid 494 text body 495 second line 496 last line`, 497 Email{ 498 MessageID: "<123>", 499 Date: time.Date(2017, time.May, 7, 19, 54, 0, 0, parseTestZone), 500 Subject: "test subject", 501 Author: "bob@example.com", 502 Cc: []string{"alice@example.com", "bob@example.com", "bot@example.com"}, 503 Body: `#syz invalid 504 text body 505 second line 506 last line`, 507 Patch: "", 508 Commands: []*SingleCommand{ 509 { 510 Command: CmdInvalid, 511 Str: "invalid", 512 Args: "", 513 }, 514 }, 515 }}, 516 517 {`Date: Sun, 7 May 2017 19:54:00 -0700 518 Message-ID: <123> 519 Subject: test subject 520 From: Bob <bob@example.com> 521 To: syzbot <bot@example.com>, Alice <alice@example.com> 522 Content-Type: text/plain 523 524 text body 525 second line 526 last line 527 #syz command`, 528 Email{ 529 MessageID: "<123>", 530 Date: time.Date(2017, time.May, 7, 19, 54, 0, 0, parseTestZone), 531 Subject: "test subject", 532 Author: "bob@example.com", 533 Cc: []string{"alice@example.com", "bob@example.com", "bot@example.com"}, 534 Body: `text body 535 second line 536 last line 537 #syz command`, 538 Patch: "", 539 Commands: []*SingleCommand{ 540 { 541 Command: CmdUnknown, 542 Str: "command", 543 }, 544 }, 545 }}, 546 547 {`Date: Sun, 7 May 2017 19:54:00 -0700 548 Message-ID: <123> 549 Subject: test subject 550 From: Bob <bob@example.com> 551 To: syzbot <bot@example.com> 552 Content-Type: multipart/mixed; boundary="001a114ce0b01684a6054f0d8b81" 553 554 --001a114ce0b01684a6054f0d8b81 555 Content-Type: text/plain; charset="UTF-8" 556 557 body text 558 >#syz test 559 560 --001a114ce0b01684a6054f0d8b81 561 Content-Type: text/x-patch; charset="US-ASCII"; name="patch.patch" 562 Content-Disposition: attachment; filename="patch.patch" 563 Content-Transfer-Encoding: base64 564 X-Attachment-Id: f_j2gwcdoa1 565 566 ZGlmZiAtLWdpdCBhL2tlcm5lbC9rY292LmMgYi9rZXJuZWwva2Nvdi5jCmluZGV4IDg1ZTU1NDZj 567 ZDc5MS4uOTQ5ZWE0NTc0NDEyIDEwMDY0NAotLS0gYS9rZXJuZWwva2Nvdi5jCisrKyBiL2tlcm5l 568 bC9rY292LmMKQEAgLTEyNyw3ICsxMjcsNiBAQCB2b2lkIGtjb3ZfdGFza19leGl0KHN0cnVjdCB0 569 YXNrX3N0cnVjdCAqdCkKIAlrY292ID0gdC0+a2NvdjsKIAlpZiAoa2NvdiA9PSBOVUxMKQogCQly 570 ZXR1cm47Ci0Jc3Bpbl9sb2NrKCZrY292LT5sb2NrKTsKIAlpZiAoV0FSTl9PTihrY292LT50ICE9 571 IHQpKSB7CiAJCXNwaW5fdW5sb2NrKCZrY292LT5sb2NrKTsKIAkJcmV0dXJuOwo= 572 --001a114ce0b01684a6054f0d8b81--`, 573 Email{ 574 MessageID: "<123>", 575 Date: time.Date(2017, time.May, 7, 19, 54, 0, 0, parseTestZone), 576 Subject: "test subject", 577 Author: "bob@example.com", 578 Cc: []string{"bob@example.com", "bot@example.com"}, 579 Body: `body text 580 >#syz test 581 `, 582 Patch: `diff --git a/kernel/kcov.c b/kernel/kcov.c 583 index 85e5546cd791..949ea4574412 100644 584 --- a/kernel/kcov.c 585 +++ b/kernel/kcov.c 586 @@ -127,7 +127,6 @@ void kcov_task_exit(struct task_struct *t) 587 kcov = t->kcov; 588 if (kcov == NULL) 589 return; 590 - spin_lock(&kcov->lock); 591 if (WARN_ON(kcov->t != t)) { 592 spin_unlock(&kcov->lock); 593 return; 594 `, 595 }}, 596 597 {`Date: Sun, 7 May 2017 19:54:00 -0700 598 Message-ID: <123> 599 Subject: test subject 600 From: Bob <bob@example.com> 601 To: syzbot <bot@example.com> 602 Content-Type: multipart/alternative; boundary="f403043eee70018593054f0d9f1f" 603 604 --f403043eee70018593054f0d9f1f 605 Content-Type: text/plain; charset="UTF-8" 606 607 On Mon, May 8, 2017 at 6:47 PM, Bob wrote: 608 > body text 609 610 #syz test 611 612 commit 59372bbf3abd5b24a7f6f676a3968685c280f955 613 Date: Thu Apr 27 13:54:11 2017 +0200 614 615 statx: correct error handling of NULL pathname 616 617 test patch. 618 619 diff --git a/fs/stat.c b/fs/stat.c 620 index 3d85747bd86e..a257b872a53d 100644 621 --- a/fs/stat.c 622 +++ b/fs/stat.c 623 @@ -567,8 +567,6 @@ SYSCALL_DEFINE5(statx, 624 return -EINVAL; 625 if ((flags & AT_STATX_SYNC_TYPE) == AT_STATX_SYNC_TYPE) 626 return -EINVAL; 627 - if (!filename) 628 - return -EINVAL; 629 630 error = vfs_statx(dfd, filename, flags, &stat, mask); 631 if (error) 632 633 --f403043eee70018593054f0d9f1f 634 Content-Type: text/html; charset="UTF-8" 635 Content-Transfer-Encoding: quoted-printable 636 637 <div dir=3D"ltr">On Mon, May 8, 2017 at 6:47 PM, Dmitry Vyukov <<a href= 638 =3D"mailto:bob@example.com">bob@example.com</a>> wrote:<br>> bo= 639 dy text<br><br>#syz test<br><br><div><div>commit 59372bbf3abd5b24a7f6f67= 640 6a3968685c280f955</div><div>Date: =C2=A0 Thu Apr 27 13:54:11 2017 +0200</di= 641 v><div><br></div><div>=C2=A0 =C2=A0 statx: correct error handling of NULL p= 642 athname</div><div>=C2=A0 =C2=A0=C2=A0</div><div>=C2=A0 =C2=A0 test patch.</= 643 div><div><br></div><div>diff --git a/fs/stat.c b/fs/stat.c</div><div>index = 644 3d85747bd86e..a257b872a53d 100644</div><div>--- a/fs/stat.c</div><div>+++ b= 645 /fs/stat.c</div><div>@@ -567,8 +567,6 @@ SYSCALL_DEFINE5(statx,</div><div>= 646 =C2=A0<span class=3D"gmail-Apple-tab-span" style=3D"white-space:pre">=09=09= 647 </span>return -EINVAL;</div><div>=C2=A0<span class=3D"gmail-Apple-tab-span"= 648 style=3D"white-space:pre">=09</span>if ((flags & AT_STATX_SYNC_TYPE) = 649 =3D=3D AT_STATX_SYNC_TYPE)</div><div>=C2=A0<span class=3D"gmail-Apple-tab-s= 650 pan" style=3D"white-space:pre">=09=09</span>return -EINVAL;</div><div>-<spa= 651 n class=3D"gmail-Apple-tab-span" style=3D"white-space:pre">=09</span>if (!f= 652 ilename)</div><div>-<span class=3D"gmail-Apple-tab-span" style=3D"white-spa= 653 ce:pre">=09=09</span>return -EINVAL;</div><div>=C2=A0</div><div>=C2=A0<span= 654 class=3D"gmail-Apple-tab-span" style=3D"white-space:pre">=09</span>error = 655 =3D vfs_statx(dfd, filename, flags, &stat, mask);</div><div>=C2=A0<span= 656 class=3D"gmail-Apple-tab-span" style=3D"white-space:pre">=09</span>if (err= 657 or)</div></div></div> 658 659 --f403043eee70018593054f0d9f1f--`, 660 Email{ 661 MessageID: "<123>", 662 Date: time.Date(2017, time.May, 7, 19, 54, 0, 0, parseTestZone), 663 Subject: "test subject", 664 Author: "bob@example.com", 665 Cc: []string{"bob@example.com", "bot@example.com"}, 666 Body: `On Mon, May 8, 2017 at 6:47 PM, Bob wrote: 667 > body text 668 669 #syz test 670 671 commit 59372bbf3abd5b24a7f6f676a3968685c280f955 672 Date: Thu Apr 27 13:54:11 2017 +0200 673 674 statx: correct error handling of NULL pathname 675 676 test patch. 677 678 diff --git a/fs/stat.c b/fs/stat.c 679 index 3d85747bd86e..a257b872a53d 100644 680 --- a/fs/stat.c 681 +++ b/fs/stat.c 682 @@ -567,8 +567,6 @@ SYSCALL_DEFINE5(statx, 683 return -EINVAL; 684 if ((flags & AT_STATX_SYNC_TYPE) == AT_STATX_SYNC_TYPE) 685 return -EINVAL; 686 - if (!filename) 687 - return -EINVAL; 688 689 error = vfs_statx(dfd, filename, flags, &stat, mask); 690 if (error) 691 `, 692 Patch: `diff --git a/fs/stat.c b/fs/stat.c 693 index 3d85747bd86e..a257b872a53d 100644 694 --- a/fs/stat.c 695 +++ b/fs/stat.c 696 @@ -567,8 +567,6 @@ SYSCALL_DEFINE5(statx, 697 return -EINVAL; 698 if ((flags & AT_STATX_SYNC_TYPE) == AT_STATX_SYNC_TYPE) 699 return -EINVAL; 700 - if (!filename) 701 - return -EINVAL; 702 703 error = vfs_statx(dfd, filename, flags, &stat, mask); 704 if (error) 705 `, 706 Commands: []*SingleCommand{ 707 { 708 Command: CmdTest, 709 Str: "test", 710 Args: "", 711 }, 712 }, 713 }}, 714 715 {`Sender: syzkaller-bugs@googlegroups.com 716 Subject: Re: BUG: unable to handle kernel NULL pointer dereference in 717 sock_poll 718 To: syzbot <syzbot+344bb0f46d7719cd9483@syzkaller.appspotmail.com> 719 From: bar <bar@foo.com> 720 Message-ID: <1250334f-7220-2bff-5d87-b87573758d81@bar.com> 721 Date: Sun, 10 Jun 2018 10:38:20 +0900 722 MIME-Version: 1.0 723 Content-Type: text/plain; charset="UTF-8" 724 Content-Language: en-US 725 Content-Transfer-Encoding: quoted-printable 726 727 On 2018/06/10 4:57, syzbot wrote: 728 > Hello, 729 >=20 730 > syzbot found the following crash on: 731 >=20 732 > HEAD commit: 7d3bf613e99a Merge tag 'libnvdimm-for-4.18= 733 ' of git://git.k.. 734 > git tree: upstream 735 > console output: https://syzkaller.appspot.com/x/log.txt?x=3D1188a05f80000= 736 0 737 > kernel config: https://syzkaller.appspot.com/x/.config?x=3Df04d8d0a= 738 2afb789a 739 740 #syz dup: BUG: unable to handle kernel NULL pointer dereference in corrupte= 741 d 742 `, Email{ 743 MessageID: "<1250334f-7220-2bff-5d87-b87573758d81@bar.com>", 744 Date: time.Date(2018, time.June, 10, 10, 38, 20, 0, time.FixedZone("", 9*60*60)), 745 Subject: "Re: BUG: unable to handle kernel NULL pointer dereference in sock_poll", 746 Author: "bar@foo.com", 747 Cc: []string{"bar@foo.com", "syzbot@syzkaller.appspotmail.com"}, 748 Body: `On 2018/06/10 4:57, syzbot wrote: 749 > Hello, 750 > 751 > syzbot found the following crash on: 752 > 753 > HEAD commit: 7d3bf613e99a Merge tag 'libnvdimm-for-4.18' of git://git.k.. 754 > git tree: upstream 755 > console output: https://syzkaller.appspot.com/x/log.txt?x=1188a05f800000 756 > kernel config: https://syzkaller.appspot.com/x/.config?x=f04d8d0a2afb789a 757 758 #syz dup: BUG: unable to handle kernel NULL pointer dereference in corrupted 759 `, 760 Commands: []*SingleCommand{ 761 { 762 Command: CmdDup, 763 Str: "dup:", 764 Args: "BUG: unable to handle kernel NULL pointer dereference in corrupted", 765 }, 766 }, 767 }}, 768 769 {`Sender: syzkaller-bugs@googlegroups.com 770 To: syzbot <syzbot+6dd701dc797b23b8c761@syzkaller.appspotmail.com> 771 From: bar@foo.com 772 773 #syz dup: 774 BUG: unable to handle kernel NULL pointer dereference in corrupted 775 `, Email{ 776 Author: "bar@foo.com", 777 Cc: []string{"bar@foo.com", "syzbot@syzkaller.appspotmail.com"}, 778 Body: `#syz dup: 779 BUG: unable to handle kernel NULL pointer dereference in corrupted 780 `, 781 Commands: []*SingleCommand{ 782 { 783 Command: CmdDup, 784 Str: "dup:", 785 Args: "BUG: unable to handle kernel NULL pointer dereference in corrupted", 786 }, 787 }, 788 }}, 789 790 {`Sender: syzkaller-bugs@googlegroups.com 791 To: syzbot <syzbot+6dd701dc797b23b8c761@syzkaller.appspotmail.com> 792 From: bar@foo.com 793 794 #syz fix: 795 When freeing a lockf struct that already is part of a linked list, make sure to 796 `, Email{ 797 Author: "bar@foo.com", 798 Cc: []string{"bar@foo.com", "syzbot@syzkaller.appspotmail.com"}, 799 Body: `#syz fix: 800 When freeing a lockf struct that already is part of a linked list, make sure to 801 `, 802 Commands: []*SingleCommand{ 803 { 804 Command: CmdFix, 805 Str: "fix:", 806 Args: "When freeing a lockf struct that already is part of a linked list, make sure to", 807 }, 808 }, 809 }}, 810 {`Date: Sun, 7 May 2017 19:54:00 -0700 811 Message-ID: <123> 812 Subject: #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git master 813 From: bob@example.com 814 To: syzbot <foo+4564456@bar.com> 815 816 nothing to see here`, 817 Email{ 818 BugIDs: []string{"4564456"}, 819 MessageID: "<123>", 820 Date: time.Date(2017, time.May, 7, 19, 54, 0, 0, parseTestZone), 821 Subject: "#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git master", 822 Author: "bob@example.com", 823 Cc: []string{"bob@example.com"}, 824 Body: `nothing to see here`, 825 Commands: []*SingleCommand{ 826 { 827 Command: CmdTest, 828 Str: "test:", 829 Args: "git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git master", 830 }, 831 }, 832 }}, 833 {`Date: Sun, 7 May 2017 19:54:00 -0700 834 Message-ID: <123> 835 Sender: list@googlegroups.com 836 Subject: Subject 837 From: user@mail.com 838 To: syzbot <list@googlegroups.com> 839 840 nothing to see here`, 841 Email{ 842 MessageID: "<123>", 843 Date: time.Date(2017, time.May, 7, 19, 54, 0, 0, parseTestZone), 844 Subject: "Subject", 845 Author: "user@mail.com", 846 MailingList: "list@googlegroups.com", 847 Cc: []string{"list@googlegroups.com", "user@mail.com"}, 848 Body: `nothing to see here`, 849 }}, 850 {`Date: Sun, 7 May 2017 19:54:00 -0700 851 Message-ID: <123> 852 From: list@googlegroups.com 853 X-Original-From: user@mail.com 854 Subject: Subject 855 To: <user2@mail.com> 856 857 nothing to see here`, 858 Email{ 859 MessageID: "<123>", 860 Date: time.Date(2017, time.May, 7, 19, 54, 0, 0, parseTestZone), 861 Subject: "Subject", 862 Author: "user@mail.com", 863 MailingList: "list@googlegroups.com", 864 Cc: []string{"list@googlegroups.com", "user2@mail.com", "user@mail.com"}, 865 Body: `nothing to see here`, 866 }}, 867 // A faulty case, just check we handle it normally. 868 {`Date: Sun, 7 May 2017 19:54:00 -0700 869 Message-ID: <123> 870 From: list@googlegroups.com 871 Subject: Subject 872 To: <user2@mail.com> 873 874 nothing to see here`, 875 Email{ 876 MessageID: "<123>", 877 Date: time.Date(2017, time.May, 7, 19, 54, 0, 0, parseTestZone), 878 Subject: "Subject", 879 Author: "list@googlegroups.com", 880 MailingList: "list@googlegroups.com", 881 Cc: []string{"list@googlegroups.com", "user2@mail.com"}, 882 Body: `nothing to see here`, 883 }}, 884 {`Sender: syzkaller-bugs@googlegroups.com 885 Subject: Re: BUG: unable to handle kernel NULL pointer dereference in 886 sock_poll 887 To: syzbot <syzbot+344bb0f46d7719cd9483@syzkaller.appspotmail.com> 888 From: bar <bar@foo.com> 889 Message-ID: <1250334f-7220-2bff-5d87-b87573758d81@bar.com> 890 Date: Sun, 7 May 2017 19:54:00 -0700 891 MIME-Version: 1.0 892 Content-Type: text/plain; charset="UTF-8" 893 Content-Language: en-US 894 Content-Transfer-Encoding: quoted-printable 895 896 #syz=20 897 test: https://github.com/torvalds/linux.git 7b5bb460defa107dd2e82= 898 f950fddb9ea6bdb5e39 899 `, Email{ 900 MessageID: "<1250334f-7220-2bff-5d87-b87573758d81@bar.com>", 901 Date: time.Date(2017, time.May, 7, 19, 54, 0, 0, parseTestZone), 902 Subject: "Re: BUG: unable to handle kernel NULL pointer dereference in sock_poll", 903 Author: "bar@foo.com", 904 Cc: []string{"bar@foo.com", "syzbot@syzkaller.appspotmail.com"}, 905 Body: `#syz 906 test: https://github.com/torvalds/linux.git 7b5bb460defa107dd2e82f950fddb9ea6bdb5e39 907 `, 908 Commands: []*SingleCommand{ 909 { 910 Command: CmdTest, 911 Str: "test:", 912 Args: "https://github.com/torvalds/linux.git 7b5bb460defa107dd2e82f950fddb9ea6bdb5e39", 913 }, 914 }, 915 }}, 916 {`Sender: syzkaller-bugs@googlegroups.com 917 Subject: [PATCH] Some patch 918 To: <someone@foo.com> 919 From: bar <bar@foo.com> 920 Message-ID: <1250334f-7220-2bff-5d87-b87573758d81@bar.com> 921 Date: Sun, 7 May 2017 19:54:00 -0700 922 MIME-Version: 1.0 923 Content-Type: text/plain; charset="UTF-8" 924 Content-Language: en-US 925 Content-Transfer-Encoding: quoted-printable 926 927 Reported-by: syzbot <foo+223c7461c58c58a4cb10@bar.com> 928 `, Email{ 929 BugIDs: []string{"223c7461c58c58a4cb10"}, 930 MessageID: "<1250334f-7220-2bff-5d87-b87573758d81@bar.com>", 931 Date: time.Date(2017, time.May, 7, 19, 54, 0, 0, parseTestZone), 932 Subject: "[PATCH] Some patch", 933 Author: "bar@foo.com", 934 Cc: []string{"bar@foo.com", "someone@foo.com"}, 935 Body: `Reported-by: syzbot <foo+223c7461c58c58a4cb10@bar.com> 936 `, 937 }}, 938 {`Sender: syzkaller-bugs@googlegroups.com 939 Subject: [PATCH] Some patch 940 To: <someone@foo.com> 941 From: bar <bar@foo.com> 942 Message-ID: <1250334f-7220-2bff-5d87-b87573758d81@bar.com> 943 Date: Sun, 7 May 2017 19:54:00 -0700 944 MIME-Version: 1.0 945 Content-Type: text/plain; charset="UTF-8" 946 Content-Language: en-US 947 948 Link: https://bar.com/bug?extid=223c7461c58c58a4cb10@bar.com 949 `, Email{ 950 BugIDs: []string{"223c7461c58c58a4cb10"}, 951 MessageID: "<1250334f-7220-2bff-5d87-b87573758d81@bar.com>", 952 Date: time.Date(2017, time.May, 7, 19, 54, 0, 0, parseTestZone), 953 Subject: "[PATCH] Some patch", 954 Author: "bar@foo.com", 955 Cc: []string{"bar@foo.com", "someone@foo.com"}, 956 Body: `Link: https://bar.com/bug?extid=223c7461c58c58a4cb10@bar.com 957 `, 958 }}, 959 960 {`Sender: syzkaller-bugs@googlegroups.com 961 Subject: [PATCH] Some patch 962 To: <someone@foo.com> 963 From: bar <bar@foo.com> 964 Message-ID: <1250334f-7220-2bff-5d87-b87573758d81@bar.com> 965 Date: Sun, 7 May 2017 19:54:00 -0700 966 MIME-Version: 1.0 967 Content-Type: text/plain; charset="UTF-8" 968 Content-Language: en-US 969 Content-Transfer-Encoding: quoted-printable 970 971 Reported-by: syzbot <foo+223c7461c58c58a4cb10@bar.com> 972 Reported-by: syzbot <foo+9909090909090909@bar.com> 973 `, Email{ 974 BugIDs: []string{"223c7461c58c58a4cb10", "9909090909090909"}, 975 MessageID: "<1250334f-7220-2bff-5d87-b87573758d81@bar.com>", 976 Date: time.Date(2017, time.May, 7, 19, 54, 0, 0, parseTestZone), 977 Subject: "[PATCH] Some patch", 978 Author: "bar@foo.com", 979 Cc: []string{"bar@foo.com", "someone@foo.com"}, 980 Body: `Reported-by: syzbot <foo+223c7461c58c58a4cb10@bar.com> 981 Reported-by: syzbot <foo+9909090909090909@bar.com> 982 `, 983 }}, 984 {`Sender: syzkaller-bugs@googlegroups.com 985 Subject: [PATCH] Some patch 986 To: <someone@foo.com>, <foo+9909090909090909@bar.com> 987 From: bar <bar@foo.com> 988 Message-ID: <1250334f-7220-2bff-5d87-b87573758d81@bar.com> 989 Date: Sun, 7 May 2017 19:54:00 -0700 990 MIME-Version: 1.0 991 Content-Type: text/plain; charset="UTF-8" 992 Content-Language: en-US 993 Content-Transfer-Encoding: quoted-printable 994 995 Reported-by: syzbot <foo+223c7461c58c58a4cb10@bar.com> 996 `, Email{ 997 // First come BugIDs from header, then from the body. 998 BugIDs: []string{"9909090909090909", "223c7461c58c58a4cb10"}, 999 MessageID: "<1250334f-7220-2bff-5d87-b87573758d81@bar.com>", 1000 Date: time.Date(2017, time.May, 7, 19, 54, 0, 0, parseTestZone), 1001 Subject: "[PATCH] Some patch", 1002 Author: "bar@foo.com", 1003 Cc: []string{"bar@foo.com", "someone@foo.com"}, 1004 Body: `Reported-by: syzbot <foo+223c7461c58c58a4cb10@bar.com> 1005 `, 1006 }}, 1007 {`Sender: syzkaller-bugs@googlegroups.com 1008 Subject: Some discussion 1009 To: <someone@foo.com> 1010 From: bar <bar@foo.com> 1011 Message-ID: <1250334f-7220-2bff-5d87-b87573758d81@bar.com> 1012 Date: Sun, 7 May 2017 19:54:00 -0700 1013 MIME-Version: 1.0 1014 Content-Type: text/plain; charset="UTF-8" 1015 Content-Language: en-US 1016 Content-Transfer-Encoding: quoted-printable 1017 In-Reply-To: <000000000000f1a9d205f909f327@google.com> 1018 <000000000000ee3a3005f909f30a@google.com> 1019 Precedence: bulk 1020 List-ID: <linux-kernel.vger.kernel.org> 1021 X-Mailing-List: linux-kernel@vger.kernel.org 1022 1023 Some text 1024 `, Email{ 1025 MessageID: "<1250334f-7220-2bff-5d87-b87573758d81@bar.com>", 1026 // The first one should be picked up. 1027 InReplyTo: "<000000000000f1a9d205f909f327@google.com>", 1028 Date: time.Date(2017, time.May, 7, 19, 54, 0, 0, parseTestZone), 1029 Subject: "Some discussion", 1030 Author: "bar@foo.com", 1031 Cc: []string{"bar@foo.com", "someone@foo.com"}, 1032 Body: "Some text\n", 1033 }}, 1034 {`Sender: syzkaller-bugs@googlegroups.com 1035 Subject: Re: BUG: unable to handle kernel NULL pointer dereference in 1036 sock_poll 1037 To: syzbot <syzbot+344bb0f46d7719cd9483@syzkaller.appspotmail.com> 1038 From: bar <bar@foo.com> 1039 Message-ID: <1250334f-7220-2bff-5d87-b87573758d81@bar.com> 1040 Date: Sun, 7 May 2017 19:54:00 -0700 1041 MIME-Version: 1.0 1042 Content-Type: text/plain; charset="UTF-8" 1043 Content-Language: en-US 1044 Content-Transfer-Encoding: quoted-printable 1045 1046 #syz test: aaa bbb 1047 #syz test: ccc ddd 1048 `, Email{ 1049 MessageID: "<1250334f-7220-2bff-5d87-b87573758d81@bar.com>", 1050 Date: time.Date(2017, time.May, 7, 19, 54, 0, 0, parseTestZone), 1051 Subject: "Re: BUG: unable to handle kernel NULL pointer dereference in sock_poll", 1052 Author: "bar@foo.com", 1053 Cc: []string{"bar@foo.com", "syzbot@syzkaller.appspotmail.com"}, 1054 Body: `#syz test: aaa bbb 1055 #syz test: ccc ddd 1056 `, 1057 Commands: []*SingleCommand{ 1058 { 1059 Command: CmdTest, 1060 Str: "test:", 1061 Args: "aaa bbb", 1062 }, 1063 { 1064 Command: CmdTest, 1065 Str: "test:", 1066 Args: "ccc ddd", 1067 }, 1068 }, 1069 }}, 1070 }