ALSA: jack: Fix mutex call in snd_jack_report()
Subsystems (30)
Sasha Levin
maintainerPATCH 3/190 ALSA: jack: Fix mutex call in snd_jack_report()
In reply to a message not in the archiveFrom: Takashi Iwai <[email protected]>
[ Upstream commit 89dbb335cb6a627a4067bc42caa09c8bc3326d40 ]
snd_jack_report() is supposed to be callable from an IRQ context, too, and it's indeed used in that way from virtsnd driver. The fix for input_dev race in commit 1b6a6fc5280e ("ALSA: jack: Access input_dev under mutex"), however, introduced a mutex lock in snd_jack_report(), and this resulted in a potential sleep-in-atomic.
For addressing that problem, this patch changes the relevant code to use the object get/put and removes the mutex usage. That is, snd_jack_report(), it takes input_get_device() and leaves with input_put_device() for assuring the input_dev being assigned.
Although the whole mutex could be reduced, we keep it because it can be still a protection for potential races between creation and deletion.
--- sound/core/jack.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
sound/core/jack.c +7 -8
@@ -378,6 +378,7 @@ void snd_jack_report(struct snd_jack *jack, int status) {struct snd_jack_kctl *jack_kctl;#ifdef CONFIG_SND_JACK_INPUT_DEV +struct input_dev *idev;int i;#endif
@@ -389,30 +390,28 @@ void snd_jack_report(struct snd_jack *jack, int status) status & jack_kctl->mask_bits);#ifdef CONFIG_SND_JACK_INPUT_DEV -mutex_lock (&jack->input_dev_lock); -if (!jack->input_dev) { -mutex_unlock (&jack->input_dev_lock); + idev =input_get_device (jack->input_dev); +if (!idev)return ; - }for (i =0 ; i <ARRAY_SIZE (jack->key); i++) {int testbit =SND_JACK_BTN_0 >> i;if (jack->type & testbit) -input_report_key (jack->input_dev, jack->key[i], +input_report_key (idev, jack->key[i], status & testbit); }for (i =0 ; i <ARRAY_SIZE (jack_switch_types); i++) {int testbit =1 << i;if (jack->type & testbit) -input_report_switch (jack->input_dev, +input_report_switch (idev, jack_switch_types[i], status & testbit); } -input_sync (jack->input_dev); -mutex_unlock (&jack->input_dev_lock); +input_sync (idev); +input_put_device (idev);#endif /* CONFIG_SND_JACK_INPUT_DEV */ }EXPORT_SYMBOL (snd_jack_report);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 4/190 pinctrl: amd: Detect internal GPIO0 debounce handling
In reply to a message not in the archiveFrom: Mario Limonciello <[email protected]>
[ Upstream commit 968ab9261627fa305307e3935ca1a32fcddd36cb ]
commit 4e5a04be88fe ("pinctrl: amd: disable and mask interrupts on probe") had a mistake in loop iteration 63 that it would clear offset 0xFC instead of 0x100. Offset 0xFC is actually WAKE_INT_MASTER_REG. This was clearing bits 13 and 15 from the register which significantly changed the expected handling for some platforms for GPIO0.
commit b26cd9325be4 ("pinctrl: amd: Disable and mask interrupts on resume") actually fixed this bug, but lead to regressions on Lenovo Z13 and some other systems. This is because there was no handling in the driver for bit 15 debounce behavior.
Quoting a public BKDG:
``` EnWinBlueBtn. Read-write. Reset: 0. 0=GPIO0 detect debounced power button; Power button override is 4 seconds. 1=GPIO0 detect debounced power button in S3/S5/S0i3, and detect "pressed less than 2 seconds" and "pressed 2~10 seconds" in S0; Power button override is 10 seconds ```
Cross referencing the same master register in Windows it's obvious that Windows doesn't use debounce values in this configuration. So align the Linux driver to do this as well. This fixes wake on lid when WAKE_INT_MASTER_REG is properly programmed.
--- drivers/pinctrl/pinctrl-amd.c | 7 +++++++ drivers/pinctrl/pinctrl-amd.h | 1 + 2 files changed, 8 insertions(+)
drivers/pinctrl/pinctrl-amd.c +7 -0
@@ -114,6 +114,12 @@ static int amd_gpio_set_debounce(struct gpio_chip *gc, unsigned offset,struct amd_gpio *gpio_dev =gpiochip_get_data (gc);raw_spin_lock_irqsave (&gpio_dev->lock, flags); + +/* Use special handling for Pin0 debounce */ + pin_reg =readl (gpio_dev->base +WAKE_INT_MASTER_REG ); +if (pin_reg &INTERNAL_GPIO0_DEBOUNCE ) + debounce =0 ; + pin_reg =readl (gpio_dev->base + offset *4 );if (debounce) {
@@ -191,6 +197,7 @@ static void amd_gpio_dbg_show(struct seq_file *s, struct gpio_chip *gc)char *output_value;char *output_enable; +seq_printf (s,"WAKE_INT_MASTER_REG: 0x%08x\n" ,readl (gpio_dev->base +WAKE_INT_MASTER_REG ));for (bank =0 ; bank < gpio_dev->hwbank_num; bank++) {seq_printf (s,"GPIO bank%d\t" , bank);
drivers/pinctrl/pinctrl-amd.h +1 -0
@@ -21,6 +21,7 @@#define AMD_GPIO_PINS_BANK3 32#define WAKE_INT_MASTER_REG 0xfc +#define INTERNAL_GPIO0_DEBOUNCE (1 << 15)#define EOI_MASK (1 << 29)#define WAKE_INT_STATUS_REG0 0x2f8
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 5/190 btrfs: fix extent buffer leak after tree mod log failure at split_node()
In reply to a message not in the archiveFrom: Filipe Manana <[email protected]>
[ Upstream commit ede600e497b1461d06d22a7d17703d9096868bc3 ]
At split_node(), if we fail to log the tree mod log copy operation, we return without unlocking the split extent buffer we just allocated and without decrementing the reference we own on it. Fix this by unlocking it and decrementing the ref count before returning.
--- fs/btrfs/ctree.c | 2 ++ 1 file changed, 2 insertions(+)
fs/btrfs/ctree.c +2 -0
@@ -3537,6 +3537,8 @@ static noinline int split_node(struct btrfs_trans_handle *trans, ret =tree_mod_log_eb_copy (fs_info, split, c,0 , mid, c_nritems - mid);if (ret) { +btrfs_tree_unlock (split); +free_extent_buffer (split);btrfs_abort_transaction (trans, ret);return ret; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 7/190 IMA: allow/fix UML builds
In reply to a message not in the archiveFrom: Randy Dunlap <[email protected]>
[ Upstream commit 644f17412f5acf01a19af9d04a921937a2bc86c6 ]
UML supports HAS_IOMEM since 0bbadafdc49d (um: allow disabling NO_IOMEM).
Current IMA build on UML fails on allmodconfig (with TCG_TPM=m):
ld: security/integrity/ima/ima_queue.o: in function `ima_add_template_entry':
ima_queue.c:(.text+0x2d9): undefined reference to `tpm_pcr_extend'
ld: security/integrity/ima/ima_init.o: in function `ima_init':
ima_init.c:(.init.text+0x43f): undefined reference to `tpm_default_chip'
ld: security/integrity/ima/ima_crypto.o: in function `ima_calc_boot_aggregate_tfm':
ima_crypto.c:(.text+0x1044): undefined reference to `tpm_pcr_read'
ld: ima_crypto.c:(.text+0x10d8): undefined reference to `tpm_pcr_read'
Modify the IMA Kconfig entry so that it selects TCG_TPM if HAS_IOMEM is set, regardless of the UML Kconfig setting.
This updates TCG_TPM from =m to =y and fixes the linker errors.
--- security/integrity/ima/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/integrity/ima/Kconfig +1 -1
@@ -8,7 +8,7 @@ config IMA select CRYPTO_MD5 select CRYPTO_SHA1 select CRYPTO_HASH_INFO - select TCG_TPM if HAS_IOMEM && !UML + select TCG_TPM if HAS_IOMEM select TCG_TIS if TCG_TPM && X86 select TCG_CRB if TCG_TPM && ACPI select TCG_IBMVTPM if TCG_TPM && PPC_PSERIES
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 8/190 iio: addac: stx104: Fix race condition for stx104_write_raw()
In reply to a message not in the archiveFrom: William Breathitt Gray <[email protected]>
[ Upstream commit 9740827468cea80c42db29e7171a50e99acf7328 ]
The priv->chan_out_states array and actual DAC value can become mismatched if stx104_write_raw() is called concurrently. Prevent such a race condition by utilizing a mutex.
--- drivers/iio/adc/stx104.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/iio/adc/stx104.c +8 -0
@@ -23,6 +23,7 @@#include <linux/kernel.h> #include <linux/module.h> #include <linux/moduleparam.h> +#include <linux/mutex.h> #include <linux/spinlock.h> #define STX104_OUT_CHAN (chan) { \
@@ -54,10 +55,12 @@ MODULE_PARM_DESC(base, "Apex Embedded Systems STX104 base addresses");/** * struct stx104_iio - IIO device private data structure +* @lock: synchronization lock to prevent I/O race conditions * @chan_out_states: channels' output states * @base: base port address of the IIO device */ struct stx104_iio { +struct mutex lock;unsigned int chan_out_states[STX104_NUM_OUT_CHAN ];unsigned int base; };
@@ -160,9 +163,12 @@ static int stx104_write_raw(struct iio_dev *indio_dev,if ((unsigned int )val >65535 )return -EINVAL ; +mutex_lock (&priv->lock); + priv->chan_out_states[chan->channel] = val;outw (val, priv->base +4 +2 * chan->channel); +mutex_unlock (&priv->lock);return 0 ; }return -EINVAL ;
@@ -323,6 +329,8 @@ static int stx104_probe(struct device *dev, unsigned int id) priv =iio_priv (indio_dev); priv->base = base[id]; +mutex_init (&priv->lock); +/* configure device for software trigger operation */ outb (0 , base[id] +9 );
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 9/190 block: fix signed int overflow in Amiga partition support
In reply to a message not in the archiveFrom: Michael Schmitz <[email protected]>
[ Upstream commit fc3d092c6bb48d5865fec15ed5b333c12f36288c ]
The Amiga partition parser module uses signed int for partition sector address and count, which will overflow for disks larger than 1 TB.
Use sector_t as type for sector address and size to allow using disks up to 2 TB without LBD support, and disks larger than 2 TB with LBD.
This bug was reported originally in 2012, and the fix was created by the RDB author, Joanne Dow <[email protected]>. A patch had been discussed and reviewed on linux-m68k at that time but never officially submitted. This patch differs from Joanne's patch only in its use of sector_t instead of unsigned int. No checking for overflows is done (see patch 3 of this series for that).
Message-ID: <[email protected]>
--- block/partitions/amiga.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
block/partitions/amiga.c +5 -4
@@ -32,7 +32,8 @@ int amiga_partition(struct parsed_partitions *state)unsigned char *data;struct RigidDiskBlock *rdb;struct PartitionBlock *pb; -int start_sect, nr_sects, blk, part, res =0 ; +sector_t start_sect, nr_sects; +int blk, part, res =0 ;int blksize =1 ;/* Multiplier for disk block size */ int slot =1 ;char b[BDEVNAME_SIZE ];
@@ -100,14 +101,14 @@ int amiga_partition(struct parsed_partitions *state)/* Tell Kernel about it */ - nr_sects = (be32_to_cpu (pb->pb_Environment[10 ]) +1 - -be32_to_cpu (pb->pb_Environment[9 ])) * + nr_sects = ((sector_t )be32_to_cpu (pb->pb_Environment[10 ]) +1 - +be32_to_cpu (pb->pb_Environment[9 ])) *be32_to_cpu (pb->pb_Environment[3 ]) *be32_to_cpu (pb->pb_Environment[5 ]) * blksize;if (!nr_sects)continue ; - start_sect =be32_to_cpu (pb->pb_Environment[9 ]) * + start_sect = (sector_t )be32_to_cpu (pb->pb_Environment[9 ]) *be32_to_cpu (pb->pb_Environment[3 ]) *be32_to_cpu (pb->pb_Environment[5 ]) * blksize;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 12/190 selftests/ftrace: Add new test case which checks non unique symbol
In reply to a message not in the archiveFrom: Francis Laniel <[email protected]>
[ Upstream commit 03b80ff8023adae6780e491f66e932df8165e3a0 ]
If name_show() is non unique, this test will try to install a kprobe on this function which should fail returning EADDRNOTAVAIL.
On kernel where name_show() is not unique, this test is skipped.
--- .../ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc
tools/testing/selftests/ftrace/test.d/kprobe/kprobe_non_uniq_symbol.tc new file +13 -0
@@ -0,0 +1,13 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0 +# description: Test failure of registering kprobe on non unique symbol +# requires: kprobe_events + +SYMBOL='name_show' + +# We skip this test on kernel where SYMBOL is unique or does not exist. +if [ "$(grep -c -E "[[:alnum:]]+ t ${SYMBOL}" /proc/kallsyms)" -le '1' ]; then + exit_unsupported +fi + +! echo "p:test_non_unique ${SYMBOL}" > kprobe_events
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 13/190 iio: exynos-adc: request second interupt only when touchscreen mode is used
In reply to a message not in the archiveFrom: Marek Szyprowski <[email protected]>
[ Upstream commit 865b080e3229102f160889328ce2e8e97aa65ea0 ]
Second interrupt is needed only when touchscreen mode is used, so don't request it unconditionally. This removes the following annoying warning during boot:
exynos-adc 14d10000.adc: error -ENXIO: IRQ index 1 not found
--- drivers/iio/adc/exynos_adc.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-)
drivers/iio/adc/exynos_adc.c +14 -10
@@ -787,6 +787,12 @@ static int exynos_adc_probe(struct platform_device *pdev) } } +/* leave out any TS related code if unreachable */ +if (IS_REACHABLE (CONFIG_INPUT )) { + has_ts =of_property_read_bool (pdev->dev.of_node, +"has-touchscreen" ) || pdata; + } + irq =platform_get_irq (pdev,0 );if (irq <0 ) {dev_err (&pdev->dev,"no irq resource?\n" );
@@ -794,11 +800,15 @@ static int exynos_adc_probe(struct platform_device *pdev) } info->irq = irq; - irq =platform_get_irq (pdev,1 ); -if (irq == -EPROBE_DEFER ) -return irq; +if (has_ts) { + irq =platform_get_irq (pdev,1 ); +if (irq == -EPROBE_DEFER ) +return irq; - info->tsirq = irq; + info->tsirq = irq; + }else { + info->tsirq =-1 ; + } info->dev = &pdev->dev;
@@ -865,12 +875,6 @@ static int exynos_adc_probe(struct platform_device *pdev)if (info->data->init_hw) info->data->init_hw (info); -/* leave out any TS related code if unreachable */ -if (IS_REACHABLE (CONFIG_INPUT )) { - has_ts =of_property_read_bool (pdev->dev.of_node, -"has-touchscreen" ) || pdata; - } -if (pdata) info->delay = pdata->delay;else
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 21/190 MIPS: KVM: Fix a build warning about variable set but not used
In reply to a message not in the archiveFrom: Huacai Chen <[email protected]>
[ Upstream commit 83767a67e7b6a0291cde5681ec7e3708f3f8f877 ]
After commit 411740f5422a ("KVM: MIPS/MMU: Implement KVM_CAP_SYNC_MMU") old_pte is no longer used in kvm_mips_map_page(). So remove it to fix a build warning about variable set but not used:
arch/mips/kvm/mmu.c: In function 'kvm_mips_map_page':
Quoted 1 line
Quoted 1 line
arch/mips/kvm/mmu.c:701:29: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
701 | pte_t *ptep, entry, old_pte;
| ^~~~~~~--- arch/mips/kvm/mmu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/mips/kvm/mmu.c +1 -2
@@ -701,7 +701,7 @@ static int kvm_mips_map_page(struct kvm_vcpu *vcpu, unsigned long gpa,gfn_t gfn = gpa >>PAGE_SHIFT ;int srcu_idx, err;kvm_pfn_t pfn; -pte_t *ptep, entry, old_pte; +pte_t *ptep, entry;bool writeable;unsigned long prot_bits;unsigned long mmu_seq;
@@ -774,7 +774,6 @@ static int kvm_mips_map_page(struct kvm_vcpu *vcpu, unsigned long gpa, entry =pfn_pte (pfn,__pgprot (prot_bits));/* Write the PTE */ - old_pte = *ptep;set_pte (ptep, entry); err =0 ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 22/190 smb3: fix touch -h of symlink
In reply to a message not in the archiveFrom: Steve French <[email protected]>
[ Upstream commit 475efd9808a3094944a56240b2711349e433fb66 ]
For example:
touch -h -t 02011200 testfile
where testfile is a symlink would not change the timestamp, but
touch -t 02011200 testfiledoes work to change the timestamp of the target
--- fs/cifs/cifsfs.c | 1 + 1 file changed, 1 insertion(+)
fs/cifs/cifsfs.c +1 -0
@@ -924,6 +924,7 @@ const struct inode_operations cifs_file_inode_ops = {const struct inode_operations cifs_symlink_inode_ops = { .get_link = cifs_get_link, + .setattr = cifs_setattr, .permission = cifs_permission, .listxattr = cifs_listxattr, };
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 23/190 fbdev: stifb: Make the STI next font pointer a 32-bit signed offset
In reply to a message not in the archiveFrom: Helge Deller <[email protected]>
[ Upstream commit 8a32aa17c1cd48df1ddaa78e45abcb8c7a2220d6 ]
The pointer to the next STI font is actually a signed 32-bit offset. With this change the 64-bit kernel will correctly subract the (signed 32-bit) offset instead of adding a (unsigned 32-bit) offset. It has no effect on 32-bit kernels.
This fixes the stifb driver with a 64-bit kernel on qemu.
--- drivers/video/fbdev/sticore.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/sticore.h +1 -1
@@ -237,7 +237,7 @@ struct sti_rom_font {u8 height;u8 font_type;/* language type */ u8 bytes_per_char; -u32 next_font; +s32 next_font;/* note: signed int */ u8 underline_height;u8 underline_pos;u8 res008[2 ];
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 25/190 arm64: dts: mediatek: mt8173-evb: Fix regulator-fixed node names
In reply to a message not in the archiveFrom: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit 24165c5dad7ba7c7624d05575a5e0cc851396c71 ]
Fix a unit_address_vs_reg warning for the USB VBUS fixed regulators by renaming the regulator nodes from regulator@{0,1} to regulator-usb-p0 and regulator-usb-p1.
--- arch/arm64/boot/dts/mediatek/mt8173-evb.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/mediatek/mt8173-evb.dts +2 -2
@@ -51,7 +51,7 @@ id-gpio = <&pio 16 GPIO_ACTIVE_HIGH>; }; - usb_p1_vbus: regulator@0 { + usb_p1_vbus: regulator-usb-p1 { compatible = "regulator-fixed"; regulator-name = "usb_vbus"; regulator-min-microvolt = <5000000>;
@@ -60,7 +60,7 @@ enable-active-high; }; - usb_p0_vbus: regulator@1 { + usb_p0_vbus: regulator-usb-p0 { compatible = "regulator-fixed"; regulator-name = "vbus"; regulator-min-microvolt = <5000000>;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 28/190 btrfs: do not allow non subvolume root targets for snapshot
In reply to a message not in the archiveFrom: Josef Bacik <[email protected]>
[ Upstream commit a8892fd71933126ebae3d60aec5918d4dceaae76 ]
Our btrfs subvolume snapshot <source> <destination> utility enforces that <source> is the root of the subvolume, however this isn't enforced in the kernel. Update the kernel to also enforce this limitation to avoid problems with other users of this ioctl that don't have the appropriate checks in place.
--- fs/btrfs/ioctl.c | 9 +++++++++ 1 file changed, 9 insertions(+)
fs/btrfs/ioctl.c +9 -0
@@ -1695,6 +1695,15 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file,* are limited to own subvolumes only */ ret = -EPERM ; + }else if (btrfs_ino (BTRFS_I (src_inode)) !=BTRFS_FIRST_FREE_OBJECTID ) { +/* +* Snapshots must be made with the src_inode referring +* to the subvolume inode, otherwise the permission +* checking above is useless because we may have +* permission on a lower directory but not the subvol +* itself. +*/ + ret = -EINVAL ; }else { ret = btrfs_mksubvol(&file->f_path, name, namelen, BTRFS_I(src_inode)->root,
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 29/190 smb: client: fix OOB in smbCalcSize()
In reply to a message not in the archiveFrom: Paulo Alcantara <[email protected]>
[ Upstream commit b35858b3786ddbb56e1c35138ba25d6adf8d0bef ]
Validate @smb->WordCount to avoid reading off the end of @smb and thus causing the following KASAN splat:
BUG: KASAN: slab-out-of-bounds in smbCalcSize+0x32/0x40 [cifs] Read of size 2 at addr ffff88801c024ec5 by task cifsd/1328 CPU: 1 PID: 1328 Comm: cifsd Not tainted 6.7.0-rc5 #9 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.2-3-gd478f380-rebuilt.opensuse.org 04/01/2014 Call Trace: <TASK> dump_stack_lvl+0x4a/0x80 print_report+0xcf/0x650 ? srso_alias_return_thunk+0x5/0xfbef5 ? srso_alias_return_thunk+0x5/0xfbef5 ? __phys_addr+0x46/0x90 kasan_report+0xd8/0x110 ? smbCalcSize+0x32/0x40 [cifs] ? smbCalcSize+0x32/0x40 [cifs] kasan_check_range+0x105/0x1b0 smbCalcSize+0x32/0x40 [cifs] checkSMB+0x162/0x370 [cifs] ? __pfx_checkSMB+0x10/0x10 [cifs] cifs_handle_standard+0xbc/0x2f0 [cifs] ? srso_alias_return_thunk+0x5/0xfbef5 cifs_demultiplex_thread+0xed1/0x1360 [cifs] ? __pfx_cifs_demultiplex_thread+0x10/0x10 [cifs] ? srso_alias_return_thunk+0x5/0xfbef5 ? lockdep_hardirqs_on_prepare+0x136/0x210 ? __pfx_lock_release+0x10/0x10 ? srso_alias_return_thunk+0x5/0xfbef5 ? mark_held_locks+0x1a/0x90 ? lockdep_hardirqs_on_prepare+0x136/0x210 ? srso_alias_return_thunk+0x5/0xfbef5 ? srso_alias_return_thunk+0x5/0xfbef5 ? __kthread_parkme+0xce/0xf0 ? __pfx_cifs_demultiplex_thread+0x10/0x10 [cifs] kthread+0x18d/0x1d0 ? kthread+0xdb/0x1d0 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x34/0x60 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1b/0x30 </TASK>
This fixes CVE-2023-6606.
--- fs/cifs/misc.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/cifs/misc.c +4 -0
@@ -334,6 +334,10 @@ checkSMB(char *buf, unsigned int total_read, struct TCP_Server_Info *server)cifs_dbg (VFS ,"Length less than smb header size\n" ); }return -EIO ; + }else if (total_read <sizeof (*smb) +2 * smb->WordCount) { +cifs_dbg (VFS ,"%s: can't read BCC due to invalid WordCount(%u)\n" , + __func__, smb->WordCount); +return -EIO ; }/* otherwise, there is enough to get to the BCC */
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 31/190 IB/hfi1: Fix sdma.h tx->num_descs off-by-one error
In reply to a message not in the archiveFrom: Daniel Vacek <[email protected]>
[ Upstream commit e6f57c6881916df39db7d95981a8ad2b9c3458d6 ]
Unfortunately the commit fd8958efe877 introduced another error causing the descs array to overflow. This reults in further crashes easily reproducible by sendmsg system call.
[ 1080.836473] general protection fault, probably for non-canonical address 0x400300015528b00a: 0000 [#1] PREEMPT SMP PTI [ 1080.869326] RIP: 0010:hfi1_ipoib_build_ib_tx_headers.constprop.0+0xe1/0x2b0 [hfi1] -- [ 1080.974535] Call Trace: [ 1080.976990] <TASK> [ 1081.021929] hfi1_ipoib_send_dma_common+0x7a/0x2e0 [hfi1] [ 1081.027364] hfi1_ipoib_send_dma_list+0x62/0x270 [hfi1] [ 1081.032633] hfi1_ipoib_send+0x112/0x300 [hfi1] [ 1081.042001] ipoib_start_xmit+0x2a9/0x2d0 [ib_ipoib] [ 1081.046978] dev_hard_start_xmit+0xc4/0x210 -- [ 1081.148347] __sys_sendmsg+0x59/0xa0
crash> ipoib_txreq 0xffff9cfeba229f00
struct ipoib_txreq {
txreq = {
list = {
next = 0xffff9cfeba229f00,
prev = 0xffff9cfeba229f00
},
descp = 0xffff9cfeba229f40,
coalesce_buf = 0x0,
wait = 0xffff9cfea4e69a48,
complete = 0xffffffffc0fe0760 <hfi1_ipoib_sdma_complete>,
packet_len = 0x46d,
tlen = 0x0,
num_desc = 0x0,
desc_limit = 0x6,
next_descq_idx = 0x45c,
coalesce_idx = 0x0,
flags = 0x0,
descs = {{
qw = {0x8024000120dffb00, 0x4} # SDMA_DESC0_FIRST_DESC_FLAG (bit 63)
}, {
qw = { 0x3800014231b108, 0x4}
}, {
qw = { 0x310000e4ee0fcf0, 0x8}
}, {
qw = { 0x3000012e9f8000, 0x8}
}, {
qw = { 0x59000dfb9d0000, 0x8}
}, {
qw = { 0x78000e02e40000, 0x8}
}} },
sdma_hdr = 0x400300015528b000, <<< invalid pointer in the tx request structure
sdma_status = 0x0, SDMA_DESC0_LAST_DESC_FLAG (bit 62)
complete = 0x0,
priv = 0x0,
txq = 0xffff9cfea4e69880,
skb = 0xffff9d099809f400
}
If an SDMA send consists of exactly 6 descriptors and requires dword padding (in the 7th descriptor), the sdma_txreq descriptor array is not properly expanded and the packet will overflow into the container structure. This results in a panic when the send completion runs. The exact panic varies depending on what elements of the container structure get corrupted. The fix is to use the correct expression in _pad_sdma_tx_descs() to test the need to expand the descriptor array.
With this patch the crashes are no longer reproducible and the machine is stable.
--- drivers/infiniband/hw/hfi1/sdma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/hfi1/sdma.c +1 -1
@@ -3212,7 +3212,7 @@ int _pad_sdma_tx_descs(struct hfi1_devdata *dd, struct sdma_txreq *tx) {int rval =0 ; -if ((unlikely (tx->num_desc +1 == tx->desc_limit))) { +if ((unlikely (tx->num_desc == tx->desc_limit))) { rval =_extend_sdma_tx_descs (dd, tx);if (rval) {__sdma_txclean (dd, tx);
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 32/190 pinctrl: amd: Only use special debounce behavior for GPIO 0
In reply to a message not in the archiveFrom: Mario Limonciello <[email protected]>
[ Upstream commit 0d5ace1a07f7e846d0f6d972af60d05515599d0b ]
It's uncommon to use debounce on any other pin, but technically we should only set debounce to 0 when working off GPIO0.
--- drivers/pinctrl/pinctrl-amd.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/pinctrl/pinctrl-amd.c +5 -3
@@ -116,9 +116,11 @@ static int amd_gpio_set_debounce(struct gpio_chip *gc, unsigned offset,raw_spin_lock_irqsave (&gpio_dev->lock, flags);/* Use special handling for Pin0 debounce */ - pin_reg =readl (gpio_dev->base +WAKE_INT_MASTER_REG ); -if (pin_reg &INTERNAL_GPIO0_DEBOUNCE ) - debounce =0 ; +if (offset ==0 ) { + pin_reg =readl (gpio_dev->base +WAKE_INT_MASTER_REG ); +if (pin_reg &INTERNAL_GPIO0_DEBOUNCE ) + debounce =0 ; + } pin_reg =readl (gpio_dev->base + offset *4 );
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 33/190 PCI: qcom: Disable write access to read only registers for IP v2.3.3
In reply to a message not in the archiveFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit a33d700e8eea76c62120cb3dbf5e01328f18319a ]
In the post init sequence of v2.9.0, write access to read only registers are not disabled after updating the registers. Fix it by disabling the access after register update.
--- drivers/pci/dwc/pcie-qcom.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/pci/dwc/pcie-qcom.c +2 -0
@@ -730,6 +730,8 @@ static int qcom_pcie_get_resources_2_4_0(struct qcom_pcie *pcie)if (IS_ERR (res->phy_ahb_reset))return PTR_ERR (res->phy_ahb_reset); +dw_pcie_dbi_ro_wr_dis (pci); +return 0 ; }
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 34/190 ASoC: cs42l51: fix driver to properly autoload with automatic module loading
In reply to a message not in the archiveFrom: Thomas Petazzoni <[email protected]>
[ Upstream commit e51df4f81b02bcdd828a04de7c1eb6a92988b61e ]
In commit 2cb1e0259f50 ("ASoC: cs42l51: re-hook of_match_table pointer"), 9 years ago, some random guy fixed the cs42l51 after it was split into a core part and an I2C part to properly match based on a Device Tree compatible string.
However, the fix in this commit is wrong: the MODULE_DEVICE_TABLE(of, ....) is in the core part of the driver, not the I2C part. Therefore, automatic module loading based on module.alias, based on matching with the DT compatible string, loads the core part of the driver, but not the I2C part. And threfore, the i2c_driver is not registered, and the codec is not known to the system, nor matched with a DT node with the corresponding compatible string.
In order to fix that, we move the MODULE_DEVICE_TABLE(of, ...) into the I2C part of the driver. The cs42l51_of_match[] array is also moved as well, as it is not possible to have this definition in one file, and the MODULE_DEVICE_TABLE(of, ...) invocation in another file, due to how MODULE_DEVICE_TABLE works.
Thanks to this commit, the I2C part of the driver now properly autoloads, and thanks to its dependency on the core part, the core part gets autoloaded as well, resulting in a functional sound card without having to manually load kernel modules.
--- sound/soc/codecs/cs42l51-i2c.c | 6 ++++++ sound/soc/codecs/cs42l51.c | 7 ------- sound/soc/codecs/cs42l51.h | 1 - 3 files changed, 6 insertions(+), 8 deletions(-)
sound/soc/codecs/cs42l51-i2c.c +6 -0
@@ -23,6 +23,12 @@ static struct i2c_device_id cs42l51_i2c_id[] = { };MODULE_DEVICE_TABLE (i2c, cs42l51_i2c_id); +const struct of_device_id cs42l51_of_match[] = { + { .compatible ="cirrus,cs42l51" , }, + { } +}; +MODULE_DEVICE_TABLE (of, cs42l51_of_match); +static int cs42l51_i2c_probe (struct i2c_client *i2c,const struct i2c_device_id *id) {
sound/soc/codecs/cs42l51.c +0 -7
@@ -562,13 +562,6 @@ int cs42l51_probe(struct device *dev, struct regmap *regmap) }EXPORT_SYMBOL_GPL (cs42l51_probe); -const struct of_device_id cs42l51_of_match[] = { - { .compatible ="cirrus,cs42l51" , }, - { } -}; -MODULE_DEVICE_TABLE (of, cs42l51_of_match); -EXPORT_SYMBOL_GPL (cs42l51_of_match); -MODULE_AUTHOR ("Arnaud Patard <[email protected]>" );MODULE_DESCRIPTION ("Cirrus Logic CS42L51 ALSA SoC Codec Driver" );MODULE_LICENSE ("GPL" );
sound/soc/codecs/cs42l51.h +0 -1
@@ -22,7 +22,6 @@ struct device;extern const struct regmap_config cs42l51_regmap;int cs42l51_probe (struct device *dev,struct regmap *regmap); -extern const struct of_device_id cs42l51_of_match[];#define CS42L51_CHIP_ID 0x1B#define CS42L51_CHIP_REV_A 0x00
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 41/190 r8169: fix the KCSAN reported data-race in rtl_tx while reading TxDescArray[entry].opts1
In reply to a message not in the archiveFrom: Mirsad Goran Todorovac <[email protected]>
[ Upstream commit dcf75a0f6bc136de94e88178ae5f51b7f879abc9 ]
KCSAN reported the following data-race:
==================================================================
BUG: KCSAN: data-race in rtl8169_poll (drivers/net/ethernet/realtek/r8169_main.c:4368 drivers/net/ethernet/realtek/r8169_main.c:4581) r8169
race at unknown origin, with read to 0xffff888140d37570 of 4 bytes by interrupt on cpu 21:rtl8169_poll (drivers/net/ethernet/realtek/r8169_main.c:4368 drivers/net/ethernet/realtek/r8169_main.c:4581) r8169 __napi_poll (net/core/dev.c:6527)net_rx_action (net/core/dev.c:6596 net/core/dev.c:6727)__do_softirq (kernel/softirq.c:553)__irq_exit_rcu (kernel/softirq.c:427 kernel/softirq.c:632)irq_exit_rcu (kernel/softirq.c:647)sysvec_apic_timer_interrupt (arch/x86/kernel/apic/apic.c:1074 (discriminator 14)) asm_sysvec_apic_timer_interrupt (./arch/x86/include/asm/idtentry.h:645)cpuidle_enter_state (drivers/cpuidle/cpuidle.c:291)cpuidle_enter (drivers/cpuidle/cpuidle.c:390)call_cpuidle (kernel/sched/idle.c:135)
do_idle (kernel/sched/idle.c:219 kernel/sched/idle.c:282) cpu_startup_entry (kernel/sched/idle.c:378 (discriminator 1)) start_secondary (arch/x86/kernel/smpboot.c:210 arch/x86/kernel/smpboot.c:294)
secondary_startup_64_no_verify (arch/x86/kernel/head_64.S:433)
value changed: 0xb0000042 -> 0x00000000
Reported by Kernel Concurrency Sanitizer on:
CPU: 21 PID: 0 Comm: swapper/21 Tainted: G L 6.6.0-rc2-kcsan-00143-gb5cbe7c00aa0 #41 Hardware name: ASRock X670E PG Lightning/X670E PG Lightning, BIOS 1.21 04/26/2023 ==================================================================
The read side is in
drivers/net/ethernet/realtek/r8169_main.c
=========================================
4355 static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp,
4356 int budget)
4357 {
4358 unsigned int dirty_tx, bytes_compl = 0, pkts_compl = 0;
4359 struct sk_buff *skb;
4360
4361 dirty_tx = tp->dirty_tx;
4362
4363 while (READ_ONCE(tp->cur_tx) != dirty_tx) {
4364 unsigned int entry = dirty_tx % NUM_TX_DESC;
4365 u32 status;
4366
→ 4367 status = le32_to_cpu(tp->TxDescArray[entry].opts1);
4368 if (status & DescOwn)
4369 break;
4370
4371 skb = tp->tx_skb[entry].skb;
4372 rtl8169_unmap_tx_skb(tp, entry);
4373
4374 if (skb) {
4375 pkts_compl++;
4376 bytes_compl += skb->len;
4377 napi_consume_skb(skb, budget);
4378 }
4379 dirty_tx++;
4380 }
4381
4382 if (tp->dirty_tx != dirty_tx) {
4383 dev_sw_netstats_tx_add(dev, pkts_compl, bytes_compl);
4384 WRITE_ONCE(tp->dirty_tx, dirty_tx);
4385
4386 netif_subqueue_completed_wake(dev, 0, pkts_compl, bytes_compl,
4387 rtl_tx_slots_avail(tp),
4388 R8169_TX_START_THRS);
4389 /*
4390 * 8168 hack: TxPoll requests are lost when the Tx packets are
4391 * too close. Let's kick an extra TxPoll request when a burst
4392 * of start_xmit activity is detected (if it is not detected,
4393 * it is slow enough). -- FR
4394 * If skb is NULL then we come here again once a tx irq is
4395 * triggered after the last fragment is marked transmitted.
4396 */ 4397 if (READ_ONCE(tp->cur_tx) != dirty_tx && skb)
4398 rtl8169_doorbell(tp);
4399 }
4400 }
tp->TxDescArray[entry].opts1 is reported to have a data-race and READ_ONCE() fixes this KCSAN warning.
4366
→ 4367 status = le32_to_cpu(READ_ONCE(tp->TxDescArray[entry].opts1));
4368 if (status & DescOwn)
4369 break;
4370
--- drivers/net/ethernet/realtek/r8169.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/realtek/r8169.c +1 -1
@@ -7313,7 +7313,7 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp)struct ring_info *tx_skb = tp->tx_skb + entry;u32 status; - status =le32_to_cpu (tp->TxDescArray[entry].opts1); + status =le32_to_cpu (READ_ONCE (tp->TxDescArray[entry].opts1));if (status & DescOwn)break ;
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 44/190 PCI: keystone: Don't discard .remove() callback
In reply to a message not in the archiveFrom: Uwe Kleine-König <[email protected]>
[ Upstream commit 200bddbb3f5202bbce96444fdc416305de14f547 ]
With CONFIG_PCIE_KEYSTONE=y and ks_pcie_remove() marked with __exit, the function is discarded from the driver. In this case a bound device can still get unbound, e.g via sysfs. Then no cleanup code is run resulting in resource leaks or worse.
The right thing to do is do always have the remove callback available. Note that this driver cannot be compiled as a module, so ks_pcie_remove() was always discarded before this change and modpost couldn't warn about this issue. Furthermore the __ref annotation also prevents a warning.
--- drivers/pci/dwc/pci-keystone.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/dwc/pci-keystone.c +2 -2
@@ -379,7 +379,7 @@ static const struct dw_pcie_ops dw_pcie_ops = { .link_up = ks_dw_pcie_link_up, }; -static int __exit ks_pcie_remove(struct platform_device *pdev) +static int ks_pcie_remove (struct platform_device *pdev) {struct keystone_pcie *ks_pcie =platform_get_drvdata (pdev);
@@ -457,7 +457,7 @@ static int __init ks_pcie_probe(struct platform_device *pdev)static struct platform_driver ks_pcie_driver__refdata = { .probe = ks_pcie_probe, - .remove =__exit_p (ks_pcie_remove), + .remove = ks_pcie_remove, .driver = { .name ="keystone-pcie" , .of_match_table =of_match_ptr (ks_pcie_of_match),
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 45/190 PCI: keystone: Don't discard .probe() callback
In reply to a message not in the archiveFrom: Uwe Kleine-König <[email protected]>
[ Upstream commit 7994db905c0fd692cf04c527585f08a91b560144 ]
The __init annotation makes the ks_pcie_probe() function disappear after booting completes. However a device can also be bound later. In that case, we try to call ks_pcie_probe(), but the backing memory is likely already overwritten.
The right thing to do is do always have the probe callback available. Note that the (wrong) __refdata annotation prevented this issue to be noticed by modpost.
--- drivers/pci/dwc/pci-keystone.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pci/dwc/pci-keystone.c +2 -2
@@ -388,7 +388,7 @@ static int ks_pcie_remove(struct platform_device *pdev)return 0 ; } -static int __init ks_pcie_probe (struct platform_device *pdev) +static int ks_pcie_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev;struct dw_pcie *pci;
@@ -455,7 +455,7 @@ static int __init ks_pcie_probe(struct platform_device *pdev)return ret; } -static struct platform_driver ks_pcie_driver__refdata = { +static struct platform_driver ks_pcie_driver = { .probe = ks_pcie_probe, .remove = ks_pcie_remove, .driver = {
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 46/190 ksmbd: fix wrong name of SMB2_CREATE_ALLOCATION_SIZE
In reply to a message not in the archiveFrom: Namjae Jeon <[email protected]>
[ Upstream commit 13736654481198e519059d4a2e2e3b20fa9fdb3e ]
MS confirm that "AISi" name of SMB2_CREATE_ALLOCATION_SIZE in MS-SMB2 specification is a typo. cifs/ksmbd have been using this wrong name from MS-SMB2. It should be "AlSi". Also It will cause problem when running smb2.create.open test in smbtorture against ksmbd.
--- fs/cifs/smb2pdu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/smb2pdu.h +1 -1
@@ -485,7 +485,7 @@ struct smb2_tree_disconnect_rsp {#define SMB2_CREATE_SD_BUFFER "SecD"/* security descriptor */ #define SMB2_CREATE_DURABLE_HANDLE_REQUEST "DHnQ"#define SMB2_CREATE_DURABLE_HANDLE_RECONNECT "DHnC" -#define SMB2_CREATE_ALLOCATION_SIZE "AISi" +#define SMB2_CREATE_ALLOCATION_SIZE "AlSi"#define SMB2_CREATE_QUERY_MAXIMAL_ACCESS_REQUEST "MxAc"#define SMB2_CREATE_TIMEWARP_REQUEST "TWrp"#define SMB2_CREATE_QUERY_ON_DISK_ID "QFid"
Signature · 1 line
2.43.0
Sasha Levin
maintainerPATCH 49/190 usb: musb: fix MUSB_QUIRK_B_DISCONNECT_99 handling
In reply to a message not in the archiveFrom: Thomas Petazzoni <[email protected]>
[ Upstream commit b65ba0c362be665192381cc59e3ac3ef6f0dd1e1 ]
In commit 92af4fc6ec33 ("usb: musb: Fix suspend with devices connected for a64"), the logic to support the MUSB_QUIRK_B_DISCONNECT_99 quirk was modified to only conditionally schedule the musb->irq_work delayed work.
This commit badly breaks ECM Gadget on AM335X. Indeed, with this commit, one can observe massive packet loss:
$ ping 192.168.0.100 ... 15 packets transmitted, 3 received, 80% packet loss, time 14316ms
Reverting this commit brings back a properly functioning ECM Gadget. An analysis of the commit seems to indicate that a mistake was
made: the previous code was not falling through into the MUSB_QUIRK_B_INVALID_VBUS_91, but now it is, unless the condition is taken.
Changing the logic to be as it was before the problematic commit *and* only conditionally scheduling musb->irq_work resolves the regression:
$ ping 192.168.0.100 ... 64 packets transmitted, 64 received, 0% packet loss, time 64475ms
--- drivers/usb/musb/musb_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/usb/musb/musb_core.c +1 -2
@@ -1869,9 +1869,8 @@ static void musb_pm_runtime_check_session(struct musb *musb)schedule_delayed_work (&musb->irq_work,msecs_to_jiffies (1000 )); musb->quirk_retries--; -break ; } -/* fall through */ +break ;case MUSB_QUIRK_B_INVALID_VBUS_91 :if (musb->quirk_retries && !musb->flush_irq_work) { musb_dbg(musb,
Signature · 1 line
2.43.0
Re: [PATCH 4.14-openela 009/190] block: fix signed int overflow in Amiga partition support
In reply to Sasha LevinQuoted 17 lines · Sasha Levin
From: Michael Schmitz <[email protected]>
[ Upstream commit
fc3d092c6bb48d5865fec15ed5b333c12f36288c]The Amiga partition parser module uses signed int for partition sector address and count, which will overflow for disks larger than 1 TB.
Use
sector_tas type for sector address and size to allow using disks up to 2 TB without LBD support, and disks larger than 2 TB with LBD.This bug was reported originally in 2012, and the fix was created by the RDB author, Joanne Dow <[email protected]>. A patch had been discussed and reviewed on linux-m68k at that time but never officially submitted. This patch differs from Joanne's patch only in its use of
sector_tinstead of unsigned int. No checking for overflows is done (see patch 3 of this series for that).
Quoted 5 lines
Reported-by Martin Steigerwald <[email protected]>Fixes 1da177e4c3f4 ("Linux-2.6.12-rc2")Message-ID: <[email protected]>
Cc: <[email protected]> # 5.2
^^^
Before commit 72deb455b5ec619f ("block: remove CONFIG_LBDAF") in v5.2, support for 64-bit sector_t and blkcnt_t was optional on 32-bit architectures.
Quoted 33 lines
Signed-off-by Michael Schmitz <[email protected]>Tested-by Martin Steigerwald <[email protected]>Reviewed-by Geert Uytterhoeven <[email protected]>Reviewed-by Christoph Hellwig <[email protected]>Signed-off-by Jens Axboe <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- block/partitions/amiga.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)block/partitions/amiga.c +4
-3@@ -32,7 +32,8 @@ int amiga_partition(struct parsed_partitions *state)unsigned char *data;struct RigidDiskBlock *rdb;struct PartitionBlock *pb; -int start_sect, nr_sects, blk, part, res =0 ; +sector_t start_sect, nr_sects; +int blk, part, res =0 ;int blksize =1 ;/* Multiplier for disk block size */ int slot =1 ;char b[BDEVNAME_SIZE ];@@ -100,14 +101,14 @@ int amiga_partition(struct parsed_partitions *state)/* Tell Kernel about it */ - nr_sects = (be32_to_cpu (pb->pb_Environment[10 ]) +1 - - be32_to_cpu(pb->pb_Environment[9])) * + nr_sects = ((sector_t )be32_to_cpu (pb->pb_Environment[10 ]) +1 - + be32_to_cpu(pb->pb_Environment[9])) *
block/partitions/amiga.c int amiga_partition(struct parsed_partitions *state) · line 114
Quoted 10 lines
block/partitions/amiga.c +1
-1be32_to_cpu (pb->pb_Environment[3 ]) *be32_to_cpu (pb->pb_Environment[5 ]) * blksize;if (!nr_sects)continue ; - start_sect =be32_to_cpu (pb->pb_Environment[9 ]) * + start_sect = (sector_t )be32_to_cpu (pb->pb_Environment[9 ]) *be32_to_cpu (pb->pb_Environment[3 ]) *be32_to_cpu (pb->pb_Environment[5 ]) * blksize;
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]
In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds