firewire: fixes for v6.9-rc6
The following two driver fixes: * The firewire-ohci driver for 1394 OHCI hardware does not fill time stamp for response packet when handling asynchronous transaction to local destination. This brings an inconvenience that the response packet is not equivalent between the transaction to local and remote. It is fixed by fulfilling the time stamp with hardware time. The fix should be applied to Linux kernel v6.5 or later as well. * The nosy driver for Texas Instruments TSB12LV21A (PCILynx) has long-standing issue about the behaviour when user space application passes less size of buffer than expected. It is fixed by returning zero according to the convention of UNIX-like systems. -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQQE66IEYNDXNBPeGKSsLtaWM8LwEwUCZjN/5AAKCRCsLtaWM8Lw E7lnAP9wMPBAsCTIGeoRO4CVReooSzxrVztLt8udrc+bhe/jjgD+LlbfjNQoeGYV iWpZI1xTzx+LYKpgVRGjnE68QN8rQQ4= =jGSI -----END PGP SIGNATURE----- Merge tag 'firewire-fixes-6.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394 Pull firewire fixes from Takashi Sakamoto: "Two driver fixes: - The firewire-ohci driver for 1394 OHCI hardware does not fill time stamp for response packet when handling asynchronous transaction to local destination. This brings an inconvenience that the response packet is not equivalent between the transaction to local and remote. It is fixed by fulfilling the time stamp with hardware time. The fix should be applied to Linux kernel v6.5 or later as well. - The nosy driver for Texas Instruments TSB12LV21A (PCILynx) has long-standing issue about the behaviour when user space application passes less size of buffer than expected. It is fixed by returning zero according to the convention of UNIX-like systems" * tag 'firewire-fixes-6.9-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394: firewire: ohci: fulfill timestamp for some local asynchronous transaction firewire: nosy: ensure user_length is taken into account when fetching packet contents
This commit is contained in:
commit
49a73b1652
@ -148,10 +148,12 @@ packet_buffer_get(struct client *client, char __user *data, size_t user_length)
|
||||
if (atomic_read(&buffer->size) == 0)
|
||||
return -ENODEV;
|
||||
|
||||
/* FIXME: Check length <= user_length. */
|
||||
length = buffer->head->length;
|
||||
|
||||
if (length > user_length)
|
||||
return 0;
|
||||
|
||||
end = buffer->data + buffer->capacity;
|
||||
length = buffer->head->length;
|
||||
|
||||
if (&buffer->head->data[length] < end) {
|
||||
if (copy_to_user(data, buffer->head->data, length))
|
||||
|
@ -1556,6 +1556,8 @@ static int handle_at_packet(struct context *context,
|
||||
#define HEADER_GET_DATA_LENGTH(q) (((q) >> 16) & 0xffff)
|
||||
#define HEADER_GET_EXTENDED_TCODE(q) (((q) >> 0) & 0xffff)
|
||||
|
||||
static u32 get_cycle_time(struct fw_ohci *ohci);
|
||||
|
||||
static void handle_local_rom(struct fw_ohci *ohci,
|
||||
struct fw_packet *packet, u32 csr)
|
||||
{
|
||||
@ -1580,6 +1582,8 @@ static void handle_local_rom(struct fw_ohci *ohci,
|
||||
(void *) ohci->config_rom + i, length);
|
||||
}
|
||||
|
||||
// Timestamping on behalf of the hardware.
|
||||
response.timestamp = cycle_time_to_ohci_tstamp(get_cycle_time(ohci));
|
||||
fw_core_handle_response(&ohci->card, &response);
|
||||
}
|
||||
|
||||
@ -1628,6 +1632,8 @@ static void handle_local_lock(struct fw_ohci *ohci,
|
||||
fw_fill_response(&response, packet->header, RCODE_BUSY, NULL, 0);
|
||||
|
||||
out:
|
||||
// Timestamping on behalf of the hardware.
|
||||
response.timestamp = cycle_time_to_ohci_tstamp(get_cycle_time(ohci));
|
||||
fw_core_handle_response(&ohci->card, &response);
|
||||
}
|
||||
|
||||
@ -1670,8 +1676,6 @@ static void handle_local_request(struct context *ctx, struct fw_packet *packet)
|
||||
}
|
||||
}
|
||||
|
||||
static u32 get_cycle_time(struct fw_ohci *ohci);
|
||||
|
||||
static void at_context_transmit(struct context *ctx, struct fw_packet *packet)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
Loading…
x
Reference in New Issue
Block a user