mirror of
https://github.com/torvalds/linux.git
synced 2026-09-14 16:10:02 +02:00
powerpc fixes for 7.2 #4
- Couple of fixes for mem leak and underflow case Thanks to: George Wilson, R Nageswara Sastry -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEqX2DNAOgU8sBX3pRpnEsdPSHZJQFAmp2vToACgkQpnEsdPSH ZJTdSRAAyU2MKr444tK8kb/wFlZJ2kT2nHmLvotr7OrTPfb3A48cTcUYqzi3aJ5r hbethTk1diJa5fM+hbN5AJLA3DBNSknAEDJiyQKeE1knOr0Q1qn3NIQL6ROJaIe0 vTeOkJHzDzpU9dWnYbhoAxuNC+rQCicuNjB5WPd93LayI2kP1BN94uEb6GU5AMOz HLqH3j/9kWtFTt+x6pbIzSiOQy6+p3lbtjJS/FMsn2wqeqRyY2IehFBP27+dpjJX z2S20qnrS+8CuZ6tut/vSJIdIozRROwGXLTx1jRHXAGsfdWCp3W+drcY3lmwFRtK xq1x6z0c6+JJvaBPGtLDQCi7wURZ3DAlBHEA8PbfLYLogt4AuVBA0WFSI1Vlr4LX rTsuG/eV4GgjSEFEHRCa68+PuQ4imjNauyX2Ty+74rqzQwIgG4O0btnJFiCHZymt hZXBDbdCr17U1+2mQI5T//n67i+sKSpgM492ti+vpaYK8Ou0Ki1oOKnPiH6KyTXz QkvwfOTKrdrMVVUgI1jtM/19ewa/z/0OoBQBT8vmRY6qkbR0k6SCV6Na9tQVAxpw l6JNcFpYidvLuXJq5NhtxdyGFqh1a/WvNR7Q/LkVmpNXVauqiYTRe4HA7RtCmOv2 JGTpk1fzn2aq+pojDZnUV7EoVg+keO1EGhPAWEJ/KDEoMEcI/5o= =HV3X -----END PGP SIGNATURE----- Merge tag 'powerpc-7.2-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux Pull powerpc fixes from Madhavan Srinivasan: - A couple of fixes for a memory leak and a underflow case Thanks to George Wilson and R Nageswara Sastry * tag 'powerpc-7.2-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/pseries: lparcfg - fix kbuf[] underflow powerpc/pseries: pci - logic bug powerpc/pseries: papr-phy-attest - validate cmd.length, plug mem leak
This commit is contained in:
commit
afe80aebd3
|
|
@ -699,7 +699,7 @@ static ssize_t lparcfg_write(struct file *file, const char __user * buf,
|
|||
if (!firmware_has_feature(FW_FEATURE_SPLPAR))
|
||||
return -EINVAL;
|
||||
|
||||
if (count > sizeof(kbuf))
|
||||
if (count == 0 || count > sizeof(kbuf))
|
||||
return -EINVAL;
|
||||
|
||||
if (copy_from_user(kbuf, buf, count))
|
||||
|
|
|
|||
|
|
@ -230,10 +230,17 @@ static long papr_phy_attest_create_handle(struct papr_phy_attest_io_block __user
|
|||
return -ENOMEM;
|
||||
|
||||
if (copy_from_user(¶ms->cmd, ulc,
|
||||
sizeof(struct papr_phy_attest_io_block)))
|
||||
sizeof(struct papr_phy_attest_io_block))) {
|
||||
kfree(params);
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
params->cmd_len = be32_to_cpu(params->cmd.length);
|
||||
if (params->cmd_len == 0 || params->cmd_len > sizeof(params->cmd)) {
|
||||
kfree(params);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
seq = (struct papr_rtas_sequence) {
|
||||
.begin = phy_attest_sequence_begin,
|
||||
.end = phy_attest_sequence_end,
|
||||
|
|
@ -246,6 +253,9 @@ static long papr_phy_attest_create_handle(struct papr_phy_attest_io_block __user
|
|||
&papr_phy_attest_handle_ops,
|
||||
"[papr-physical-attestation]");
|
||||
|
||||
if (fd < 0)
|
||||
kfree(params);
|
||||
|
||||
return fd;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ static int pseries_pci_sriov_enable(struct pci_dev *pdev, u16 num_vfs)
|
|||
|
||||
/* First integer stores max config */
|
||||
max_config_vfs = of_read_number(&max_vfs[0], 1);
|
||||
if (max_config_vfs < num_vfs && num_vfs > MAX_VFS_FOR_MAP_PE) {
|
||||
if (max_config_vfs < num_vfs || num_vfs > MAX_VFS_FOR_MAP_PE) {
|
||||
dev_err(&pdev->dev,
|
||||
"Num VFs %x > %x Configurable VFs\n",
|
||||
num_vfs, (num_vfs > MAX_VFS_FOR_MAP_PE) ?
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user