Commit c034203
nfsd: fix double fget() bug in __write_ports_addfd()
The bug here is that you cannot rely on getting the same socket
from multiple calls to fget() because userspace can influence
that. This is a kind of double fetch bug.
The fix is to delete the svc_alien_sock() function and instead do
the checking inside the svc_addsock() function.
Fixes: 3064639 ("nfsd: check passed socket's net matches NFSd superblock's one")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: NeilBrown <neilb@suse.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>1 parent d53d700 commit c034203
3 files changed
+10
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
690 | 690 | | |
691 | 691 | | |
692 | 692 | | |
693 | | - | |
694 | | - | |
695 | | - | |
696 | | - | |
697 | | - | |
698 | 693 | | |
699 | 694 | | |
700 | 695 | | |
701 | 696 | | |
702 | | - | |
| 697 | + | |
703 | 698 | | |
704 | 699 | | |
705 | 700 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
68 | 67 | | |
69 | 68 | | |
70 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1480 | 1480 | | |
1481 | 1481 | | |
1482 | 1482 | | |
1483 | | - | |
1484 | | - | |
1485 | | - | |
1486 | | - | |
1487 | | - | |
1488 | | - | |
1489 | | - | |
1490 | | - | |
1491 | | - | |
1492 | | - | |
1493 | | - | |
1494 | | - | |
1495 | | - | |
1496 | | - | |
1497 | | - | |
1498 | | - | |
1499 | 1483 | | |
1500 | 1484 | | |
1501 | 1485 | | |
| 1486 | + | |
1502 | 1487 | | |
1503 | 1488 | | |
1504 | 1489 | | |
| |||
1508 | 1493 | | |
1509 | 1494 | | |
1510 | 1495 | | |
1511 | | - | |
1512 | | - | |
| 1496 | + | |
| 1497 | + | |
1513 | 1498 | | |
1514 | 1499 | | |
1515 | 1500 | | |
| |||
1520 | 1505 | | |
1521 | 1506 | | |
1522 | 1507 | | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
1523 | 1511 | | |
1524 | 1512 | | |
1525 | 1513 | | |
| |||
0 commit comments