From: Greg Kroah-Hartman Date: Mon, 24 Apr 2023 11:35:00 +0000 (+0200) Subject: 4.19-stable patches X-Git-Tag: v4.14.314~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c6333ce98ec24d8c19def311d8caf23a54833021;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: asn.1-fix-check-for-strdup-success.patch iio-adc-at91-sama5d2_adc-fix-an-error-code-in-at91_adc_allocate_trigger.patch --- diff --git a/queue-4.19/asn.1-fix-check-for-strdup-success.patch b/queue-4.19/asn.1-fix-check-for-strdup-success.patch new file mode 100644 index 00000000000..054ad91d2b4 --- /dev/null +++ b/queue-4.19/asn.1-fix-check-for-strdup-success.patch @@ -0,0 +1,40 @@ +From 5a43001c01691dcbd396541e6faa2c0077378f48 Mon Sep 17 00:00:00 2001 +From: Ekaterina Orlova +Date: Fri, 21 Apr 2023 15:35:39 +0100 +Subject: ASN.1: Fix check for strdup() success + +From: Ekaterina Orlova + +commit 5a43001c01691dcbd396541e6faa2c0077378f48 upstream. + +It seems there is a misprint in the check of strdup() return code that +can lead to NULL pointer dereference. + +Found by Linux Verification Center (linuxtesting.org) with SVACE. + +Fixes: 4520c6a49af8 ("X.509: Add simple ASN.1 grammar compiler") +Signed-off-by: Ekaterina Orlova +Cc: David Woodhouse +Cc: James Bottomley +Cc: Jarkko Sakkinen +Cc: keyrings@vger.kernel.org +Cc: linux-kbuild@vger.kernel.org +Link: https://lore.kernel.org/r/20230315172130.140-1-vorobushek.ok@gmail.com/ +Signed-off-by: David Howells +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + scripts/asn1_compiler.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/scripts/asn1_compiler.c ++++ b/scripts/asn1_compiler.c +@@ -629,7 +629,7 @@ int main(int argc, char **argv) + p = strrchr(argv[1], '/'); + p = p ? p + 1 : argv[1]; + grammar_name = strdup(p); +- if (!p) { ++ if (!grammar_name) { + perror(NULL); + exit(1); + } diff --git a/queue-4.19/iio-adc-at91-sama5d2_adc-fix-an-error-code-in-at91_adc_allocate_trigger.patch b/queue-4.19/iio-adc-at91-sama5d2_adc-fix-an-error-code-in-at91_adc_allocate_trigger.patch new file mode 100644 index 00000000000..d3d506e2279 --- /dev/null +++ b/queue-4.19/iio-adc-at91-sama5d2_adc-fix-an-error-code-in-at91_adc_allocate_trigger.patch @@ -0,0 +1,32 @@ +From 73a428b37b9b538f8f8fe61caa45e7f243bab87c Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Wed, 29 Mar 2023 07:35:32 +0300 +Subject: iio: adc: at91-sama5d2_adc: fix an error code in at91_adc_allocate_trigger() + +From: Dan Carpenter + +commit 73a428b37b9b538f8f8fe61caa45e7f243bab87c upstream. + +The at91_adc_allocate_trigger() function is supposed to return error +pointers. Returning a NULL will cause an Oops. + +Fixes: 5e1a1da0f8c9 ("iio: adc: at91-sama5d2_adc: add hw trigger and buffer support") +Signed-off-by: Dan Carpenter +Link: https://lore.kernel.org/r/5d728f9d-31d1-410d-a0b3-df6a63a2c8ba@kili.mountain +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman +--- + drivers/iio/adc/at91-sama5d2_adc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/adc/at91-sama5d2_adc.c ++++ b/drivers/iio/adc/at91-sama5d2_adc.c +@@ -989,7 +989,7 @@ static struct iio_trigger *at91_adc_allo + trig = devm_iio_trigger_alloc(&indio->dev, "%s-dev%d-%s", indio->name, + indio->id, trigger_name); + if (!trig) +- return NULL; ++ return ERR_PTR(-ENOMEM); + + trig->dev.parent = indio->dev.parent; + iio_trigger_set_drvdata(trig, indio); diff --git a/queue-4.19/series b/queue-4.19/series index 5eddc3a9290..1337036a3e9 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -25,3 +25,5 @@ inet6-remove-inet6_destroy_sock-in-sk-sk_prot-destroy.patch dccp-call-inet6_destroy_sock-via-sk-sk_destruct.patch sctp-call-inet6_destroy_sock-via-sk-sk_destruct.patch counter-104-quad-8-fix-race-condition-between-flag-and-cntr-reads.patch +iio-adc-at91-sama5d2_adc-fix-an-error-code-in-at91_adc_allocate_trigger.patch +asn.1-fix-check-for-strdup-success.patch