Commit eb09c6d
s390/qeth: fix length check in SNMP processing
[ Upstream commit 9a764c1 ]
The response for a SNMP request can consist of multiple parts, which
the cmd callback stages into a kernel buffer until all parts have been
received. If the callback detects that the staging buffer provides
insufficient space, it bails out with error.
This processing is buggy for the first part of the response - while it
initially checks for a length of 'data_len', it later copies an
additional amount of 'offsetof(struct qeth_snmp_cmd, data)' bytes.
Fix the calculation of 'data_len' for the first part of the response.
This also nicely cleans up the memcpy code.
Fixes: 1da177e ("Linux-2.6.12-rc2")
Signed-off-by: Julian Wiedmann <[email protected]>
Reviewed-by: Ursula Braun <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent 4789768 commit eb09c6d
1 file changed
+12
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4545 | 4545 | | |
4546 | 4546 | | |
4547 | 4547 | | |
4548 | | - | |
4549 | 4548 | | |
| 4549 | + | |
4550 | 4550 | | |
4551 | 4551 | | |
4552 | 4552 | | |
4553 | 4553 | | |
4554 | 4554 | | |
4555 | 4555 | | |
4556 | 4556 | | |
4557 | | - | |
4558 | 4557 | | |
4559 | 4558 | | |
4560 | 4559 | | |
| |||
4567 | 4566 | | |
4568 | 4567 | | |
4569 | 4568 | | |
4570 | | - | |
4571 | | - | |
4572 | | - | |
4573 | | - | |
| 4569 | + | |
| 4570 | + | |
| 4571 | + | |
| 4572 | + | |
| 4573 | + | |
| 4574 | + | |
| 4575 | + | |
| 4576 | + | |
| 4577 | + | |
4574 | 4578 | | |
4575 | 4579 | | |
4576 | 4580 | | |
| |||
4583 | 4587 | | |
4584 | 4588 | | |
4585 | 4589 | | |
4586 | | - | |
4587 | | - | |
4588 | | - | |
4589 | | - | |
4590 | | - | |
4591 | | - | |
4592 | | - | |
4593 | | - | |
4594 | | - | |
| 4590 | + | |
4595 | 4591 | | |
| 4592 | + | |
4596 | 4593 | | |
4597 | 4594 | | |
4598 | 4595 | | |
| |||
0 commit comments