Skip to content

Commit 221fd1e

Browse files
committed
Merge tag 'for-linus-6.11-1' of https://github.com/cminyard/linux-ipmi
Pull IPMI updates from Corey Minyard: "Some cleanups for device changes coming, and some range checks on data coming from a host to a BMC" * tag 'for-linus-6.11-1' of https://github.com/cminyard/linux-ipmi: ipmi: Drop explicit initialization of struct i2c_device_id::driver_data to 0 ipmi: ssif_bmc: prevent integer overflow on 32bit systems
2 parents a5cb6b2 + 19a0115 commit 221fd1e

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

drivers/char/ipmi/ipmb_dev_int.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,8 @@ static void ipmb_remove(struct i2c_client *client)
350350
}
351351

352352
static const struct i2c_device_id ipmb_id[] = {
353-
{ "ipmb-dev", 0 },
354-
{},
353+
{ "ipmb-dev" },
354+
{}
355355
};
356356
MODULE_DEVICE_TABLE(i2c, ipmb_id);
357357

drivers/char/ipmi/ipmi_ipmb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,8 @@ MODULE_DEVICE_TABLE(of, of_ipmi_ipmb_match);
561561
#endif
562562

563563
static const struct i2c_device_id ipmi_ipmb_id[] = {
564-
{ DEVICE_NAME, 0 },
565-
{},
564+
{ DEVICE_NAME },
565+
{}
566566
};
567567
MODULE_DEVICE_TABLE(i2c, ipmi_ipmb_id);
568568

drivers/char/ipmi/ipmi_ssif.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2049,7 +2049,7 @@ static int dmi_ipmi_probe(struct platform_device *pdev)
20492049
#endif
20502050

20512051
static const struct i2c_device_id ssif_id[] = {
2052-
{ DEVICE_NAME, 0 },
2052+
{ DEVICE_NAME },
20532053
{ }
20542054
};
20552055
MODULE_DEVICE_TABLE(i2c, ssif_id);

drivers/char/ipmi/ssif_bmc.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,15 @@ static ssize_t ssif_bmc_write(struct file *file, const char __user *buf, size_t
177177
unsigned long flags;
178178
ssize_t ret;
179179

180-
if (count > sizeof(struct ipmi_ssif_msg))
180+
if (count < sizeof(msg.len) ||
181+
count > sizeof(struct ipmi_ssif_msg))
181182
return -EINVAL;
182183

183184
if (copy_from_user(&msg, buf, count))
184185
return -EFAULT;
185186

186-
if (!msg.len || count < sizeof_field(struct ipmi_ssif_msg, len) + msg.len)
187+
if (!msg.len || msg.len > IPMI_SSIF_PAYLOAD_MAX ||
188+
count < sizeof_field(struct ipmi_ssif_msg, len) + msg.len)
187189
return -EINVAL;
188190

189191
spin_lock_irqsave(&ssif_bmc->lock, flags);
@@ -850,8 +852,8 @@ static const struct of_device_id ssif_bmc_match[] = {
850852
MODULE_DEVICE_TABLE(of, ssif_bmc_match);
851853

852854
static const struct i2c_device_id ssif_bmc_id[] = {
853-
{ DEVICE_NAME, 0 },
854-
{ },
855+
{ DEVICE_NAME },
856+
{ }
855857
};
856858
MODULE_DEVICE_TABLE(i2c, ssif_bmc_id);
857859

0 commit comments

Comments
 (0)